1 --- a/arch/mips/bcm47xx/setup.c
2 +++ b/arch/mips/bcm47xx/setup.c
4 * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
5 * Copyright (C) 2006 Michael Buesch <m@bues.ch>
6 * Copyright (C) 2010 Waldemar Brodkorb <wbx@openadk.org>
7 - * Copyright (C) 2010-2011 Hauke Mehrtens <hauke@hauke-m.de>
8 + * Copyright (C) 2010-2012 Hauke Mehrtens <hauke@hauke-m.de>
9 * Copyright (C) 2011-2012 Tathagata Das <tathagata@alumnux.com>
11 * This program is free software; you can redistribute it and/or modify it
12 @@ -93,7 +93,7 @@ static void bcm47xx_machine_halt(void)
15 #ifdef CONFIG_BCM47XX_SSB
16 -static int bcm47xx_get_sprom(struct ssb_bus *bus, struct ssb_sprom *out)
17 +static int bcm47xx_get_sprom_ssb(struct ssb_bus *bus, struct ssb_sprom *out)
21 @@ -110,7 +110,7 @@ static int bcm47xx_get_sprom(struct ssb_
24 static int bcm47xx_get_invariants(struct ssb_bus *bus,
25 - struct ssb_init_invariants *iv)
26 + struct ssb_init_invariants *iv)
30 @@ -165,7 +165,7 @@ static void __init bcm47xx_register_ssb(
32 struct ssb_mipscore *mcore;
34 - err = ssb_arch_register_fallback_sprom(&bcm47xx_get_sprom);
35 + err = ssb_arch_register_fallback_sprom(&bcm47xx_get_sprom_ssb);
37 printk(KERN_WARNING "bcm47xx: someone else already registered"
38 " a ssb SPROM callback handler (err %d)\n", err);
39 @@ -199,10 +199,41 @@ static void __init bcm47xx_register_ssb(
42 #ifdef CONFIG_BCM47XX_BCMA
43 +static int bcm47xx_get_sprom_bcma(struct bcma_bus *bus, struct ssb_sprom *out)
46 + struct bcma_device *core;
48 + switch (bus->hosttype) {
49 + case BCMA_HOSTTYPE_PCI:
50 + snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
51 + bus->host_pci->bus->number + 1,
52 + PCI_SLOT(bus->host_pci->devfn));
53 + bcm47xx_fill_sprom(out, prefix);
55 + case BCMA_HOSTTYPE_SOC:
56 + bcm47xx_fill_sprom_ethernet(out, NULL);
57 + core = bcma_find_core(bus, BCMA_CORE_80211);
59 + snprintf(prefix, sizeof(prefix), "sb/%u/",
61 + bcm47xx_fill_sprom(out, prefix);
65 + pr_warn("bcm47xx: unable to fill SPROM for given bustype.\n");
70 static void __init bcm47xx_register_bcma(void)
74 + err = bcma_arch_register_fallback_sprom(&bcm47xx_get_sprom_bcma);
76 + pr_warn("bcm47xx: someone else already registered a bcma SPROM callback handler (err %d)\n", err);
78 err = bcma_host_soc_register(&bcm47xx_bus.bcma);
80 panic("Failed to initialize BCMA bus (err %d)\n", err);