summaryrefslogtreecommitdiffstats
path: root/drivers/nvmem
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2022-11-03 09:25:29 +0100
committerFlorian Fainelli <f.fainelli@gmail.com>2022-11-09 10:27:10 -0800
commita5be5ce0e25439fae3cd42e3d775979547926812 (patch)
tree0521d6846cbeb80679ef1646dc2d319528f14bf1 /drivers/nvmem
parent117bd98daca0fb1f4264e711f73ab76739e83466 (diff)
downloadlinux-a5be5ce0e25439fae3cd42e3d775979547926812.tar.bz2
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 <hauke@hauke-m.de> Cc: linux-mips@vger.kernel.org Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: bcm-kernel-feedback-list@broadcom.com Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Rafał Miłecki <rafal@milecki.pl> [Added an export for modules potentially using the init symbol] Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20221103082529.359084-1-linus.walleij@linaro.org Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Diffstat (limited to 'drivers/nvmem')
-rw-r--r--drivers/nvmem/brcm_nvram.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/nvmem/brcm_nvram.c b/drivers/nvmem/brcm_nvram.c
index 4441daa20965..34130449f2d2 100644
--- a/drivers/nvmem/brcm_nvram.c
+++ b/drivers/nvmem/brcm_nvram.c
@@ -3,6 +3,7 @@
* Copyright (C) 2021 Rafał Miłecki <rafal@milecki.pl>
*/
+#include <linux/bcm47xx_nvram.h>
#include <linux/io.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
@@ -136,6 +137,8 @@ static int brcm_nvram_probe(struct platform_device *pdev)
if (err)
return err;
+ bcm47xx_nvram_init_from_iomem(priv->base, resource_size(res));
+
config.dev = dev;
config.cells = priv->cells;
config.ncells = priv->ncells;