brcm47xx: use DMZ LED as status indicator
[openwrt/staging/dedeckeh.git] / target / linux / brcm47xx / patches-4.1 / 033-01-MIPS-BCM47xx-Support-on-SoC-bus-in-SPROM-reading-fun.patch
1 From daa7ce02513d2188fe6f5ff47ce5ef83eb7de739 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Sun, 25 Oct 2015 22:16:47 +0100
4 Subject: [PATCH 1/3] MIPS: BCM47xx: Support on-SoC bus in SPROM reading
5 function
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 To support (extract) SPROM on Broadcom ARM devices we should separate
11 SPROM code and make it a separated module. We won't want to export
12 bcm47xx_fill_sprom symbol so we should support SoC SPROM in the standard
13 fallback function and then modify ssb to use it.
14
15 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
16 Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
17 Cc: linux-mips@linux-mips.org
18 Patchwork: https://patchwork.linux-mips.org/patch/11355/
19 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
20 ---
21 arch/mips/bcm47xx/sprom.c | 8 ++++++--
22 1 file changed, 6 insertions(+), 2 deletions(-)
23
24 --- a/arch/mips/bcm47xx/sprom.c
25 +++ b/arch/mips/bcm47xx/sprom.c
26 @@ -610,14 +610,18 @@ static int bcm47xx_get_sprom_ssb(struct
27 {
28 char prefix[10];
29
30 - if (bus->bustype == SSB_BUSTYPE_PCI) {
31 + switch (bus->bustype) {
32 + case SSB_BUSTYPE_SSB:
33 + bcm47xx_fill_sprom(out, NULL, false);
34 + return 0;
35 + case SSB_BUSTYPE_PCI:
36 memset(out, 0, sizeof(struct ssb_sprom));
37 snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
38 bus->host_pci->bus->number + 1,
39 PCI_SLOT(bus->host_pci->devfn));
40 bcm47xx_fill_sprom(out, prefix, false);
41 return 0;
42 - } else {
43 + default:
44 pr_warn("Unable to fill SPROM for given bustype.\n");
45 return -EINVAL;
46 }