ssb: Workaround: Need subsys_initcall to be able to register a PCI bus.
[openwrt-10.03/.git] / target / linux / brcm47xx / patches-2.6.23 / 610-ssb-watchdog-fix.patch
1 Index: linux-2.6.23.16/drivers/ssb/driver_mipscore.c
2 ===================================================================
3 --- linux-2.6.23.16.orig/drivers/ssb/driver_mipscore.c  2008-02-19 02:13:15.000000000 +0100
4 +++ linux-2.6.23.16/drivers/ssb/driver_mipscore.c       2008-02-19 02:13:17.000000000 +0100
5 @@ -31,6 +31,19 @@ static inline void mips_write32(struct s
6         ssb_write32(mcore->dev, offset, value);
7  }
8  
9 +/* Set chip watchdog reset timer to fire in 'ticks' backplane cycles */
10 +int
11 +ssb_watchdog(struct ssb_bus *bus, uint ticks)
12 +{
13 +       /* instant NMI */
14 +       if (bus->chipco.dev)
15 +               ssb_write32(bus->chipco.dev, SSB_CHIPCO_WATCHDOG, ticks);
16 +       else if (bus->extif.dev)
17 +               ssb_write32(bus->extif.dev, SSB_EXTIF_WATCHDOG, ticks);
18 +       return 0;
19 +}
20 +EXPORT_SYMBOL(ssb_watchdog);
21 +
22  static const u32 ipsflag_irq_mask[] = {
23         0,
24         SSB_IPSFLAG_IRQ1,
25 Index: linux-2.6.23.16/include/linux/ssb/ssb_driver_mips.h
26 ===================================================================
27 --- linux-2.6.23.16.orig/include/linux/ssb/ssb_driver_mips.h    2008-02-19 02:13:15.000000000 +0100
28 +++ linux-2.6.23.16/include/linux/ssb/ssb_driver_mips.h 2008-02-19 02:13:17.000000000 +0100
29 @@ -30,6 +30,8 @@ extern u32 ssb_cpu_clock(struct ssb_mips
30  
31  extern unsigned int ssb_mips_irq(struct ssb_device *dev);
32  
33 +/* Set watchdog reset timer to fire in 'ticks' backplane cycles */
34 +extern int ssb_watchdog(struct ssb_bus *bus, uint ticks);
35  
36  #else /* CONFIG_SSB_DRIVER_MIPS */
37  
38 Index: linux-2.6.23.16/arch/mips/bcm947xx/setup.c
39 ===================================================================
40 --- linux-2.6.23.16.orig/arch/mips/bcm947xx/setup.c     2008-02-19 02:13:15.000000000 +0100
41 +++ linux-2.6.23.16/arch/mips/bcm947xx/setup.c  2008-02-19 02:13:17.000000000 +0100
42 @@ -55,7 +55,7 @@ static void bcm47xx_machine_restart(char
43          */
44  
45         /* Set the watchdog timer to reset immediately */
46 -       ssb_chipco_watchdog_timer_set(&ssb.chipco, 1);
47 +       ssb_watchdog(&ssb, 1);
48         while (1)
49                 cpu_relax();
50  }
51 @@ -64,7 +64,7 @@ static void bcm47xx_machine_halt(void)
52  {
53         /* Disable interrupts and watchdog and spin forever */
54         local_irq_disable();
55 -       ssb_chipco_watchdog_timer_set(&ssb.chipco, 0);
56 +       ssb_watchdog(&ssb, 0);
57         while (1)
58                 cpu_relax();
59  }