[brcm63xx] Detect alternative "cfe-" version bootloaders (found in 963281T_TEF board)
authorFlorian Fainelli <florian@openwrt.org>
Fri, 6 Jul 2012 22:10:37 +0000 (22:10 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Fri, 6 Jul 2012 22:10:37 +0000 (22:10 +0000)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
SVN-Revision: 32643

16 files changed:
target/linux/brcm63xx/patches-3.3/107-cfe_version_mod.patch [new file with mode: 0644]
target/linux/brcm63xx/patches-3.3/300-reset_buttons.patch
target/linux/brcm63xx/patches-3.3/301-led_count.patch
target/linux/brcm63xx/patches-3.3/302-extended-platform-devices.patch
target/linux/brcm63xx/patches-3.3/303-spi-board-info.patch
target/linux/brcm63xx/patches-3.3/304-boardid_fixup.patch
target/linux/brcm63xx/patches-3.3/401-MIPS-BCM63XX-register-ohci-device.patch
target/linux/brcm63xx/patches-3.3/403-MIPS-BCM63XX-register-ehci-device.patch
target/linux/brcm63xx/patches-3.3/408-6358-enet1-external-mii-clk.patch
target/linux/brcm63xx/patches-3.3/415-bcm63xx_enet-add-support-for-bcm6368-internal-ethern.patch
target/linux/brcm63xx/patches-3.3/418-MIPS-BCM63XX-add-HS-SPI-platform-device-and-register.patch
target/linux/brcm63xx/patches-3.3/421-MIPS-BCM63XX-move-nvram-related-functions-into-their.patch
target/linux/brcm63xx/patches-3.3/425-BCM63XX-allow-providing-fixup-data-in-board-data.patch
target/linux/brcm63xx/patches-3.3/430-MIPS-BCM63XX-pass-caldata-info-to-flash.patch
target/linux/brcm63xx/patches-3.3/501-board-NB4.patch
target/linux/brcm63xx/patches-3.3/520-bcm63xx-add-support-for-96368MVWG-board.patch

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 (file)
index 0000000..c00ed11
--- /dev/null
@@ -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;
index 0e1d6f8d95c6478ed603d4c97bc6af51e6634e04..28a88e6d1f38fd2d565c8e32f34aaf4453418b68 100644 (file)
@@ -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);
  
index 84d57a00ddf373ba2906d50914e786404e02ba79..4299d682e098af42d23d38ae5df757210e8b3d25 100644 (file)
@@ -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();
  
index b48ef733bfbdec7f2a3977bf5322fca8d8b192b8..d2b99a58163d7bace761c532607e17f94bd7cc93 100644 (file)
@@ -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();
  
index 517a53b565936dc97f12e1db4f2dd9d31515a4b6..b81adb50e8ccb27adc42de305637482443233bec 100644 (file)
@@ -8,7 +8,7 @@
  #include <asm/addrspace.h>
  #include <bcm63xx_board.h>
  #include <bcm63xx_cpu.h>
-@@ -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);
  
index 0c2fab57538ffb7273f0a92da5dae863b6cf8077..b486a864578c582fbbe5c84e44d843b9f2b6e1b5 100644 (file)
@@ -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;
        }
  
index 57988788103caf65c6940d1299a17db1e63c90e8..e9a3c4fef80d067cd789f30361007fadabc7f2b9 100644 (file)
@@ -66,7 +66,7 @@ Subject: [PATCH 24/63] MIPS: BCM63XX: register ohci device.
  #include <board_bcm963xx.h>
  #include <bcm_tag.h>
  
-@@ -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);
  
index 36f6c2ee20d32b62eaced7a49cef0e1d7b9639ee..65117974f42ba079f3f98f5fa7cde09a40102f43 100644 (file)
@@ -49,7 +49,7 @@ Subject: [PATCH 26/63] MIPS: BCM63XX: register ehci device.
  #include <board_bcm963xx.h>
  #include <bcm_tag.h>
  
-@@ -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);
  
index 708e988b119b2c864fa6307cd731a1ac25edf5bd..5cefb8e804335b1a92f905d41c4b309253079f18 100644 (file)
@@ -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;
index 7ed32cfe54d4a217bb9fbafdd8c12143400fbe11..feab03a265652db2e58c62ddf756ca36f8102df8 100644 (file)
@@ -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);
  
index dd58c335c833fdb0cb110c6ea24b48ff074fa80e..5b25344671fefec7bec1142c2f2055b92f4d770c 100644 (file)
@@ -35,7 +35,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
  #include <bcm63xx_dev_pcmcia.h>
  #include <bcm63xx_dev_spi.h>
  #include <bcm63xx_dev_usb_ohci.h>
-@@ -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
index db1891c948dc50d6a8de52aea316270db369e517..ff2a831d84bedfde3c2b57a8c14955c6f83366e1 100644 (file)
@@ -125,7 +125,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
        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 <jonas.gorski@gmail.com>
                        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 <jonas.gorski@gmail.com>
                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 <jonas.gorski@gmail.com>
                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
index 18e2aaa7a551c4704be7a561a606aee039a3e68c..c79c3fe9af0a63751517f7f99c04f4ecc0fec791 100644 (file)
@@ -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);
        }
  
index 5553d0b37f009185200c384ecd9e01305f338df7..2c7368477e66a9029060e04b0d531343f8c67eb4 100644 (file)
@@ -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);
  
index 02ffc6ae2be47c612840efb05d64ebea06ebb8d8..beb8f33b696bc3d168a0adf2c159968c1b1873f5 100644 (file)
  /*
   * 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);
        }
  
index b1ac91c125bc80966feed8871afe7092c41f4ffd..d23861ba352f8eb333e7443b8171ec79eec5aee1 100644 (file)
@@ -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;