MT7621 soc HW watchdog does not work?

I use MT7621 soc, enabled internal HW watchdog,but at watchdog time out ,the system does not reboot and hangs.Why ?
i use linux 4.4.198 source code,mt7621_wdt.c

openwrt version is 17.01

1 Like

What flash chip does your router have?

1 Like

WINBOND-25q256JVFQ 32m spi nor

You need to enable stateless 4-byte opcode on it.

Thank you for your reply.Is there any linux4.x code patch exist?we use linux 4.4.198 source code.or i'll porting to it.

If you are sure all your routers don't use W25Q256FV, you can enable SPI_NOR_4B_OPCODES unconditionally.

SPI_NOR_4B_OPCODES is not define in this linux version code

So you have to backport it..

I've porting this code to linux 4.4.198,but the system still not reboot and huang after HW watchdog time out。

Try triggering a kernel panic to check if it reboots properly.
echo c > /proc/sysrq-trigger

reboot failed.hang

i add this code

and software reboot can become effective.but watchdog timeout still hang.

That means the flash chip is still in stateful 4-byte mode. Your backport does not work.

so you mean the flash use 3-byte mode all the time.then watchdog timeout will reboot automatic ?

I changed to linux 4.14.206 source code which has the patch stateful 4-byte mode。
software reboot cmd is effective.but watchdog timeout still hang.I think the key problem is not spi nor flash。

You still need to set SPI_NOR_4B_OPCODES

but mt7621 boot HW strapping is SPI 3-byte address mode.

anyhow i change HW spi nor flash into 16M,the watchdog still not work.

SPI_NOR_4B_OPCODES is stateless and not a mode