diff options
author | Jonas Gorski <jogo@openwrt.org> | 2013-03-19 09:08:27 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-03-19 14:15:40 -0400 |
commit | 97367519d7dac94de566796f034d5f72cbc671f7 (patch) | |
tree | 7b9620f642b242634928a7a6cf3ee048c5a3bffc /arch | |
parent | 63c2b6812f1dc0beda4d6adad0365e048aa693e2 (diff) |
MIPS: BCM63XX: Make nvram checksum failure non fatal
Some vendors modify the nvram layout moving the checksum to a different
place or dropping entirely, so reduce the checksum failure to a warning.
Reported-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Cc: linux-mips@linux-mips.org
Cc: John Crispin <blogic@openwrt.org>
Cc: Maxime Bizon <mbizon@freebox.fr>
Cc: Florian Fainelli <florian@openwrt.org>
Cc: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/bcm63xx/boards/board_bcm963xx.c | 5 | ||||
-rw-r--r-- | arch/mips/bcm63xx/nvram.c | 7 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h | 4 |
3 files changed, 5 insertions, 11 deletions
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c index ed1949c29508..9aa7d44898ed 100644 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c | |||
@@ -745,10 +745,7 @@ void __init board_prom_init(void) | |||
745 | strcpy(cfe_version, "unknown"); | 745 | strcpy(cfe_version, "unknown"); |
746 | printk(KERN_INFO PFX "CFE version: %s\n", cfe_version); | 746 | printk(KERN_INFO PFX "CFE version: %s\n", cfe_version); |
747 | 747 | ||
748 | if (bcm63xx_nvram_init(boot_addr + BCM963XX_NVRAM_OFFSET)) { | 748 | bcm63xx_nvram_init(boot_addr + BCM963XX_NVRAM_OFFSET); |
749 | printk(KERN_ERR PFX "invalid nvram checksum\n"); | ||
750 | return; | ||
751 | } | ||
752 | 749 | ||
753 | board_name = bcm63xx_nvram_get_name(); | 750 | board_name = bcm63xx_nvram_get_name(); |
754 | /* find board by name */ | 751 | /* find board by name */ |
diff --git a/arch/mips/bcm63xx/nvram.c b/arch/mips/bcm63xx/nvram.c index 620611680839..a4b8864f9307 100644 --- a/arch/mips/bcm63xx/nvram.c +++ b/arch/mips/bcm63xx/nvram.c | |||
@@ -38,7 +38,7 @@ struct bcm963xx_nvram { | |||
38 | static struct bcm963xx_nvram nvram; | 38 | static struct bcm963xx_nvram nvram; |
39 | static int mac_addr_used; | 39 | static int mac_addr_used; |
40 | 40 | ||
41 | int __init bcm63xx_nvram_init(void *addr) | 41 | void __init bcm63xx_nvram_init(void *addr) |
42 | { | 42 | { |
43 | unsigned int check_len; | 43 | unsigned int check_len; |
44 | u32 crc, expected_crc; | 44 | u32 crc, expected_crc; |
@@ -60,9 +60,8 @@ int __init bcm63xx_nvram_init(void *addr) | |||
60 | crc = crc32_le(~0, (u8 *)&nvram, check_len); | 60 | crc = crc32_le(~0, (u8 *)&nvram, check_len); |
61 | 61 | ||
62 | if (crc != expected_crc) | 62 | if (crc != expected_crc) |
63 | return -EINVAL; | 63 | pr_warn("nvram checksum failed, contents may be invalid (expected %08x, got %08x)\n", |
64 | 64 | expected_crc, crc); | |
65 | return 0; | ||
66 | } | 65 | } |
67 | 66 | ||
68 | u8 *bcm63xx_nvram_get_name(void) | 67 | u8 *bcm63xx_nvram_get_name(void) |
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h index 62d6a3b4d3b7..4e0b6bc1165e 100644 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h | |||
@@ -9,10 +9,8 @@ | |||
9 | * | 9 | * |
10 | * Initialized the local nvram copy from the target address and checks | 10 | * Initialized the local nvram copy from the target address and checks |
11 | * its checksum. | 11 | * its checksum. |
12 | * | ||
13 | * Returns 0 on success. | ||
14 | */ | 12 | */ |
15 | int __init bcm63xx_nvram_init(void *nvram); | 13 | void bcm63xx_nvram_init(void *nvram); |
16 | 14 | ||
17 | /** | 15 | /** |
18 | * bcm63xx_nvram_get_name() - returns the board name according to nvram | 16 | * bcm63xx_nvram_get_name() - returns the board name according to nvram |