diff options
author | Jonas Gorski <jogo@openwrt.org> | 2013-02-15 12:23:49 +0000 |
---|---|---|
committer | Jonas Gorski <jogo@openwrt.org> | 2013-02-15 12:23:49 +0000 |
commit | 53f477ef476f52e776a51f37d9f7447c75a92b9b (patch) | |
tree | 8fcc7fee297d2d6f0b4c1ac86872f94d254586d5 /target/linux/brcm63xx/patches-3.7/108-MIPS-BCM63XX-make-nvram-checksum-failure-non-fatal.patch | |
parent | 240c27a41f2d5cb3f0ac4a37b4f83a642d638e16 (diff) | |
download | upstream-53f477ef476f52e776a51f37d9f7447c75a92b9b.tar.gz upstream-53f477ef476f52e776a51f37d9f7447c75a92b9b.tar.bz2 upstream-53f477ef476f52e776a51f37d9f7447c75a92b9b.zip |
bcm63xx: make nvram checksum failures non fatal
fixes #12982.
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35605 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm63xx/patches-3.7/108-MIPS-BCM63XX-make-nvram-checksum-failure-non-fatal.patch')
-rw-r--r-- | target/linux/brcm63xx/patches-3.7/108-MIPS-BCM63XX-make-nvram-checksum-failure-non-fatal.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/patches-3.7/108-MIPS-BCM63XX-make-nvram-checksum-failure-non-fatal.patch b/target/linux/brcm63xx/patches-3.7/108-MIPS-BCM63XX-make-nvram-checksum-failure-non-fatal.patch new file mode 100644 index 0000000000..2822031909 --- /dev/null +++ b/target/linux/brcm63xx/patches-3.7/108-MIPS-BCM63XX-make-nvram-checksum-failure-non-fatal.patch @@ -0,0 +1,67 @@ +From 5e6669fe7487c58b123da1df5c2d95db43185264 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski <jogo@openwrt.org> +Date: Tue, 12 Feb 2013 22:00:10 +0100 +Subject: [PATCH] MIPS: BCM63XX: make nvram checksum failure non fatal + +Some vendors modify the nvram layout moving the checksum to a different +place or drop it 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> +--- + arch/mips/bcm63xx/boards/board_bcm963xx.c | 5 +---- + arch/mips/bcm63xx/nvram.c | 7 +++---- + arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h | 4 +--- + 3 files changed, 5 insertions(+), 11 deletions(-) + +--- 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) + strcpy(cfe_version, "unknown"); + printk(KERN_INFO PFX "CFE version: %s\n", cfe_version); + +- if (bcm63xx_nvram_init(boot_addr + BCM963XX_NVRAM_OFFSET)) { +- printk(KERN_ERR PFX "invalid nvram checksum\n"); +- return; +- } ++ bcm63xx_nvram_init(boot_addr + BCM963XX_NVRAM_OFFSET); + + board_name = bcm63xx_nvram_get_name(); + /* find board by name */ +--- a/arch/mips/bcm63xx/nvram.c ++++ b/arch/mips/bcm63xx/nvram.c +@@ -38,7 +38,7 @@ struct bcm963xx_nvram { + static struct bcm963xx_nvram nvram; + static int mac_addr_used; + +-int __init bcm63xx_nvram_init(void *addr) ++void __init bcm63xx_nvram_init(void *addr) + { + unsigned int check_len; + u32 crc, expected_crc; +@@ -60,9 +60,8 @@ int __init bcm63xx_nvram_init(void *addr + crc = crc32_le(~0, (u8 *)&nvram, check_len); + + if (crc != expected_crc) +- return -EINVAL; +- +- return 0; ++ pr_warn("nvram checksum invalid (expected %08x, actual %08x)\n", ++ expected_crc, crc); + } + + u8 *bcm63xx_nvram_get_name(void) +--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h ++++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h +@@ -9,10 +9,8 @@ + * + * Initialized the local nvram copy from the target address and checks + * its checksum. +- * +- * Returns 0 on success. + */ +-int __init bcm63xx_nvram_init(void *nvram); ++void bcm63xx_nvram_init(void *nvram); + + /** + * bcm63xx_nvram_get_name() - returns the board name according to nvram |