diff options
Diffstat (limited to 'arch/mips/bcm47xx/setup.c')
-rw-r--r-- | arch/mips/bcm47xx/setup.c | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c index cfae81571ded..271cedb339ae 100644 --- a/arch/mips/bcm47xx/setup.c +++ b/arch/mips/bcm47xx/setup.c | |||
@@ -35,15 +35,22 @@ | |||
35 | #include <bcm47xx.h> | 35 | #include <bcm47xx.h> |
36 | #include <asm/mach-bcm47xx/nvram.h> | 36 | #include <asm/mach-bcm47xx/nvram.h> |
37 | 37 | ||
38 | struct ssb_bus ssb_bcm47xx; | 38 | union bcm47xx_bus bcm47xx_bus; |
39 | EXPORT_SYMBOL(ssb_bcm47xx); | 39 | EXPORT_SYMBOL(bcm47xx_bus); |
40 | |||
41 | enum bcm47xx_bus_type bcm47xx_bus_type; | ||
42 | EXPORT_SYMBOL(bcm47xx_bus_type); | ||
40 | 43 | ||
41 | static void bcm47xx_machine_restart(char *command) | 44 | static void bcm47xx_machine_restart(char *command) |
42 | { | 45 | { |
43 | printk(KERN_ALERT "Please stand by while rebooting the system...\n"); | 46 | printk(KERN_ALERT "Please stand by while rebooting the system...\n"); |
44 | local_irq_disable(); | 47 | local_irq_disable(); |
45 | /* Set the watchdog timer to reset immediately */ | 48 | /* Set the watchdog timer to reset immediately */ |
46 | ssb_watchdog_timer_set(&ssb_bcm47xx, 1); | 49 | switch (bcm47xx_bus_type) { |
50 | case BCM47XX_BUS_TYPE_SSB: | ||
51 | ssb_watchdog_timer_set(&bcm47xx_bus.ssb, 1); | ||
52 | break; | ||
53 | } | ||
47 | while (1) | 54 | while (1) |
48 | cpu_relax(); | 55 | cpu_relax(); |
49 | } | 56 | } |
@@ -52,7 +59,11 @@ static void bcm47xx_machine_halt(void) | |||
52 | { | 59 | { |
53 | /* Disable interrupts and watchdog and spin forever */ | 60 | /* Disable interrupts and watchdog and spin forever */ |
54 | local_irq_disable(); | 61 | local_irq_disable(); |
55 | ssb_watchdog_timer_set(&ssb_bcm47xx, 0); | 62 | switch (bcm47xx_bus_type) { |
63 | case BCM47XX_BUS_TYPE_SSB: | ||
64 | ssb_watchdog_timer_set(&bcm47xx_bus.ssb, 0); | ||
65 | break; | ||
66 | } | ||
56 | while (1) | 67 | while (1) |
57 | cpu_relax(); | 68 | cpu_relax(); |
58 | } | 69 | } |
@@ -247,7 +258,7 @@ static int bcm47xx_get_invariants(struct ssb_bus *bus, | |||
247 | return 0; | 258 | return 0; |
248 | } | 259 | } |
249 | 260 | ||
250 | void __init plat_mem_setup(void) | 261 | static void __init bcm47xx_register_ssb(void) |
251 | { | 262 | { |
252 | int err; | 263 | int err; |
253 | char buf[100]; | 264 | char buf[100]; |
@@ -258,12 +269,12 @@ void __init plat_mem_setup(void) | |||
258 | printk(KERN_WARNING "bcm47xx: someone else already registered" | 269 | printk(KERN_WARNING "bcm47xx: someone else already registered" |
259 | " a ssb SPROM callback handler (err %d)\n", err); | 270 | " a ssb SPROM callback handler (err %d)\n", err); |
260 | 271 | ||
261 | err = ssb_bus_ssbbus_register(&ssb_bcm47xx, SSB_ENUM_BASE, | 272 | err = ssb_bus_ssbbus_register(&(bcm47xx_bus.ssb), SSB_ENUM_BASE, |
262 | bcm47xx_get_invariants); | 273 | bcm47xx_get_invariants); |
263 | if (err) | 274 | if (err) |
264 | panic("Failed to initialize SSB bus (err %d)\n", err); | 275 | panic("Failed to initialize SSB bus (err %d)\n", err); |
265 | 276 | ||
266 | mcore = &ssb_bcm47xx.mipscore; | 277 | mcore = &bcm47xx_bus.ssb.mipscore; |
267 | if (nvram_getenv("kernel_args", buf, sizeof(buf)) >= 0) { | 278 | if (nvram_getenv("kernel_args", buf, sizeof(buf)) >= 0) { |
268 | if (strstr(buf, "console=ttyS1")) { | 279 | if (strstr(buf, "console=ttyS1")) { |
269 | struct ssb_serial_port port; | 280 | struct ssb_serial_port port; |
@@ -276,6 +287,14 @@ void __init plat_mem_setup(void) | |||
276 | memcpy(&mcore->serial_ports[1], &port, sizeof(port)); | 287 | memcpy(&mcore->serial_ports[1], &port, sizeof(port)); |
277 | } | 288 | } |
278 | } | 289 | } |
290 | } | ||
291 | |||
292 | void __init plat_mem_setup(void) | ||
293 | { | ||
294 | struct cpuinfo_mips *c = ¤t_cpu_data; | ||
295 | |||
296 | bcm47xx_bus_type = BCM47XX_BUS_TYPE_SSB; | ||
297 | bcm47xx_register_ssb(); | ||
279 | 298 | ||
280 | _machine_restart = bcm47xx_machine_restart; | 299 | _machine_restart = bcm47xx_machine_restart; |
281 | _machine_halt = bcm47xx_machine_halt; | 300 | _machine_halt = bcm47xx_machine_halt; |