bcm53xx: add support for Asus RT-AC68U
[oweals/openwrt.git] / target / linux / bcm53xx / patches-3.14 / 112-bcm53xx-sprom-add-sprom-driver.patch
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
6 This driver needs an nvram driver and fetches the sprom values from the
7 nvram and provides it to any other driver. The calibration data for the
8 wifi chip the mac address and some more board description data is
9 stores in the sprom.
10
11 This is based on a copy of arch/mips/bcm47xx/sprom.c and my plan is to
12 make the bcm47xx MIPS SoCs also use this driver some time later.
13
14 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
15 ---
16  .../devicetree/bindings/misc/bcm47xx-sprom.txt     |  16 +
17  drivers/misc/Kconfig                               |  11 +
18  drivers/misc/Makefile                              |   1 +
19  drivers/misc/bcm47xx-sprom.c                       | 690 +++++++++++++++++++++
20  4 files changed, 718 insertions(+)
21  create mode 100644 Documentation/devicetree/bindings/misc/bcm47xx-sprom.txt
22  create mode 100644 drivers/misc/bcm47xx-sprom.c
23
24 --- /dev/null
25 +++ b/Documentation/devicetree/bindings/misc/bcm47xx-sprom.txt
26 @@ -0,0 +1,16 @@
27 +Broadcom bcm47xx/bcm53xx sprom converter
28 +
29 +This driver provbides an sprom based on a given nvram.
30 +
31 +Required properties:
32 +
33 +- compatible : brcm,bcm47xx-sprom
34 +
35 +- nvram : reference to a nvram driver, e.g. bcm47xx-nvram
36 +
37 +Example:
38 +
39 +sprom0: sprom@0 {
40 +       compatible = "brcm,bcm47xx-sprom";
41 +       nvram = <&nvram0>;
42 +};
43 --- a/drivers/misc/Kconfig
44 +++ b/drivers/misc/Kconfig
45 @@ -515,6 +515,17 @@ config SRAM
46           the genalloc API. It is supposed to be used for small on-chip SRAM
47           areas found on many SoCs.
48  
49 +config BCM47XX_SPROM
50 +       tristate "BCM47XX sprom driver"
51 +       help
52 +         This driver parses the sprom from a given nvram which is found on
53 +         Broadcom bcm47xx and bcm53xx SoCs.
54 +
55 +         The sprom contains board configuration data like the
56 +         calibration data fro the wifi chips, the mac addresses used
57 +         by the board and many other board configuration data. This
58 +         driver will provide the sprom to bcma.
59 +
60  source "drivers/misc/c2port/Kconfig"
61  source "drivers/misc/eeprom/Kconfig"
62  source "drivers/misc/cb710/Kconfig"
63 --- a/drivers/misc/Makefile
64 +++ b/drivers/misc/Makefile
65 @@ -54,3 +54,4 @@ obj-$(CONFIG_LATTICE_ECP3_CONFIG)     += lat
66  obj-$(CONFIG_SRAM)             += sram.o
67  obj-y                          += mic/
68  obj-$(CONFIG_GENWQE)           += genwqe/
69 +obj-$(CONFIG_BCM47XX_SPROM)    += bcm47xx-sprom.o