1 From 5e6669fe7487c58b123da1df5c2d95db43185264 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Tue, 12 Feb 2013 22:00:10 +0100
4 Subject: [PATCH] MIPS: BCM63XX: make nvram checksum failure non fatal
6 Some vendors modify the nvram layout moving the checksum to a different
7 place or drop it entirely, so reduce the checksum failure to a warning.
9 Reported-by: Álvaro Fernández Rojas <noltari@gmail.com>
10 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
12 arch/mips/bcm63xx/boards/board_bcm963xx.c | 5 +----
13 arch/mips/bcm63xx/nvram.c | 7 +++----
14 arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h | 4 +---
15 3 files changed, 5 insertions(+), 11 deletions(-)
17 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
18 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
19 @@ -745,10 +745,7 @@ void __init board_prom_init(void)
20 strcpy(cfe_version, "unknown");
21 printk(KERN_INFO PFX "CFE version: %s\n", cfe_version);
23 - if (bcm63xx_nvram_init(boot_addr + BCM963XX_NVRAM_OFFSET)) {
24 - printk(KERN_ERR PFX "invalid nvram checksum\n");
27 + bcm63xx_nvram_init(boot_addr + BCM963XX_NVRAM_OFFSET);
29 board_name = bcm63xx_nvram_get_name();
30 /* find board by name */
31 --- a/arch/mips/bcm63xx/nvram.c
32 +++ b/arch/mips/bcm63xx/nvram.c
33 @@ -38,7 +38,7 @@ struct bcm963xx_nvram {
34 static struct bcm963xx_nvram nvram;
35 static int mac_addr_used;
37 -int __init bcm63xx_nvram_init(void *addr)
38 +void __init bcm63xx_nvram_init(void *addr)
40 unsigned int check_len;
41 u32 crc, expected_crc;
42 @@ -60,9 +60,8 @@ int __init bcm63xx_nvram_init(void *addr
43 crc = crc32_le(~0, (u8 *)&nvram, check_len);
45 if (crc != expected_crc)
49 + pr_warn("nvram checksum invalid (expected %08x, actual %08x)\n",
53 u8 *bcm63xx_nvram_get_name(void)
54 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h
55 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h
58 * Initialized the local nvram copy from the target address and checks
61 - * Returns 0 on success.
63 -int __init bcm63xx_nvram_init(void *nvram);
64 +void bcm63xx_nvram_init(void *nvram);
67 * bcm63xx_nvram_get_name() - returns the board name according to nvram