From 20937ce81a7807fb3506728edaaff731cee7e18c Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 15 Jun 2008 11:10:43 +0000 Subject: [PATCH] (5/6) bcm57xx: bcm4785 incomplete reboot I noticed my wrt350n would not reliably reboot after entering the reboot command. I found this code in the source for the wrt600n. It corrects the problem, and the wrt350n reboots reliably now. Signed-off-by: Ben Pfountz SVN-Revision: 11470 --- .../linux/brcm-2.4/files/arch/mips/bcm947xx/setup.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/target/linux/brcm-2.4/files/arch/mips/bcm947xx/setup.c b/target/linux/brcm-2.4/files/arch/mips/bcm947xx/setup.c index 00c4d9054cb..89e48236b0f 100644 --- a/target/linux/brcm-2.4/files/arch/mips/bcm947xx/setup.c +++ b/target/linux/brcm-2.4/files/arch/mips/bcm947xx/setup.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -89,9 +90,21 @@ bcm947xx_machine_restart(char *command) { printk("Please stand by while rebooting the system...\n"); + if (sb_chip(sbh) == BCM4785_CHIP_ID) + MTC0(C0_BROADCOM, 4, (1 << 22)); + /* Set the watchdog timer to reset immediately */ __cli(); sb_watchdog(sbh, 1); + + if (sb_chip(sbh) == BCM4785_CHIP_ID) { + __asm__ __volatile__( + ".set\tmips3\n\t" + "sync\n\t" + "wait\n\t" + ".set\tmips0"); + } + while (1); } -- 2.30.2