X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/17c7b6c3fdc48301e50d22cc6138ede16bd1be24..4ee0ee8dd9033d4772b07b4d9aee42ca0b82e863:/target/linux/brcm47xx/files/arch/mips/bcm947xx/setup.c diff --git a/target/linux/brcm47xx/files/arch/mips/bcm947xx/setup.c b/target/linux/brcm47xx/files/arch/mips/bcm947xx/setup.c index f7687d4dd..780134818 100644 --- a/target/linux/brcm47xx/files/arch/mips/bcm947xx/setup.c +++ b/target/linux/brcm47xx/files/arch/mips/bcm947xx/setup.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -54,7 +55,7 @@ static void bcm47xx_machine_restart(char *command) */ /* Set the watchdog timer to reset immediately */ - ssb_chipco_watchdog(&ssb.chipco, 1); + ssb_chipco_watchdog_timer_set(&ssb.chipco, 1); while (1) cpu_relax(); } @@ -63,7 +64,7 @@ static void bcm47xx_machine_halt(void) { /* Disable interrupts and watchdog and spin forever */ local_irq_disable(); - ssb_chipco_watchdog(&ssb.chipco, 0); + ssb_chipco_watchdog_timer_set(&ssb.chipco, 0); while (1) cpu_relax(); } @@ -107,13 +108,27 @@ static void bcm47xx_fill_sprom_nvram(struct ssb_sprom *sprom) sprom->r1.et1phyaddr = simple_strtoul(s, NULL, 10); } +static int bcm47xx_get_invariants(struct ssb_bus *bus, struct ssb_init_invariants *iv) +{ + char *s; + + // TODO + //iv->boardinfo.vendor = + if ((s = nvram_get("boardtype"))) + iv->boardinfo.type = (u16)simple_strtoul(s, NULL, 0); + if ((s = nvram_get("boardrev"))) + iv->boardinfo.rev = (u16)simple_strtoul(s, NULL, 0); + bcm47xx_fill_sprom(&iv->sprom); + return 0; +} + void __init plat_mem_setup(void) { int i, err; char *s; struct ssb_mipscore *mcore; - err = ssb_bus_ssbbus_register(&ssb, SSB_ENUM_BASE, bcm47xx_fill_sprom); + err = ssb_bus_ssbbus_register(&ssb, SSB_ENUM_BASE, bcm47xx_get_invariants); if (err) { const char *msg = "Failed to initialize SSB bus (err %d)\n"; cfe_printk(msg, err); /* Make sure the message gets out of the box. */