112-bcm53xx-sprom-add-sprom-driver.patch 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. From 4e0ab3269a6d260a41a3673157753147f5f71341 Mon Sep 17 00:00:00 2001
  2. From: Hauke Mehrtens <hauke@hauke-m.de>
  3. Date: Sun, 4 May 2014 13:19:20 +0200
  4. Subject: [PATCH 03/17] bcm47xx-sprom: add Broadcom sprom parser driver
  5. This driver needs an nvram driver and fetches the sprom values from the
  6. nvram and provides it to any other driver. The calibration data for the
  7. wifi chip the mac address and some more board description data is
  8. stores in the sprom.
  9. This is based on a copy of arch/mips/bcm47xx/sprom.c and my plan is to
  10. make the bcm47xx MIPS SoCs also use this driver some time later.
  11. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  12. ---
  13. .../devicetree/bindings/misc/bcm47xx-sprom.txt | 16 +
  14. drivers/misc/Kconfig | 11 +
  15. drivers/misc/Makefile | 1 +
  16. drivers/misc/bcm47xx-sprom.c | 690 +++++++++++++++++++++
  17. 4 files changed, 718 insertions(+)
  18. create mode 100644 Documentation/devicetree/bindings/misc/bcm47xx-sprom.txt
  19. create mode 100644 drivers/misc/bcm47xx-sprom.c
  20. --- /dev/null
  21. +++ b/Documentation/devicetree/bindings/misc/bcm47xx-sprom.txt
  22. @@ -0,0 +1,16 @@
  23. +Broadcom bcm47xx/bcm53xx sprom converter
  24. +
  25. +This driver provbides an sprom based on a given nvram.
  26. +
  27. +Required properties:
  28. +
  29. +- compatible : brcm,bcm47xx-sprom
  30. +
  31. +- nvram : reference to a nvram driver, e.g. bcm47xx-nvram
  32. +
  33. +Example:
  34. +
  35. +sprom0: sprom@0 {
  36. + compatible = "brcm,bcm47xx-sprom";
  37. + nvram = <&nvram0>;
  38. +};
  39. --- a/drivers/misc/Kconfig
  40. +++ b/drivers/misc/Kconfig
  41. @@ -515,6 +515,17 @@ config VEXPRESS_SYSCFG
  42. bus. System Configuration interface is one of the possible means
  43. of generating transactions on this bus.
  44. +config BCM47XX_SPROM
  45. + tristate "BCM47XX sprom driver"
  46. + help
  47. + This driver parses the sprom from a given nvram which is found on
  48. + Broadcom bcm47xx and bcm53xx SoCs.
  49. +
  50. + The sprom contains board configuration data like the
  51. + calibration data fro the wifi chips, the mac addresses used
  52. + by the board and many other board configuration data. This
  53. + driver will provide the sprom to bcma.
  54. +
  55. source "drivers/misc/c2port/Kconfig"
  56. source "drivers/misc/eeprom/Kconfig"
  57. source "drivers/misc/cb710/Kconfig"
  58. --- a/drivers/misc/Makefile
  59. +++ b/drivers/misc/Makefile
  60. @@ -56,3 +56,4 @@ obj-$(CONFIG_GENWQE) += genwqe/
  61. obj-$(CONFIG_ECHO) += echo/
  62. obj-$(CONFIG_VEXPRESS_SYSCFG) += vexpress-syscfg.o
  63. obj-$(CONFIG_CXL_BASE) += cxl/
  64. +obj-$(CONFIG_BCM47XX_SPROM) += bcm47xx-sprom.o