summaryrefslogtreecommitdiff
path: root/arch/mips/bcm47xx
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2015-10-25 22:16:47 +0100
committerRalf Baechle <ralf@linux-mips.org>2015-11-11 08:36:52 +0100
commitdaa7ce02513d2188fe6f5ff47ce5ef83eb7de739 (patch)
tree193f87051652bb76b91810b86e05d139c256dac4 /arch/mips/bcm47xx
parent500fab97c682f3264eb7f96c22575d70cce6b2b4 (diff)
MIPS: BCM47xx: Support on-SoC bus in SPROM reading function
To support (extract) SPROM on Broadcom ARM devices we should separate SPROM code and make it a separated module. We won't want to export bcm47xx_fill_sprom symbol so we should support SoC SPROM in the standard fallback function and then modify ssb to use it. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Acked-by: Hauke Mehrtens <hauke@hauke-m.de> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/11355/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/bcm47xx')
-rw-r--r--arch/mips/bcm47xx/sprom.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/mips/bcm47xx/sprom.c b/arch/mips/bcm47xx/sprom.c
index 2d5c7a7f24bb..e19c1b9b6697 100644
--- a/arch/mips/bcm47xx/sprom.c
+++ b/arch/mips/bcm47xx/sprom.c
@@ -610,14 +610,18 @@ static int bcm47xx_get_sprom_ssb(struct ssb_bus *bus, struct ssb_sprom *out)
{
char prefix[10];
- if (bus->bustype == SSB_BUSTYPE_PCI) {
+ switch (bus->bustype) {
+ case SSB_BUSTYPE_SSB:
+ bcm47xx_fill_sprom(out, NULL, false);
+ return 0;
+ case SSB_BUSTYPE_PCI:
memset(out, 0, sizeof(struct ssb_sprom));
snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
bus->host_pci->bus->number + 1,
PCI_SLOT(bus->host_pci->devfn));
bcm47xx_fill_sprom(out, prefix, false);
return 0;
- } else {
+ default:
pr_warn("Unable to fill SPROM for given bustype.\n");
return -EINVAL;
}