From a7e00f338ed28dfc2ba4e343085bd76edc349de4 Mon Sep 17 00:00:00 2001 From: nbd Date: Tue, 9 Dec 2008 01:53:02 +0000 Subject: atheros: fix reboot on ar2315 devices which do not implement the atheros reference design workaround for the buggy reset logic (e.g. some senao stuff) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13556 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../atheros/files/arch/mips/atheros/ar5315/board.c | 25 ++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'target/linux/atheros/files') diff --git a/target/linux/atheros/files/arch/mips/atheros/ar5315/board.c b/target/linux/atheros/files/arch/mips/atheros/ar5315/board.c index fad5783c5..6ee75a966 100644 --- a/target/linux/atheros/files/arch/mips/atheros/ar5315/board.c +++ b/target/linux/atheros/files/arch/mips/atheros/ar5315/board.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -279,15 +280,21 @@ static void ar5315_power_off(void) static void ar5315_restart(char *command) { - for(;;) { - /* reset the system */ - sysRegWrite(AR5315_COLD_RESET,AR5317_RESET_SYSTEM); - - /* - * Cold reset does not work on the AR2315/6, use the GPIO reset bits a workaround. - */ - gpio_direction_output(AR5315_RESET_GPIO, 0); - } + void (*mips_reset_vec)(void) = (void *) 0xbfc00000; + + /* reset the system */ + sysRegWrite(AR5315_COLD_RESET,AR5317_RESET_SYSTEM); + + /* Cold reset does not work on the AR2315/6, use the GPIO reset bits a workaround. + * give it some time to attempt a gpio based hardware reset + * (atheros reference design workaround) */ + gpio_direction_output(AR5315_RESET_GPIO, 0); + mdelay(100); + + /* Some boards (e.g. Senao EOC-2610) don't implement the reset logic + * workaround. Attempt to jump to the mips reset location - + * the boot loader itself might be able to recover the system */ + mips_reset_vec(); } -- cgit v1.2.3