fix reboot on ar5315

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10729 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
John Crispin 2008-04-03 21:40:40 +00:00
parent ee8cfeca57
commit 9693c70502
1 changed files with 2 additions and 6 deletions

View File

@ -28,6 +28,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <ar531x.h> #include <ar531x.h>
#include <linux/leds.h> #include <linux/leds.h>
#include <asm/gpio.h>
static int is_5315 = 0; static int is_5315 = 0;
@ -265,18 +266,13 @@ static void ar5315_restart(char *command)
{ {
unsigned int reg; unsigned int reg;
for(;;) { for(;;) {
/* reset the system */ /* reset the system */
sysRegWrite(AR5315_COLD_RESET,AR5317_RESET_SYSTEM); sysRegWrite(AR5315_COLD_RESET,AR5317_RESET_SYSTEM);
/* /*
* Cold reset does not work on the AR2315/6, use the GPIO reset bits a workaround. * Cold reset does not work on the AR2315/6, use the GPIO reset bits a workaround.
*/ */
gpio_direction_output(AR5315_RESET_GPIO, 0);
reg = sysRegRead(AR5315_GPIO_DO);
reg &= ~(1 << AR5315_RESET_GPIO);
sysRegWrite(AR5315_GPIO_DO, reg);
(void)sysRegRead(AR5315_GPIO_DO); /* flush write to hardware */
} }
} }