linux-mips
[Top] [All Lists]

[PATCH 3/6] MIPS: BCM47XX: nvram add nand flash support

To: john@phrozen.org, ralf@linux-mips.org
Subject: [PATCH 3/6] MIPS: BCM47XX: nvram add nand flash support
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Wed, 26 Dec 2012 21:51:11 +0100
Cc: linux-mips@linux-mips.org, zajec5@gmail.com, Hauke Mehrtens <hauke@hauke-m.de>
In-reply-to: <1356555074-1230-1-git-send-email-hauke@hauke-m.de>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1356555074-1230-1-git-send-email-hauke@hauke-m.de>
Sender: linux-mips-bounce@linux-mips.org
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 arch/mips/bcm47xx/nvram.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c
index 80e352e..42e5271 100644
--- a/arch/mips/bcm47xx/nvram.c
+++ b/arch/mips/bcm47xx/nvram.c
@@ -30,6 +30,7 @@ static int nvram_find_and_copy(u32 base, u32 lim)
        u32 off;
        u32 *src, *dst;
 
+       /* TODO: when nvram is on nand flash check for bad blocks first. */
        off = FLASH_MIN;
        while (off <= lim) {
                /* Windowed flash access */
@@ -88,6 +89,12 @@ static int nvram_init_bcma(void)
        u32 base;
        u32 lim;
 
+#ifdef CONFIG_BCMA_NFLASH
+       if (cc->nflash.boot) {
+               base = BCMA_SOC_FLASH1;
+               lim = BCMA_SOC_FLASH1_SZ;
+       } else
+#endif
        if (cc->pflash.present) {
                base = cc->pflash.window;
                lim = cc->pflash.window_size;
-- 
1.7.10.4


<Prev in Thread] Current Thread [Next in Thread>