ipq806x: nbg6817: case-insensitive qcom-smem partitions
authorStefan Lippers-Hollmann <s.l-h@gmx.de>
Thu, 6 May 2021 22:44:03 +0000 (00:44 +0200)
committerPetr Štetiar <ynezz@true.cz>
Sat, 8 May 2021 16:45:42 +0000 (18:45 +0200)
The out-of-tree qcom-smem patches traditionally displayed mtd partition names
in upper case, starting with the new mainline qcom-smem support in kernel v5.10,
it switches to normalizing the partition names to lower case.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
target/linux/ipq806x/base-files/etc/board.d/02_network
target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh

index 81edc569a75ac0d66da92fd7f98b904cb35b93de..511794a3ceaa54fcba414faf8d0ca81377e4fd1f 100644 (file)
@@ -69,7 +69,10 @@ ubnt,unifi-ac-hd)
        ucidef_set_interface_lan "eth0 eth1"
        ;;
 zyxel,nbg6817)
-       hw_mac_addr=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
+       hw_mac_addr=$(mtd_get_mac_ascii 0:appsblenv ethaddr)
+       # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
+       [ -n "$hw_mac_addr" ] || \
+               hw_mac_addr=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
        ucidef_add_switch "switch0" \
                "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
        ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 2)"
index 3befc40630c988d7f84c940bf4cff4d0b2c4cfc4..a05bd99bc716c9cca83db6e1f3c011b6e9cab48f 100644 (file)
@@ -45,8 +45,14 @@ case "$FIRMWARE" in
                ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 0x0) -1)
                ;;
        zyxel,nbg6817)
-               caldata_extract "0:ART" 0x1000 0x2f20
-               ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) +1)
+               if [ -b "$(find_mtd_part 0:art)" ]; then
+                       caldata_extract "0:art" 0x1000 0x2f20
+                       ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) +1)
+               else
+                       # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
+                       caldata_extract "0:ART" 0x1000 0x2f20
+                       ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) +1)
+               fi
                ;;
        esac
        ;;
@@ -85,8 +91,14 @@ case "$FIRMWARE" in
                ath10k_patch_mac $(mtd_get_mac_binary default-mac 0x0)
                ;;
        zyxel,nbg6817)
-               caldata_extract "0:ART" 0x5000 0x2f20
-               ath10k_patch_mac $(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
+               if [ -b "$(find_mtd_part 0:art)" ]; then
+                       caldata_extract "0:art" 0x5000 0x2f20
+                       ath10k_patch_mac $(mtd_get_mac_ascii 0:appsblenv ethaddr)
+               else
+                       # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
+                       caldata_extract "0:ART" 0x5000 0x2f20
+                       ath10k_patch_mac $(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
+               fi
                ;;
        esac
        ;;
index cece018b31da08bea4925891307f137c4b5a909e..50f8a3ceaf3687682d04dec2ddacde882050c74c 100644 (file)
@@ -90,7 +90,10 @@ zyxel_do_upgrade() {
        [ -b "${rootfs}" ] || return 1
        case "$board" in
        zyxel,nbg6817)
-               local dualflagmtd="$(find_mtd_part 0:DUAL_FLAG)"
+               local dualflagmtd="$(find_mtd_part 0:dual_flag)"
+               # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
+               [ -b $dualflagmtd ] || \
+                       dualflagmtd="$(find_mtd_part 0:DUAL_FLAG)"
                [ -b $dualflagmtd ] || return 1
 
                case "$rootfs" in