From: Florian Fainelli Date: Fri, 6 Jul 2012 22:10:37 +0000 (+0000) Subject: Detect alternative "cfe-" version bootloaders (found in 963281T_TEF board) X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=bb1488e5e7ae25aaaa740f074d8ab2e1f37fe700;p=openwrt%2Fstaging%2Fwigyori.git Detect alternative "cfe-" version bootloaders (found in 963281T_TEF board) Signed-off-by: Álvaro Fernández Rojas SVN-Revision: 32643 --- diff --git a/target/linux/brcm63xx/patches-3.3/107-cfe_version_mod.patch b/target/linux/brcm63xx/patches-3.3/107-cfe_version_mod.patch new file mode 100644 index 0000000000..c00ed113e3 --- /dev/null +++ b/target/linux/brcm63xx/patches-3.3/107-cfe_version_mod.patch @@ -0,0 +1,26 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -724,6 +724,8 @@ void __init board_prom_init(void) + if (!memcmp(cfe, "cfe-v", 5)) + snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u", + cfe[5], cfe[6], cfe[7], cfe[8], cfe[9]); ++ else if (!memcmp(cfe, "cfe-", 4)) ++ snprintf(cfe_version, 16, "%s", (char *) &cfe[4]); + else + strcpy(cfe_version, "unknown"); + printk(KERN_INFO PFX "CFE version: %s\n", cfe_version); +--- a/drivers/mtd/bcm63xxpart.c ++++ b/drivers/mtd/bcm63xxpart.c +@@ -54,10 +54,10 @@ static int bcm63xx_detect_cfe(struct mtd + if (ret) + return ret; + +- if (strncmp("cfe-v", buf, 5) == 0) ++ if (strncmp("cfe-", buf, 4) == 0) + return 0; + +- /* very old CFE's do not have the cfe-v string, so check for magic */ ++ /* very old CFE's do not have the cfe- string, so check for magic */ + ret = mtd_read(master, BCM63XX_CFE_MAGIC_OFFSET, 8, &retlen, + (void *)buf); + buf[retlen] = 0; diff --git a/target/linux/brcm63xx/patches-3.3/300-reset_buttons.patch b/target/linux/brcm63xx/patches-3.3/300-reset_buttons.patch index 0e1d6f8d95..28a88e6d1f 100644 --- a/target/linux/brcm63xx/patches-3.3/300-reset_buttons.patch +++ b/target/linux/brcm63xx/patches-3.3/300-reset_buttons.patch @@ -53,7 +53,7 @@ }; static struct board_info __initdata board_FAST2404 = { -@@ -821,11 +846,23 @@ static struct platform_device bcm63xx_gp +@@ -823,11 +848,23 @@ static struct platform_device bcm63xx_gp .dev.platform_data = &bcm63xx_led_data, }; @@ -77,7 +77,7 @@ if (board.has_uart0) bcm63xx_uart_register(0); -@@ -868,5 +905,16 @@ int __init board_register_devices(void) +@@ -870,5 +907,16 @@ int __init board_register_devices(void) platform_device_register(&bcm63xx_gpio_leds); diff --git a/target/linux/brcm63xx/patches-3.3/301-led_count.patch b/target/linux/brcm63xx/patches-3.3/301-led_count.patch index 84d57a00dd..4299d682e0 100644 --- a/target/linux/brcm63xx/patches-3.3/301-led_count.patch +++ b/target/linux/brcm63xx/patches-3.3/301-led_count.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -862,6 +862,7 @@ static struct platform_device bcm63xx_gp +@@ -864,6 +864,7 @@ static struct platform_device bcm63xx_gp int __init board_register_devices(void) { int button_count = 0; @@ -8,7 +8,7 @@ if (board.has_uart0) bcm63xx_uart_register(0); -@@ -900,7 +901,11 @@ int __init board_register_devices(void) +@@ -902,7 +903,11 @@ int __init board_register_devices(void) bcm63xx_flash_register(); diff --git a/target/linux/brcm63xx/patches-3.3/302-extended-platform-devices.patch b/target/linux/brcm63xx/patches-3.3/302-extended-platform-devices.patch index b48ef733bf..d2b99a5816 100644 --- a/target/linux/brcm63xx/patches-3.3/302-extended-platform-devices.patch +++ b/target/linux/brcm63xx/patches-3.3/302-extended-platform-devices.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -899,6 +899,9 @@ int __init board_register_devices(void) +@@ -901,6 +901,9 @@ int __init board_register_devices(void) bcm63xx_spi_register(); diff --git a/target/linux/brcm63xx/patches-3.3/303-spi-board-info.patch b/target/linux/brcm63xx/patches-3.3/303-spi-board-info.patch index 517a53b565..b81adb50e8 100644 --- a/target/linux/brcm63xx/patches-3.3/303-spi-board-info.patch +++ b/target/linux/brcm63xx/patches-3.3/303-spi-board-info.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -902,6 +903,9 @@ int __init board_register_devices(void) +@@ -904,6 +905,9 @@ int __init board_register_devices(void) if (board.num_devs) platform_add_devices(board.devs, board.num_devs); diff --git a/target/linux/brcm63xx/patches-3.3/304-boardid_fixup.patch b/target/linux/brcm63xx/patches-3.3/304-boardid_fixup.patch index 0c2fab5753..b486a86457 100644 --- a/target/linux/brcm63xx/patches-3.3/304-boardid_fixup.patch +++ b/target/linux/brcm63xx/patches-3.3/304-boardid_fixup.patch @@ -47,7 +47,7 @@ /* * early init callback, read nvram data from flash and checksum it */ -@@ -771,6 +798,11 @@ void __init board_prom_init(void) +@@ -773,6 +800,11 @@ void __init board_prom_init(void) return; } diff --git a/target/linux/brcm63xx/patches-3.3/401-MIPS-BCM63XX-register-ohci-device.patch b/target/linux/brcm63xx/patches-3.3/401-MIPS-BCM63XX-register-ohci-device.patch index 5798878810..e9a3c4fef8 100644 --- a/target/linux/brcm63xx/patches-3.3/401-MIPS-BCM63XX-register-ohci-device.patch +++ b/target/linux/brcm63xx/patches-3.3/401-MIPS-BCM63XX-register-ohci-device.patch @@ -66,7 +66,7 @@ Subject: [PATCH 24/63] MIPS: BCM63XX: register ohci device. #include #include -@@ -914,6 +915,9 @@ int __init board_register_devices(void) +@@ -916,6 +917,9 @@ int __init board_register_devices(void) !board_get_mac_address(board.enet1.mac_addr)) bcm63xx_enet_register(1, &board.enet1); diff --git a/target/linux/brcm63xx/patches-3.3/403-MIPS-BCM63XX-register-ehci-device.patch b/target/linux/brcm63xx/patches-3.3/403-MIPS-BCM63XX-register-ehci-device.patch index 36f6c2ee20..65117974f4 100644 --- a/target/linux/brcm63xx/patches-3.3/403-MIPS-BCM63XX-register-ehci-device.patch +++ b/target/linux/brcm63xx/patches-3.3/403-MIPS-BCM63XX-register-ehci-device.patch @@ -49,7 +49,7 @@ Subject: [PATCH 26/63] MIPS: BCM63XX: register ehci device. #include #include -@@ -915,6 +916,9 @@ int __init board_register_devices(void) +@@ -917,6 +918,9 @@ int __init board_register_devices(void) !board_get_mac_address(board.enet1.mac_addr)) bcm63xx_enet_register(1, &board.enet1); diff --git a/target/linux/brcm63xx/patches-3.3/408-6358-enet1-external-mii-clk.patch b/target/linux/brcm63xx/patches-3.3/408-6358-enet1-external-mii-clk.patch index 708e988b11..5cefb8e804 100644 --- a/target/linux/brcm63xx/patches-3.3/408-6358-enet1-external-mii-clk.patch +++ b/target/linux/brcm63xx/patches-3.3/408-6358-enet1-external-mii-clk.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -853,6 +853,8 @@ void __init board_prom_init(void) +@@ -855,6 +855,8 @@ void __init board_prom_init(void) if (BCMCPU_IS_6348()) val |= GPIO_MODE_6348_G3_EXT_MII | GPIO_MODE_6348_G0_EXT_MII; diff --git a/target/linux/brcm63xx/patches-3.3/415-bcm63xx_enet-add-support-for-bcm6368-internal-ethern.patch b/target/linux/brcm63xx/patches-3.3/415-bcm63xx_enet-add-support-for-bcm6368-internal-ethern.patch index 7ed32cfe54..feab03a265 100644 --- a/target/linux/brcm63xx/patches-3.3/415-bcm63xx_enet-add-support-for-bcm6368-internal-ethern.patch +++ b/target/linux/brcm63xx/patches-3.3/415-bcm63xx_enet-add-support-for-bcm6368-internal-ethern.patch @@ -13,7 +13,7 @@ Subject: [PATCH 31/63] bcm63xx_enet: add support for bcm6368 internal ethernet s --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -918,6 +918,10 @@ int __init board_register_devices(void) +@@ -920,6 +920,10 @@ int __init board_register_devices(void) !board_get_mac_address(board.enet1.mac_addr)) bcm63xx_enet_register(1, &board.enet1); diff --git a/target/linux/brcm63xx/patches-3.3/418-MIPS-BCM63XX-add-HS-SPI-platform-device-and-register.patch b/target/linux/brcm63xx/patches-3.3/418-MIPS-BCM63XX-add-HS-SPI-platform-device-and-register.patch index dd58c335c8..5b25344671 100644 --- a/target/linux/brcm63xx/patches-3.3/418-MIPS-BCM63XX-add-HS-SPI-platform-device-and-register.patch +++ b/target/linux/brcm63xx/patches-3.3/418-MIPS-BCM63XX-add-HS-SPI-platform-device-and-register.patch @@ -35,7 +35,7 @@ Signed-off-by: Jonas Gorski #include #include #include -@@ -943,6 +944,7 @@ int __init board_register_devices(void) +@@ -945,6 +946,7 @@ int __init board_register_devices(void) pr_err(PFX "failed to register fallback SPROM\n"); } #endif diff --git a/target/linux/brcm63xx/patches-3.3/421-MIPS-BCM63XX-move-nvram-related-functions-into-their.patch b/target/linux/brcm63xx/patches-3.3/421-MIPS-BCM63XX-move-nvram-related-functions-into-their.patch index db1891c948..ff2a831d84 100644 --- a/target/linux/brcm63xx/patches-3.3/421-MIPS-BCM63XX-move-nvram-related-functions-into-their.patch +++ b/target/linux/brcm63xx/patches-3.3/421-MIPS-BCM63XX-move-nvram-related-functions-into-their.patch @@ -125,7 +125,7 @@ Signed-off-by: Jonas Gorski u32 val; /* read base address of boot chip select (0) -@@ -784,32 +750,19 @@ void __init board_prom_init(void) +@@ -786,32 +752,19 @@ void __init board_prom_init(void) strcpy(cfe_version, "unknown"); printk(KERN_INFO PFX "CFE version: %s\n", cfe_version); @@ -162,7 +162,7 @@ Signed-off-by: Jonas Gorski continue; /* copy, board desc array is marked initdata */ memcpy(&board, bcm963xx_boards[i], sizeof(board)); -@@ -819,7 +772,7 @@ void __init board_prom_init(void) +@@ -821,7 +774,7 @@ void __init board_prom_init(void) /* bail out if board is not found, will complain later */ if (!board.name[0]) { char name[17]; @@ -171,7 +171,7 @@ Signed-off-by: Jonas Gorski name[16] = 0; printk(KERN_ERR PFX "unknown bcm963xx board: %s\n", name); -@@ -912,15 +865,15 @@ int __init board_register_devices(void) +@@ -914,15 +867,15 @@ int __init board_register_devices(void) bcm63xx_pcmcia_register(); if (board.has_enet0 && @@ -190,7 +190,7 @@ Signed-off-by: Jonas Gorski bcm63xx_enetsw_register(&board.enetsw); if (board.has_ehci0) -@@ -936,7 +889,7 @@ int __init board_register_devices(void) +@@ -938,7 +891,7 @@ int __init board_register_devices(void) * do this after registering enet devices */ #ifdef CONFIG_SSB_PCIHOST diff --git a/target/linux/brcm63xx/patches-3.3/425-BCM63XX-allow-providing-fixup-data-in-board-data.patch b/target/linux/brcm63xx/patches-3.3/425-BCM63XX-allow-providing-fixup-data-in-board-data.patch index 18e2aaa7a5..c79c3fe9af 100644 --- a/target/linux/brcm63xx/patches-3.3/425-BCM63XX-allow-providing-fixup-data-in-board-data.patch +++ b/target/linux/brcm63xx/patches-3.3/425-BCM63XX-allow-providing-fixup-data-in-board-data.patch @@ -18,7 +18,7 @@ Subject: [PATCH 67/80] BCM63XX: allow providing fixup data in board data #define PFX "board_bcm963xx: " -@@ -854,6 +855,7 @@ int __init board_register_devices(void) +@@ -856,6 +857,7 @@ int __init board_register_devices(void) { int button_count = 0; int led_count = 0; @@ -26,7 +26,7 @@ Subject: [PATCH 67/80] BCM63XX: allow providing fixup data in board data if (board.has_uart0) bcm63xx_uart_register(0); -@@ -889,7 +891,8 @@ int __init board_register_devices(void) +@@ -891,7 +893,8 @@ int __init board_register_devices(void) * do this after registering enet devices */ #ifdef CONFIG_SSB_PCIHOST @@ -36,7 +36,7 @@ Subject: [PATCH 67/80] BCM63XX: allow providing fixup data in board data memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN); memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN); if (ssb_arch_register_fallback_sprom( -@@ -929,5 +932,9 @@ int __init board_register_devices(void) +@@ -931,5 +934,9 @@ int __init board_register_devices(void) platform_device_register(&bcm63xx_gpio_keys_device); } diff --git a/target/linux/brcm63xx/patches-3.3/430-MIPS-BCM63XX-pass-caldata-info-to-flash.patch b/target/linux/brcm63xx/patches-3.3/430-MIPS-BCM63XX-pass-caldata-info-to-flash.patch index 5553d0b37f..2c7368477e 100644 --- a/target/linux/brcm63xx/patches-3.3/430-MIPS-BCM63XX-pass-caldata-info-to-flash.patch +++ b/target/linux/brcm63xx/patches-3.3/430-MIPS-BCM63XX-pass-caldata-info-to-flash.patch @@ -11,7 +11,7 @@ Subject: [PATCH 69/80] MIPS: BCM63XX: pass caldata info to flash --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -910,7 +910,7 @@ int __init board_register_devices(void) +@@ -912,7 +912,7 @@ int __init board_register_devices(void) if (board.num_spis) spi_register_board_info(board.spis, board.num_spis); diff --git a/target/linux/brcm63xx/patches-3.3/501-board-NB4.patch b/target/linux/brcm63xx/patches-3.3/501-board-NB4.patch index 02ffc6ae2b..beb8f33b69 100644 --- a/target/linux/brcm63xx/patches-3.3/501-board-NB4.patch +++ b/target/linux/brcm63xx/patches-3.3/501-board-NB4.patch @@ -551,7 +551,7 @@ /* * Register a sane SPROMv2 to make the on-board * bcm4318 WLAN work -@@ -808,6 +1328,9 @@ void __init board_prom_init(void) +@@ -810,6 +1330,9 @@ void __init board_prom_init(void) boardid_fixup(boot_addr); } diff --git a/target/linux/brcm63xx/patches-3.3/520-bcm63xx-add-support-for-96368MVWG-board.patch b/target/linux/brcm63xx/patches-3.3/520-bcm63xx-add-support-for-96368MVWG-board.patch index b1ac91c125..d23861ba35 100644 --- a/target/linux/brcm63xx/patches-3.3/520-bcm63xx-add-support-for-96368MVWG-board.patch +++ b/target/linux/brcm63xx/patches-3.3/520-bcm63xx-add-support-for-96368MVWG-board.patch @@ -102,7 +102,7 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. }; static void __init nb4_nvram_fixup(void) -@@ -2242,12 +2320,25 @@ void __init board_prom_init(void) +@@ -2244,12 +2322,25 @@ void __init board_prom_init(void) bcm63xx_pci_enabled = 1; if (BCMCPU_IS_6348()) val |= GPIO_MODE_6348_G2_PCI;