1 --- a/arch/mips/bcm47xx/nvram.c
2 +++ b/arch/mips/bcm47xx/nvram.c
5 * Copyright (C) 2005 Broadcom Corporation
6 * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
7 + * Copyright (C) 2010-2011 Hauke Mehrtens <hauke@hauke-m.de>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
12 static char nvram_buf[NVRAM_SPACE];
14 /* Probe for NVRAM header */
15 -static void __init early_nvram_init(void)
16 +static void early_nvram_init(void)
18 struct ssb_mipscore *mcore = &ssb_bcm47xx.mipscore;
19 struct nvram_header *header;
20 --- a/arch/mips/bcm47xx/setup.c
21 +++ b/arch/mips/bcm47xx/setup.c
23 * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
24 * Copyright (C) 2006 Michael Buesch <mb@bu3sch.de>
25 * Copyright (C) 2010 Waldemar Brodkorb <wbx@openadk.org>
26 + * Copyright (C) 2010-2011 Hauke Mehrtens <hauke@hauke-m.de>
28 * This program is free software; you can redistribute it and/or modify it
29 * under the terms of the GNU General Public License as published by the
30 @@ -156,6 +157,22 @@ static void bcm47xx_fill_sprom(struct ss
34 +int bcm47xx_get_sprom(struct ssb_bus *bus, struct ssb_sprom *out)
38 + if (bus->bustype == SSB_BUSTYPE_PCI) {
39 + snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
40 + bus->host_pci->bus->number + 1,
41 + PCI_SLOT(bus->host_pci->devfn));
42 + bcm47xx_fill_sprom(out, prefix);
45 + printk(KERN_WARNING "bcm47xx: unable to fill SPROM for given bustype.\n");
50 static int bcm47xx_get_invariants(struct ssb_bus *bus,
51 struct ssb_init_invariants *iv)
53 @@ -212,6 +229,11 @@ void __init plat_mem_setup(void)
55 struct ssb_mipscore *mcore;
57 + err = ssb_arch_register_fallback_sprom(&bcm47xx_get_sprom);
59 + printk(KERN_WARNING "bcm47xx: someone else already registered"
60 + " a ssb SPROM callback handler (err %d)\n", err);
62 err = ssb_bus_ssbbus_register(&ssb_bcm47xx, SSB_ENUM_BASE,
63 bcm47xx_get_invariants);