add reboot fix from #1312
authorFelix Fietkau <nbd@openwrt.org>
Wed, 14 Mar 2007 01:26:57 +0000 (01:26 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 14 Mar 2007 01:26:57 +0000 (01:26 +0000)
SVN-Revision: 6563

target/linux/brcm47xx-2.6/files/arch/mips/bcm947xx/setup.c
target/linux/brcm47xx-2.6/files/drivers/ssb/driver_chipcommon/chipcommon.c
target/linux/brcm47xx-2.6/files/include/linux/ssb/ssb_driver_chipcommon.h

index 547c50a7371cd704f96b6802fa3ba56bcbc3820d..f7687d4dd12e37321362d98c638b7d69c223b72e 100644 (file)
@@ -54,7 +54,7 @@ static void bcm47xx_machine_restart(char *command)
         */
 
        /* Set the watchdog timer to reset immediately */
-//TODO sb_watchdog(sbh, 1);
+       ssb_chipco_watchdog(&ssb.chipco, 1);
        while (1)
                cpu_relax();
 }
@@ -63,7 +63,7 @@ static void bcm47xx_machine_halt(void)
 {
        /* Disable interrupts and watchdog and spin forever */
        local_irq_disable();
-//TODO sb_watchdog(sbh, 0);
+       ssb_chipco_watchdog(&ssb.chipco, 0);
        while (1)
                cpu_relax();
 }
index c3d893d879087dd24f29df63a45fc7c372951ed0..6d3412b585461d7a68e3d196934d701e98bf1010 100644 (file)
@@ -401,3 +401,13 @@ int ssb_chipco_serial_init(struct ssb_chipcommon *cc,
        return nr_ports;
 }
 #endif /* CONFIG_SSB_SERIAL */
+
+/* Set chip watchdog reset timer to fire in 'ticks' backplane cycles */
+int
+ssb_chipco_watchdog(struct ssb_chipcommon *cc, uint ticks)
+{
+       /* instant NMI */
+       chipco_write32(cc, SSB_CHIPCO_WATCHDOG, ticks);
+       return 0;
+}
+EXPORT_SYMBOL(ssb_chipco_watchdog);
index 3d4fbdd77e2e9be13c9aca17e9481e845cc3818d..ba0b8702c2ac0cbf6c4bd49b5d7b7011fec8f380 100644 (file)
@@ -417,6 +417,7 @@ static inline u32 ssb_chipco_gpio_polarity(struct ssb_chipcommon *cc,
 }
 /* TODO: GPIO reservation */
 
+extern int ssb_chipco_watchdog(struct ssb_chipcommon *cc, uint ticks);
 
 #ifdef CONFIG_SSB_SERIAL
 extern int ssb_chipco_serial_init(struct ssb_chipcommon *cc,