MIPS: BCM47XX: nvram add nand flash support
authorHauke Mehrtens <hauke@hauke-m.de>
Wed, 26 Dec 2012 19:51:11 +0000 (19:51 +0000)
committerJohn Crispin <blogic@openwrt.org>
Fri, 15 Feb 2013 18:01:56 +0000 (19:01 +0100)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Patchwork: http://patchwork.linux-mips.org/patch/4741/
Signed-off-by: John Crispin <blogic@openwrt.org>
arch/mips/bcm47xx/nvram.c

index 80e352e..42e5271 100644 (file)
@@ -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;