Patch for extif watchdog support. Thanks b.sander. Closes #2363 #2814 and #3141
[openwrt/openwrt.git] / target / linux / brcm47xx / patches-2.6.23 / 610-ssb-watchdog-fix.patch
1 --- a/drivers/ssb/driver_mipscore.c 2007-12-06 08:07:00.000000000 +0100
2 +++ b/drivers/ssb/driver_mipscore.c 2007-12-06 10:27:43.000000000 +0100
3 @@ -31,6 +31,19 @@
4 ssb_write32(extif->dev, offset, value);
5 }
6
7 +/* Set chip watchdog reset timer to fire in 'ticks' backplane cycles */
8 +int
9 +ssb_watchdog(struct ssb_bus *bus, uint ticks)
10 +{
11 + /* instant NMI */
12 + if (bus->chipco.dev)
13 + ssb_write32(bus->chipco.dev, SSB_CHIPCO_WATCHDOG, ticks);
14 + else if (bus->extif.dev)
15 + ssb_write32(bus->extif.dev, SSB_EXTIF_WATCHDOG, ticks);
16 + return 0;
17 +}
18 +EXPORT_SYMBOL(ssb_watchdog);
19 +
20 static const u32 ipsflag_irq_mask[] = {
21 0,
22 SSB_IPSFLAG_IRQ1,
23 --- a/include/linux/ssb/ssb_driver_mips.h 2007-12-06 08:07:00.000000000 +0100
24 +++ b/include/linux/ssb/ssb_driver_mips.h 2007-12-06 10:32:36.000000000 +0100
25 @@ -30,6 +30,8 @@
26
27 extern unsigned int ssb_mips_irq(struct ssb_device *dev);
28
29 +/* Set watchdog reset timer to fire in 'ticks' backplane cycles */
30 +extern int ssb_watchdog(struct ssb_bus *bus, uint ticks);
31
32 #else /* CONFIG_SSB_DRIVER_MIPS */
33
34 --- a/arch/mips/bcm947xx/setup.c 2007-12-06 08:07:00.000000000 +0100
35 +++ b/arch/mips/bcm947xx/setup.c 2007-12-06 10:33:39.000000000 +0100
36 @@ -55,7 +55,7 @@
37 */
38
39 /* Set the watchdog timer to reset immediately */
40 - ssb_chipco_watchdog_timer_set(&ssb.chipco, 1);
41 + ssb_watchdog(&ssb, 1);
42 while (1)
43 cpu_relax();
44 }
45 @@ -64,7 +64,7 @@
46 {
47 /* Disable interrupts and watchdog and spin forever */
48 local_irq_disable();
49 - ssb_chipco_watchdog_timer_set(&ssb.chipco, 0);
50 + ssb_watchdog(&ssb, 0);
51 while (1)
52 cpu_relax();
53 }