aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/atheros
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-12-09 01:53:02 +0000
committerFelix Fietkau <nbd@openwrt.org>2008-12-09 01:53:02 +0000
commitb2b5ca2373d09c0b2e0ee62c97731a75795340c2 (patch)
tree19854f30dc6041453274d0894b534203fe642ff5 /target/linux/atheros
parent181a743a722cb5d2d5b757ca84c2c7f58aa8d8f8 (diff)
downloadupstream-b2b5ca2373d09c0b2e0ee62c97731a75795340c2.tar.gz
upstream-b2b5ca2373d09c0b2e0ee62c97731a75795340c2.tar.bz2
upstream-b2b5ca2373d09c0b2e0ee62c97731a75795340c2.zip
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)
SVN-Revision: 13556
Diffstat (limited to 'target/linux/atheros')
-rw-r--r--target/linux/atheros/files/arch/mips/atheros/ar5315/board.c25
1 files changed, 16 insertions, 9 deletions
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 fad5783c55..6ee75a966e 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 <linux/platform_device.h>
#include <linux/kernel.h>
#include <linux/reboot.h>
+#include <linux/delay.h>
#include <asm/bootinfo.h>
#include <asm/reboot.h>
#include <asm/time.h>
@@ -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();
}