Commit f6e734a8 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by Ralf Baechle

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: default avatarRafał Miłecki <zajec5@gmail.com>
Reviewed-by: default avatarPaul 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: default avatarRalf Baechle <ralf@linux-mips.org>
parent 1e51714c
...@@ -2265,6 +2265,12 @@ S: Supported ...@@ -2265,6 +2265,12 @@ S: Supported
F: drivers/gpio/gpio-bcm-kona.c F: drivers/gpio/gpio-bcm-kona.c
F: Documentation/devicetree/bindings/gpio/gpio-bcm-kona.txt F: Documentation/devicetree/bindings/gpio/gpio-bcm-kona.txt
BROADCOM NVRAM DRIVER
M: Rafał Miłecki <zajec5@gmail.com>
L: linux-mips@linux-mips.org
S: Maintained
F: drivers/firmware/broadcom/*
BROADCOM SPECIFIC AMBA DRIVER (BCMA) BROADCOM SPECIFIC AMBA DRIVER (BCMA)
M: Rafał Miłecki <zajec5@gmail.com> M: Rafał Miłecki <zajec5@gmail.com>
L: linux-wireless@vger.kernel.org L: linux-wireless@vger.kernel.org
......
...@@ -190,6 +190,7 @@ config BCM47XX ...@@ -190,6 +190,7 @@ config BCM47XX
select USE_GENERIC_EARLY_PRINTK_8250 select USE_GENERIC_EARLY_PRINTK_8250
select GPIOLIB select GPIOLIB
select LEDS_GPIO_REGISTER select LEDS_GPIO_REGISTER
select BCM47XX_NVRAM
help help
Support for BCM47XX based boards Support for BCM47XX based boards
......
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
# under Linux. # under Linux.
# #
obj-y += irq.o nvram.o prom.o serial.o setup.o time.o sprom.o obj-y += irq.o prom.o serial.o setup.o time.o sprom.o
obj-y += board.o buttons.o leds.o workarounds.o obj-y += board.o buttons.o leds.o workarounds.o
...@@ -136,6 +136,7 @@ config QCOM_SCM ...@@ -136,6 +136,7 @@ config QCOM_SCM
bool bool
depends on ARM || ARM64 depends on ARM || ARM64
source "drivers/firmware/broadcom/Kconfig"
source "drivers/firmware/google/Kconfig" source "drivers/firmware/google/Kconfig"
source "drivers/firmware/efi/Kconfig" source "drivers/firmware/efi/Kconfig"
......
...@@ -14,6 +14,7 @@ obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o ...@@ -14,6 +14,7 @@ obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o
obj-$(CONFIG_QCOM_SCM) += qcom_scm.o obj-$(CONFIG_QCOM_SCM) += qcom_scm.o
CFLAGS_qcom_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1) CFLAGS_qcom_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1)
obj-y += broadcom/
obj-$(CONFIG_GOOGLE_FIRMWARE) += google/ obj-$(CONFIG_GOOGLE_FIRMWARE) += google/
obj-$(CONFIG_EFI) += efi/ obj-$(CONFIG_EFI) += efi/
obj-$(CONFIG_UEFI_CPER) += efi/ obj-$(CONFIG_UEFI_CPER) += efi/
config BCM47XX_NVRAM
bool "Broadcom NVRAM driver"
depends on BCM47XX || ARCH_BCM_5301X
help
Broadcom home routers contain flash partition called "nvram" with all
important hardware configuration as well as some minor user setup.
NVRAM partition contains a text-like data representing name=value
pairs.
This driver provides an easy way to get value of requested parameter.
It simply reads content of NVRAM and parses it. It doesn't control any
hardware part itself.
obj-$(CONFIG_BCM47XX_NVRAM) += bcm47xx_nvram.o
...@@ -244,3 +244,5 @@ char *bcm47xx_nvram_get_contents(size_t *nvram_size) ...@@ -244,3 +244,5 @@ char *bcm47xx_nvram_get_contents(size_t *nvram_size)
return nvram; return nvram;
} }
EXPORT_SYMBOL(bcm47xx_nvram_get_contents); EXPORT_SYMBOL(bcm47xx_nvram_get_contents);
MODULE_LICENSE("GPLv2");
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#ifdef CONFIG_BCM47XX #ifdef CONFIG_BCM47XX_NVRAM
int bcm47xx_nvram_init_from_mem(u32 base, u32 lim); int bcm47xx_nvram_init_from_mem(u32 base, u32 lim);
int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len); int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len);
int bcm47xx_nvram_gpio_pin(const char *name); int bcm47xx_nvram_gpio_pin(const char *name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment