base = bcma_cc->pflash.window;
lim = bcma_cc->pflash.window_size;
break;
-@@ -86,7 +84,106 @@ found:
+@@ -86,7 +84,110 @@ found:
for (i = 0; i < sizeof(struct nvram_header); i += 4)
*dst++ = *src++;
for (; i < header->len && i < NVRAM_SPACE; i += 4)
+ switch (bcm47xx_bus.ssb.chipco.flash_type) {
+ case SSB_PFLASH:
+ early_nvram_init_pflash();
++ break;
+ case SSB_SFLASH:
+ err = early_nvram_init_sflash();
+ if (err < 0)
+ printk(KERN_WARNING "can not read from flash: %i\n", err);
++ break;
+ default:
+ printk(KERN_WARNING "unknow flash type\n");
+ }
+ switch (bcm47xx_bus.bcma.bus.drv_cc.flash_type) {
+ case BCMA_PFLASH:
+ early_nvram_init_pflash();
++ break;
+ case BCMA_SFLASH:
+ err = early_nvram_init_sflash();
+ if (err < 0)
+ printk(KERN_WARNING "can not read from flash: %i\n", err);
++ break;
+ default:
+ printk(KERN_WARNING "unknow flash type\n");
+ }
#ifdef CONFIG_BCM47XX_SSB
static void early_nvram_init_ssb(void)
{
-@@ -164,6 +211,10 @@ static void early_nvram_init_bcma(void)
- err = early_nvram_init_sflash();
+@@ -168,6 +215,11 @@ static void early_nvram_init_bcma(void)
if (err < 0)
printk(KERN_WARNING "can not read from flash: %i\n", err);
+ break;
+ case BCMA_NFLASH:
+ err = early_nvram_init_nflash();
+ if (err < 0)
+ printk(KERN_WARNING "can not read from nflash: %i\n", err);
++ break;
default:
printk(KERN_WARNING "unknow flash type\n");
}
--- a/arch/mips/bcm47xx/nvram.c
+++ b/arch/mips/bcm47xx/nvram.c
-@@ -258,8 +258,7 @@ int nvram_getenv(char *name, char *val,
+@@ -263,8 +263,7 @@ int nvram_getenv(char *name, char *val,
value = eq + 1;
if ((eq - var) == strlen(name) &&
strncmp(var, name, (eq - var)) == 0) {
--- a/arch/mips/bcm47xx/nvram.c
+++ b/arch/mips/bcm47xx/nvram.c
-@@ -264,3 +264,30 @@ int nvram_getenv(char *name, char *val,
+@@ -269,3 +269,30 @@ int nvram_getenv(char *name, char *val,
return NVRAM_ERR_ENVNOTFOUND;
}
EXPORT_SYMBOL(nvram_getenv);
off = FLASH_MIN;
while (off <= lim) {
-@@ -247,6 +268,12 @@ int nvram_getenv(char *name, char *val,
+@@ -252,6 +273,12 @@ int nvram_getenv(char *name, char *val,
if (!nvram_buf[0])
early_nvram_init();
/* Look for name=value and return value */
var = &nvram_buf[sizeof(struct nvram_header)];
end = nvram_buf + sizeof(nvram_buf) - 2;
-@@ -275,6 +302,9 @@ char *nvram_get(const char *name)
+@@ -280,6 +307,9 @@ char *nvram_get(const char *name)
if (!nvram_buf[0])
early_nvram_init();