aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2015-06-10 17:05:08 -0400
committerRalf Baechle <ralf@linux-mips.org>2015-06-21 15:55:33 -0400
commitf6e734a8c162297953d7bfc0f3f6bf4f8c33d72f (patch)
tree285ec89e3f7d713f42f66cd1ba16dc637976c26f
parent1e51714c81e11bd0ffbb2b0724a1f66ce58608a5 (diff)
MIPS: BCM47xx: Move NVRAM driver to the drivers/firmware/
After Broadcom switched from MIPS to ARM for their home routers we need to have NVRAM driver in some common place (not arch/mips/). As explained in Kconfig, this driver is responsible for parsing SoC configuration data that is passed to the kernel in flash from the bootloader firmware called "CFE". We were thinking about putting it in bus directory, however there are two possible buses for MIPS: drivers/ssb/ and drivers/bcma/. So this won't fit there and this is why I would like to move this driver to the drivers/firmware/. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Reviewed-by: Paul Walmsley <paul@pwsan.com> Cc: linux-mips@linux-mips.org Cc: Hauke Mehrtens <hauke@hauke-m.de> Cc: Seiji Aguchi <seiji.aguchi@hds.com> Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Mike Waychison <mikew@google.com> Cc: Roy Franz <roy.franz@linaro.org> Cc: Matt Fleming <matt.fleming@intel.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Patchwork: https://patchwork.linux-mips.org/patch/10544/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--MAINTAINERS6
-rw-r--r--arch/mips/Kconfig1
-rw-r--r--arch/mips/bcm47xx/Makefile2
-rw-r--r--drivers/firmware/Kconfig1
-rw-r--r--drivers/firmware/Makefile1
-rw-r--r--drivers/firmware/broadcom/Kconfig11
-rw-r--r--drivers/firmware/broadcom/Makefile1
-rw-r--r--drivers/firmware/broadcom/bcm47xx_nvram.c (renamed from arch/mips/bcm47xx/nvram.c)2
-rw-r--r--include/linux/bcm47xx_nvram.h2
9 files changed, 25 insertions, 2 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 43043f0b354e..25a17aa20741 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2265,6 +2265,12 @@ S: Supported
2265F: drivers/gpio/gpio-bcm-kona.c 2265F: drivers/gpio/gpio-bcm-kona.c
2266F: Documentation/devicetree/bindings/gpio/gpio-bcm-kona.txt 2266F: Documentation/devicetree/bindings/gpio/gpio-bcm-kona.txt
2267 2267
2268BROADCOM NVRAM DRIVER
2269M: Rafał Miłecki <zajec5@gmail.com>
2270L: linux-mips@linux-mips.org
2271S: Maintained
2272F: drivers/firmware/broadcom/*
2273
2268BROADCOM SPECIFIC AMBA DRIVER (BCMA) 2274BROADCOM SPECIFIC AMBA DRIVER (BCMA)
2269M: Rafał Miłecki <zajec5@gmail.com> 2275M: Rafał Miłecki <zajec5@gmail.com>
2270L: linux-wireless@vger.kernel.org 2276L: linux-wireless@vger.kernel.org
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index d53b43237f7f..dbb1a1d0f9b3 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -190,6 +190,7 @@ config BCM47XX
190 select USE_GENERIC_EARLY_PRINTK_8250 190 select USE_GENERIC_EARLY_PRINTK_8250
191 select GPIOLIB 191 select GPIOLIB
192 select LEDS_GPIO_REGISTER 192 select LEDS_GPIO_REGISTER
193 select BCM47XX_NVRAM
193 help 194 help
194 Support for BCM47XX based boards 195 Support for BCM47XX based boards
195 196
diff --git a/arch/mips/bcm47xx/Makefile b/arch/mips/bcm47xx/Makefile
index d58c51b5e501..66bea4ecf449 100644
--- a/arch/mips/bcm47xx/Makefile
+++ b/arch/mips/bcm47xx/Makefile
@@ -3,5 +3,5 @@
3# under Linux. 3# under Linux.
4# 4#
5 5
6obj-y += irq.o nvram.o prom.o serial.o setup.o time.o sprom.o 6obj-y += irq.o prom.o serial.o setup.o time.o sprom.o
7obj-y += board.o buttons.o leds.o workarounds.o 7obj-y += board.o buttons.o leds.o workarounds.o
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index 6517132e5d8b..99c69a3205c4 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -136,6 +136,7 @@ config QCOM_SCM
136 bool 136 bool
137 depends on ARM || ARM64 137 depends on ARM || ARM64
138 138
139source "drivers/firmware/broadcom/Kconfig"
139source "drivers/firmware/google/Kconfig" 140source "drivers/firmware/google/Kconfig"
140source "drivers/firmware/efi/Kconfig" 141source "drivers/firmware/efi/Kconfig"
141 142
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
index 3fdd3912709a..210c6e0550d3 100644
--- a/drivers/firmware/Makefile
+++ b/drivers/firmware/Makefile
@@ -14,6 +14,7 @@ obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o
14obj-$(CONFIG_QCOM_SCM) += qcom_scm.o 14obj-$(CONFIG_QCOM_SCM) += qcom_scm.o
15CFLAGS_qcom_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1) 15CFLAGS_qcom_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1)
16 16
17obj-y += broadcom/
17obj-$(CONFIG_GOOGLE_FIRMWARE) += google/ 18obj-$(CONFIG_GOOGLE_FIRMWARE) += google/
18obj-$(CONFIG_EFI) += efi/ 19obj-$(CONFIG_EFI) += efi/
19obj-$(CONFIG_UEFI_CPER) += efi/ 20obj-$(CONFIG_UEFI_CPER) += efi/
diff --git a/drivers/firmware/broadcom/Kconfig b/drivers/firmware/broadcom/Kconfig
new file mode 100644
index 000000000000..6bed119930dd
--- /dev/null
+++ b/drivers/firmware/broadcom/Kconfig
@@ -0,0 +1,11 @@
1config BCM47XX_NVRAM
2 bool "Broadcom NVRAM driver"
3 depends on BCM47XX || ARCH_BCM_5301X
4 help
5 Broadcom home routers contain flash partition called "nvram" with all
6 important hardware configuration as well as some minor user setup.
7 NVRAM partition contains a text-like data representing name=value
8 pairs.
9 This driver provides an easy way to get value of requested parameter.
10 It simply reads content of NVRAM and parses it. It doesn't control any
11 hardware part itself.
diff --git a/drivers/firmware/broadcom/Makefile b/drivers/firmware/broadcom/Makefile
new file mode 100644
index 000000000000..d0e683583cd6
--- /dev/null
+++ b/drivers/firmware/broadcom/Makefile
@@ -0,0 +1 @@
obj-$(CONFIG_BCM47XX_NVRAM) += bcm47xx_nvram.o
diff --git a/arch/mips/bcm47xx/nvram.c b/drivers/firmware/broadcom/bcm47xx_nvram.c
index 9ccdce816f84..87add3fdce52 100644
--- a/arch/mips/bcm47xx/nvram.c
+++ b/drivers/firmware/broadcom/bcm47xx_nvram.c
@@ -244,3 +244,5 @@ char *bcm47xx_nvram_get_contents(size_t *nvram_size)
244 return nvram; 244 return nvram;
245} 245}
246EXPORT_SYMBOL(bcm47xx_nvram_get_contents); 246EXPORT_SYMBOL(bcm47xx_nvram_get_contents);
247
248MODULE_LICENSE("GPLv2");
diff --git a/include/linux/bcm47xx_nvram.h b/include/linux/bcm47xx_nvram.h
index c73927c66c2c..2793652fbf66 100644
--- a/include/linux/bcm47xx_nvram.h
+++ b/include/linux/bcm47xx_nvram.h
@@ -12,7 +12,7 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/vmalloc.h> 13#include <linux/vmalloc.h>
14 14
15#ifdef CONFIG_BCM47XX 15#ifdef CONFIG_BCM47XX_NVRAM
16int bcm47xx_nvram_init_from_mem(u32 base, u32 lim); 16int bcm47xx_nvram_init_from_mem(u32 base, u32 lim);
17int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len); 17int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len);
18int bcm47xx_nvram_gpio_pin(const char *name); 18int bcm47xx_nvram_gpio_pin(const char *name);