GPIO reset button support

Hi I see Squashfs is the file system used on Openwrt with a implementation of Union file system.

I'm wanting to add reset button support for my router.
I found the base code /openwrt/package/base-files/files/etc/rc.button/reset

I believe i need to edit the dts file for my router in the below directory:

/openwrt/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/

And add something llike this:

keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;

  reset {
  	label = "reset";
  	gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
  	linux,code = <KEY_RESTART>;
  };

In the make file the dts is defined as qcom-ipq4019-DR4029
im guessing I just add my code in there and that is it ?

Which Makefile?

Code = your mentioned definition in the dts?

Sorry I'm compiling from wallytech's source for the dr4029 below the target it is not in the openwrt master yet:

Wallystech/openwrt: Wallys-19.07.2 branch of OpenWrt (on top of OpenWrt 19.07.2). Supported devices:DR531,DR344,DR342,DR4029,DR4018. (github.com)

openwrt/Makefile at wallys-19.07.2 · Wallystech/openwrt · GitHub

define Device/Wallys_DR4029
$(call Device/FitImage)
$(call Device/UbiFit)
DEVICE_DTS := qcom-ipq4019-DR4029
DEVICE_DTS_CONFIG := config@ap.dk07.1-c1
KERNEL_INSTALL := 1
KERNEL_SIZE := 4048k
BLOCKSIZE := 128k
PAGESIZE := 2048
BOARD_NAME := DR4029
DEVICE_TITLE := Wallys DR4029

The GPIO node is called &tlmm for ipq401x, also you could use
compatible = "gpio-keys";
(interrupt-based) instead of gpio-keys-polled, and thus remove the poll-interval.
The keys node would go after soc , i.e. insert between lines 232-233.

Did you verifiy which gpio pin is actually connected to the reset button, or are you just trying to add your own reset button to a different gpio? (It looks like there is a tactile switch on the board next to the power connector, but there is currently no reset gpio definition in the Wallytech dts at all...)

There is a reset button on the board the one you mention next to the power plug.
I don't have any developer documentation but I think it is gpio 29, but I have contact with the dev at Wally's I can confirm this.

The board comes with qsdk openwrt but the dev said that some use it as a sim card switch so it is unasigned currently.
I saw an include in another device I can add that also.

So I will have this the reset is 18 im told, sim switch is 11 and the led's are 32, 36, 50 and 39 for the wallys dr4029

keys {
compatible = "gpio-keys";

reset {
label = "reset";
gpios = <&tlmm 18 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};

it looks like I need to use tcsr and possibly need to add a usb power toggle with a gpio as it seems usb is undefined not working :frowning: