033-01-MIPS-BCM47xx-Support-on-SoC-bus-in-SPROM-reading-fun.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. To support (extract) SPROM on Broadcom ARM devices we should separate
  10. SPROM code and make it a separated module. We won't want to export
  11. bcm47xx_fill_sprom symbol so we should support SoC SPROM in the standard
  12. fallback function and then modify ssb to use it.
  13. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
  14. Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
  15. Cc: linux-mips@linux-mips.org
  16. Patchwork: https://patchwork.linux-mips.org/patch/11355/
  17. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  18. ---
  19. arch/mips/bcm47xx/sprom.c | 8 ++++++--
  20. 1 file changed, 6 insertions(+), 2 deletions(-)
  21. --- a/arch/mips/bcm47xx/sprom.c
  22. +++ b/arch/mips/bcm47xx/sprom.c
  23. @@ -610,14 +610,18 @@ static int bcm47xx_get_sprom_ssb(struct
  24. {
  25. char prefix[10];
  26. - if (bus->bustype == SSB_BUSTYPE_PCI) {
  27. + switch (bus->bustype) {
  28. + case SSB_BUSTYPE_SSB:
  29. + bcm47xx_fill_sprom(out, NULL, false);
  30. + return 0;
  31. + case SSB_BUSTYPE_PCI:
  32. memset(out, 0, sizeof(struct ssb_sprom));
  33. snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
  34. bus->host_pci->bus->number + 1,
  35. PCI_SLOT(bus->host_pci->devfn));
  36. bcm47xx_fill_sprom(out, prefix, false);
  37. return 0;
  38. - } else {
  39. + default:
  40. pr_warn("Unable to fill SPROM for given bustype.\n");
  41. return -EINVAL;
  42. }