aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRafał Miłecki <[email protected]>2022-11-03 09:25:29 +0100
committerFlorian Fainelli <[email protected]>2022-11-09 10:27:10 -0800
commita5be5ce0e25439fae3cd42e3d775979547926812 (patch)
tree0521d6846cbeb80679ef1646dc2d319528f14bf1 /include/linux
parent117bd98daca0fb1f4264e711f73ab76739e83466 (diff)
firmware/nvram: bcm47xx: support init from IO memory
Provide NVMEM content to the NVRAM driver from a simple memory resource. This is necessary to use NVRAM in a memory- mapped flash device. Patch taken from OpenWrts development tree. This patch makes it possible to use memory-mapped NVRAM on the D-Link DWL-8610AP and the D-Link DIR-890L. Cc: Hauke Mehrtens <[email protected]> Cc: [email protected] Cc: Florian Fainelli <[email protected]> Cc: [email protected] Cc: Thomas Bogendoerfer <[email protected]> Signed-off-by: Rafał Miłecki <[email protected]> [Added an export for modules potentially using the init symbol] Signed-off-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Florian Fainelli <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bcm47xx_nvram.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/bcm47xx_nvram.h b/include/linux/bcm47xx_nvram.h
index 53b31f69b74a..7615f8d7b1ed 100644
--- a/include/linux/bcm47xx_nvram.h
+++ b/include/linux/bcm47xx_nvram.h
@@ -11,6 +11,7 @@
#include <linux/vmalloc.h>
#ifdef CONFIG_BCM47XX_NVRAM
+int bcm47xx_nvram_init_from_iomem(void __iomem *nvram_start, size_t res_size);
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_gpio_pin(const char *name);
@@ -20,6 +21,11 @@ static inline void bcm47xx_nvram_release_contents(char *nvram)
vfree(nvram);
};
#else
+static inline int bcm47xx_nvram_init_from_iomem(void __iomem *nvram_start,
+ size_t res_size)
+{
+ return -ENOTSUPP;
+}
static inline int bcm47xx_nvram_init_from_mem(u32 base, u32 lim)
{
return -ENOTSUPP;