MT7620A GPIO Watchdog

I am trying to port OpenWRT to a device based on MT7620A. It has hardware GPIO based watchdog. It has one GPIO (GPIO#23) which must be toggled every 500 ms. When the device boots, UBoot configures this GPIO to run in timer mode and so device goes upto kernel loading mode. When Kernel loads, it loads GPIO definitions in DTS which causes the state of all GPIO to reset. The stops the toggle of WDT GPIO#23. As the timeout is only 500mS, the devices reboots. I have also added a watchdog section in the DTS to toggle the same GPIO but the kernel does not reach to the point where it starts this GPIO toggle watchdog.
Is there any way to prevent reset of the GPIO status as configured by UBoot so that the toggle of the watchdog GPIO continues to run? Or is there any way I can write some code that will instantaneouly start the toggle of the GPIO rather than let the Kernel do the GPIO toggle through DTS entry?

I assume you used kernel's GPIO watchdog. Is CONFIG_GPIO_WATCHDOG_ARCH_INITCALL enabled?

Yes, I am using Kernel's watchdog function. I have following code block in DTS:

	watchdog {
		compatible = "linux,wdt-gpio";
		gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
		hw_algo = "toggle";
		hw_margin_ms = <500>;
		always-running;
	};

I checked and CONFIG_GPIO_WATCHDOG_ARCH_INITCALL was not enabled. I enabled it. But the result is same.
Following is the output on console:

[    0.124178] pinctrl core: initialized pinctrl subsystem                                                                                                                                                         
[    0.130480] NET: Registered protocol family 16                                                                                                                                                                  
[    0.211211] rt2880_gpio 10000600.gpio: registering 24 gpios                                                                                                                                                     
[    0.216628] rt2880_gpio 10000600.gpio: registering 24 irq handlers                                                                                                                                              
[    0.223103] rt2880_gpio 10000638.gpio: registering 16 gpios                                                                                                                                                     
[    0.228489] rt2880_gpio 10000638.gpio: registering 16 irq handlers                                                                                                                                              
[    0.234970] rt2880_gpio 10000660.gpio: registering 32 gpios                                                                                                                                                     
[    0.240360] rt2880_gpio 10000660.gpio: registering 32 irq handlers                                                                                                                                              
[    0.246847] rt2880_gpio 10000688.gpio: registering 1 gpios                                                                                                                                                      
[    0.252150] rt2880_gpio 10000688.gpio: registering 1 irq handlers                                                                                                                                               
[    0.269971] clocksource: Switched to clocksource systick                                                                                                                                                        
[    0.276522] NET: Registered protocol family 2                                                                                                                                                                   
[    0.281128] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)                                                                                                                                  
[    0.289076] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)                                                                                                                     
[    0.297260] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)                                                                                                                             
[    0.304671] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)                                                                                                                                    
[    0.311512] TCP: Hash tables configured (established 1024 bind 1024)                                                                                                                                            
[    0.317821] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)                                                                                                                                          
[    0.324176] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)                                                                                                                                     
[    0.331253] NET: Registered protocol family 1                                                                                                                                                                   
[    0.335468] PCI: CLS 0 bytes, default 32

What happens is that when rt2880_gpio 10000600.gpio is printed on console, the toggle function enabled by bootloader stops and it leads to resetting of the router.
How can this be overcome? I.e. prevent stopping the toggle of the GPIO due to kernel loading GPIO function.

Thank you it worked. It didn't work when initramfs image is used. When squashfs was loaded, it worked.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.