From a5be5ce0e25439fae3cd42e3d775979547926812 Mon Sep 17 00:00:00 2001 From: Rafał Miłecki Date: Thu, 3 Nov 2022 09:25:29 +0100 Subject: firmware/nvram: bcm47xx: support init from IO memory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Cc: linux-mips@vger.kernel.org Cc: Florian Fainelli Cc: bcm-kernel-feedback-list@broadcom.com Cc: Thomas Bogendoerfer Signed-off-by: Rafał Miłecki [Added an export for modules potentially using the init symbol] Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20221103082529.359084-1-linus.walleij@linaro.org Signed-off-by: Florian Fainelli --- drivers/nvmem/brcm_nvram.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/nvmem') 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 */ +#include #include #include #include @@ -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; -- cgit v1.2.3