|
@@ -35,15 +35,22 @@
|
|
#include <bcm47xx.h>
|
|
#include <bcm47xx.h>
|
|
#include <asm/mach-bcm47xx/nvram.h>
|
|
#include <asm/mach-bcm47xx/nvram.h>
|
|
|
|
|
|
-struct ssb_bus ssb_bcm47xx;
|
|
|
|
-EXPORT_SYMBOL(ssb_bcm47xx);
|
|
|
|
|
|
+union bcm47xx_bus bcm47xx_bus;
|
|
|
|
+EXPORT_SYMBOL(bcm47xx_bus);
|
|
|
|
+
|
|
|
|
+enum bcm47xx_bus_type bcm47xx_bus_type;
|
|
|
|
+EXPORT_SYMBOL(bcm47xx_bus_type);
|
|
|
|
|
|
static void bcm47xx_machine_restart(char *command)
|
|
static void bcm47xx_machine_restart(char *command)
|
|
{
|
|
{
|
|
printk(KERN_ALERT "Please stand by while rebooting the system...\n");
|
|
printk(KERN_ALERT "Please stand by while rebooting the system...\n");
|
|
local_irq_disable();
|
|
local_irq_disable();
|
|
/* Set the watchdog timer to reset immediately */
|
|
/* Set the watchdog timer to reset immediately */
|
|
- ssb_watchdog_timer_set(&ssb_bcm47xx, 1);
|
|
|
|
|
|
+ switch (bcm47xx_bus_type) {
|
|
|
|
+ case BCM47XX_BUS_TYPE_SSB:
|
|
|
|
+ ssb_watchdog_timer_set(&bcm47xx_bus.ssb, 1);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
while (1)
|
|
while (1)
|
|
cpu_relax();
|
|
cpu_relax();
|
|
}
|
|
}
|
|
@@ -52,7 +59,11 @@ static void bcm47xx_machine_halt(void)
|
|
{
|
|
{
|
|
/* Disable interrupts and watchdog and spin forever */
|
|
/* Disable interrupts and watchdog and spin forever */
|
|
local_irq_disable();
|
|
local_irq_disable();
|
|
- ssb_watchdog_timer_set(&ssb_bcm47xx, 0);
|
|
|
|
|
|
+ switch (bcm47xx_bus_type) {
|
|
|
|
+ case BCM47XX_BUS_TYPE_SSB:
|
|
|
|
+ ssb_watchdog_timer_set(&bcm47xx_bus.ssb, 0);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
while (1)
|
|
while (1)
|
|
cpu_relax();
|
|
cpu_relax();
|
|
}
|
|
}
|
|
@@ -247,7 +258,7 @@ static int bcm47xx_get_invariants(struct ssb_bus *bus,
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-void __init plat_mem_setup(void)
|
|
|
|
|
|
+static void __init bcm47xx_register_ssb(void)
|
|
{
|
|
{
|
|
int err;
|
|
int err;
|
|
char buf[100];
|
|
char buf[100];
|
|
@@ -258,12 +269,12 @@ void __init plat_mem_setup(void)
|
|
printk(KERN_WARNING "bcm47xx: someone else already registered"
|
|
printk(KERN_WARNING "bcm47xx: someone else already registered"
|
|
" a ssb SPROM callback handler (err %d)\n", err);
|
|
" a ssb SPROM callback handler (err %d)\n", err);
|
|
|
|
|
|
- err = ssb_bus_ssbbus_register(&ssb_bcm47xx, SSB_ENUM_BASE,
|
|
|
|
|
|
+ err = ssb_bus_ssbbus_register(&(bcm47xx_bus.ssb), SSB_ENUM_BASE,
|
|
bcm47xx_get_invariants);
|
|
bcm47xx_get_invariants);
|
|
if (err)
|
|
if (err)
|
|
panic("Failed to initialize SSB bus (err %d)\n", err);
|
|
panic("Failed to initialize SSB bus (err %d)\n", err);
|
|
|
|
|
|
- mcore = &ssb_bcm47xx.mipscore;
|
|
|
|
|
|
+ mcore = &bcm47xx_bus.ssb.mipscore;
|
|
if (nvram_getenv("kernel_args", buf, sizeof(buf)) >= 0) {
|
|
if (nvram_getenv("kernel_args", buf, sizeof(buf)) >= 0) {
|
|
if (strstr(buf, "console=ttyS1")) {
|
|
if (strstr(buf, "console=ttyS1")) {
|
|
struct ssb_serial_port port;
|
|
struct ssb_serial_port port;
|
|
@@ -276,6 +287,14 @@ void __init plat_mem_setup(void)
|
|
memcpy(&mcore->serial_ports[1], &port, sizeof(port));
|
|
memcpy(&mcore->serial_ports[1], &port, sizeof(port));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void __init plat_mem_setup(void)
|
|
|
|
+{
|
|
|
|
+ struct cpuinfo_mips *c = ¤t_cpu_data;
|
|
|
|
+
|
|
|
|
+ bcm47xx_bus_type = BCM47XX_BUS_TYPE_SSB;
|
|
|
|
+ bcm47xx_register_ssb();
|
|
|
|
|
|
_machine_restart = bcm47xx_machine_restart;
|
|
_machine_restart = bcm47xx_machine_restart;
|
|
_machine_halt = bcm47xx_machine_halt;
|
|
_machine_halt = bcm47xx_machine_halt;
|