aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mips/bcm47xx/nvram.c3
-rw-r--r--arch/mips/bcm47xx/setup.c22
2 files changed, 24 insertions, 1 deletions
diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c
index e5b6615731e5..54db815bc86c 100644
--- a/arch/mips/bcm47xx/nvram.c
+++ b/arch/mips/bcm47xx/nvram.c
@@ -3,6 +3,7 @@
3 * 3 *
4 * Copyright (C) 2005 Broadcom Corporation 4 * Copyright (C) 2005 Broadcom Corporation
5 * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org> 5 * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
6 * Copyright (C) 2010-2011 Hauke Mehrtens <hauke@hauke-m.de>
6 * 7 *
7 * This program is free software; you can redistribute it and/or modify it 8 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the 9 * under the terms of the GNU General Public License as published by the
@@ -23,7 +24,7 @@
23static char nvram_buf[NVRAM_SPACE]; 24static char nvram_buf[NVRAM_SPACE];
24 25
25/* Probe for NVRAM header */ 26/* Probe for NVRAM header */
26static void __init early_nvram_init(void) 27static void early_nvram_init(void)
27{ 28{
28 struct ssb_mipscore *mcore = &ssb_bcm47xx.mipscore; 29 struct ssb_mipscore *mcore = &ssb_bcm47xx.mipscore;
29 struct nvram_header *header; 30 struct nvram_header *header;
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
index bbfcf9bd38db..258ffcf92754 100644
--- a/arch/mips/bcm47xx/setup.c
+++ b/arch/mips/bcm47xx/setup.c
@@ -3,6 +3,7 @@
3 * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org> 3 * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
4 * Copyright (C) 2006 Michael Buesch <mb@bu3sch.de> 4 * Copyright (C) 2006 Michael Buesch <mb@bu3sch.de>
5 * Copyright (C) 2010 Waldemar Brodkorb <wbx@openadk.org> 5 * Copyright (C) 2010 Waldemar Brodkorb <wbx@openadk.org>
6 * Copyright (C) 2010-2011 Hauke Mehrtens <hauke@hauke-m.de>
6 * 7 *
7 * This program is free software; you can redistribute it and/or modify it 8 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the 9 * under the terms of the GNU General Public License as published by the
@@ -154,6 +155,22 @@ static void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix)
154 } 155 }
155} 156}
156 157
158int bcm47xx_get_sprom(struct ssb_bus *bus, struct ssb_sprom *out)
159{
160 char prefix[10];
161
162 if (bus->bustype == SSB_BUSTYPE_PCI) {
163 snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
164 bus->host_pci->bus->number + 1,
165 PCI_SLOT(bus->host_pci->devfn));
166 bcm47xx_fill_sprom(out, prefix);
167 return 0;
168 } else {
169 printk(KERN_WARNING "bcm47xx: unable to fill SPROM for given bustype.\n");
170 return -EINVAL;
171 }
172}
173
157static int bcm47xx_get_invariants(struct ssb_bus *bus, 174static int bcm47xx_get_invariants(struct ssb_bus *bus,
158 struct ssb_init_invariants *iv) 175 struct ssb_init_invariants *iv)
159{ 176{
@@ -185,6 +202,11 @@ void __init plat_mem_setup(void)
185 char buf[100]; 202 char buf[100];
186 struct ssb_mipscore *mcore; 203 struct ssb_mipscore *mcore;
187 204
205 err = ssb_arch_register_fallback_sprom(&bcm47xx_get_sprom);
206 if (err)
207 printk(KERN_WARNING "bcm47xx: someone else already registered"
208 " a ssb SPROM callback handler (err %d)\n", err);
209
188 err = ssb_bus_ssbbus_register(&ssb_bcm47xx, SSB_ENUM_BASE, 210 err = ssb_bus_ssbbus_register(&ssb_bcm47xx, SSB_ENUM_BASE,
189 bcm47xx_get_invariants); 211 bcm47xx_get_invariants);
190 if (err) 212 if (err)