bcm63xx: switch to upstream CFE version detection patch
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Thu, 6 Aug 2020 14:20:30 +0000 (16:20 +0200)
committerÁlvaro Fernández Rojas <noltari@gmail.com>
Thu, 6 Aug 2020 21:06:12 +0000 (23:06 +0200)
The patch improving CFE version detection has been merged (linux 5.9).

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
target/linux/bcm63xx/patches-5.4/032-v5.9-MIPS-BCM63xx-improve-CFE-version-detection.patch [new file with mode: 0644]
target/linux/bcm63xx/patches-5.4/106-MIPS-BCM63XX-register-OHCI-controller-if-board-enabl.patch
target/linux/bcm63xx/patches-5.4/109-MIPS-BCM63XX-register-EHCI-controller-if-board-enabl.patch
target/linux/bcm63xx/patches-5.4/207-MIPS-BCM63XX-move-device-registration-code-into-its-.patch
target/linux/bcm63xx/patches-5.4/208-MIPS-BCM63XX-pass-a-mac-addresss-allocator-to-board-.patch
target/linux/bcm63xx/patches-5.4/309-cfe_version_mod.patch [deleted file]
target/linux/bcm63xx/patches-5.4/368-MIPS-BCM63XX-add-support-for-matching-the-board_info.patch

diff --git a/target/linux/bcm63xx/patches-5.4/032-v5.9-MIPS-BCM63xx-improve-CFE-version-detection.patch b/target/linux/bcm63xx/patches-5.4/032-v5.9-MIPS-BCM63xx-improve-CFE-version-detection.patch
new file mode 100644 (file)
index 0000000..1daa3e6
--- /dev/null
@@ -0,0 +1,56 @@
+From e27e1cc9d360a347dbd5a398e9df21cfb4e60e3c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
+Date: Mon, 8 Jun 2020 11:28:35 +0200
+Subject: [PATCH] MIPS: BCM63xx: improve CFE version detection
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+There are some CFE variants that start with 'cfe-vd' instead of 'cfe-v', such
+as the one used in the Huawei HG556a: "cfe-vd081.5003". In this case, the CFE
+version is stored as is (string vs number bytes).
+
+Some newer devices have an additional version number, such as the Comtrend
+VR-3032u: "1.0.38-112.118-11".
+
+Finally, print the string as is if the version doesn't start with "cfe-v" or
+"cfe-vd", but starts with "cfe-".
+
+Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
+---
+ arch/mips/bcm63xx/boards/board_bcm963xx.c | 22 ++++++++++++++++++----
+ 1 file changed, 18 insertions(+), 4 deletions(-)
+
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -760,11 +760,25 @@ void __init board_prom_init(void)
+       /* dump cfe version */
+       cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET;
+-      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 (strstarts(cfe, "cfe-")) {
++              if(cfe[4] == 'v') {
++                      if(cfe[5] == 'd')
++                              snprintf(cfe_version, 11, "%s",
++                                       (char *) &cfe[5]);
++                      else if (cfe[10] > 0)
++                              snprintf(cfe_version, sizeof(cfe_version),
++                                       "%u.%u.%u-%u.%u-%u", cfe[5], cfe[6],
++                                       cfe[7], cfe[8], cfe[9], cfe[10]);
++                      else
++                              snprintf(cfe_version, sizeof(cfe_version),
++                                       "%u.%u.%u-%u.%u", cfe[5], cfe[6],
++                                       cfe[7], cfe[8], cfe[9]);
++              } else {
++                      snprintf(cfe_version, 12, "%s", (char *) &cfe[4]);
++              }
++      } else {
+               strcpy(cfe_version, "unknown");
++      }
+       pr_info("CFE version: %s\n", cfe_version);
+       bcm63xx_nvram_init(boot_addr + BCM963XX_NVRAM_OFFSET);
index 80427d7fd347330549c6ab8cb968424e3bf139aa..b2fbb68ee19bb7ff493a75d0efa3bf8b66f7b768 100644 (file)
@@ -24,7 +24,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
  #include <bcm63xx_dev_usb_usbd.h>
  #include <board_bcm963xx.h>
  
-@@ -878,6 +879,9 @@ int __init board_register_devices(void)
+@@ -892,6 +893,9 @@ int __init board_register_devices(void)
        if (board.has_usbd)
                bcm63xx_usbd_register(&board.usbd);
  
index e8c2588b67ee3fecd831140d1e33a15868188629..feb99a1cd71907f2cd63a605be0006dfebd3eeb6 100644 (file)
@@ -24,7 +24,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
  #include <bcm63xx_dev_usb_ohci.h>
  #include <bcm63xx_dev_usb_usbd.h>
  #include <board_bcm963xx.h>
-@@ -879,6 +880,9 @@ int __init board_register_devices(void)
+@@ -893,6 +894,9 @@ int __init board_register_devices(void)
        if (board.has_usbd)
                bcm63xx_usbd_register(&board.usbd);
  
index f39c9a81227006e447cb8f1f79eb6cdc9ac0a8ad..a53274a4ba441e4f3318587a193a0d9bc9f3298a 100644 (file)
@@ -114,7 +114,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
   * early init callback, read nvram data from flash and checksum it
   */
  void __init board_prom_init(void)
-@@ -782,137 +724,15 @@ void __init board_prom_init(void)
+@@ -796,137 +738,15 @@ void __init board_prom_init(void)
                if (strncmp(board_name, bcm963xx_boards[i]->name, 16))
                        continue;
                /* copy, board desc array is marked initdata */
index f34e2223148e9099570e3b597ea02c1770a18aa6..3cf3afd49d9e8ef3e92afde2ccf9f10d772e7dac 100644 (file)
@@ -17,7 +17,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
 
 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -724,7 +724,8 @@ void __init board_prom_init(void)
+@@ -738,7 +738,8 @@ void __init board_prom_init(void)
                if (strncmp(board_name, bcm963xx_boards[i]->name, 16))
                        continue;
                /* copy, board desc array is marked initdata */
diff --git a/target/linux/bcm63xx/patches-5.4/309-cfe_version_mod.patch b/target/linux/bcm63xx/patches-5.4/309-cfe_version_mod.patch
deleted file mode 100644 (file)
index 3a0d080..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
-+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -704,10 +704,20 @@ void __init board_prom_init(void)
-       /* dump cfe version */
-       cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET;
--      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 (strstarts(cfe, "cfe-")) {
-+              if(cfe[4] == 'v') {
-+                      if(cfe[5] == 'd')
-+                              snprintf(cfe_version, 11, "%s", (char *) &cfe[5]);
-+                      else if (cfe[10] > 0)
-+                              snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u-%u",
-+                                       cfe[5], cfe[6], cfe[7], cfe[8], cfe[9], cfe[10]);
-+                      else
-+                              snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u",
-+                                       cfe[5], cfe[6], cfe[7], cfe[8], cfe[9]);
-+              } else {
-+                      snprintf(cfe_version, 12, "%s", (char *) &cfe[4]);
-+              }
-+      } else
-               strcpy(cfe_version, "unknown");
-       pr_info("CFE version: %s\n", cfe_version);
index db30de2183f7f7a526339db03106a51886d8ba8c..ba7346ce2890f1201b0d261593f90a291b605d83 100644 (file)
@@ -35,7 +35,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
  
        /* read base address of boot chip select (0)
         * 6328/6362 do not have MPI but boot from a fixed address
-@@ -742,6 +747,16 @@ void __init board_bcm963xx_init(void)
+@@ -746,6 +751,16 @@ void __init board_bcm963xx_init(void)
        } else {
                board_name = bcm63xx_nvram_get_name();
        }