ipq806x: remove transition workarounds for qcom-smem partitions
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Sat, 30 Oct 2021 18:06:58 +0000 (20:06 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Sat, 30 Oct 2021 20:11:23 +0000 (22:11 +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 switched to normalizing the partition names to lower case.

While both 5.4 and 5.10 were supported in the target, we carried a workaround
to support both of them. Since the target has dropped 5.4 recently, those
can be removed now.

Ref:

2db9dded0a1a ("ipq806x: nbg6817: case-insensitive qcom-smem partitions")
435dc2e77e3b ("ipq806x: ecw5410: case-insensitive qcom-smem partitions")
f70e11cd974e ("ipq806x: g10: case-insensitive qcom-smem partitions")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.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/asrock.sh
target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh

index bb77332ef929c03e28d9a006ff0667df593a4dbb..a75d32ab6f51e9e25a516b976036e6b1a264084a 100644 (file)
@@ -29,14 +29,8 @@ tplink,vr2600v)
        ;;
 edgecore,ecw5410)
        ucidef_set_interfaces_lan_wan "eth1" "eth0"
-       if [ -b "$(find_mtd_part 0:art)" ]; then
-               ucidef_set_interface_macaddr "lan" "$(mtd_get_mac_binary "0:art" 0x6)"
-               ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary "0:art" 0x0)"
-       else
-               # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
-               ucidef_set_interface_macaddr "lan" "$(mtd_get_mac_binary "0:ART" 0x6)"
-               ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary "0:ART" 0x0)"
-       fi
+       ucidef_set_interface_macaddr "lan" "$(mtd_get_mac_binary "0:art" 0x6)"
+       ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary "0:art" 0x0)"
        ;;
 linksys,ea7500-v1)
        hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
@@ -81,9 +75,6 @@ ubnt,unifi-ac-hd)
        ;;
 zyxel,nbg6817)
        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 2746ef1e2a70052df8bf32dd1fe77daf08ba5303..c8924df92f6cfa6f4a5f6c5fab0b3d21aeca508b 100644 (file)
@@ -13,23 +13,13 @@ case "$FIRMWARE" in
                caldata_extract "0:ART" 0x1000 0x2f20
                ;;
        asrock,g10)
-               if [ -b "$(find_mtd_part 0:art)" ]; then
-                       caldata_extract "0:art" 0x1000 0x2f20
-               else
-                       # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
-                       caldata_extract "0:ART" 0x1000 0x2f20
-               fi
+               caldata_extract "0:art" 0x1000 0x2f20
                ;;
        buffalo,wxr-2533dhp)
                caldata_extract "ART" 0x1000 0x2f20
                ;;
        edgecore,ecw5410)
-               if [ -b "$(find_mtd_part 0:art)" ]; then
-                       caldata_extract "0:art" 0x1000 0x2f20
-               else
-                       # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
-                       caldata_extract "0:ART" 0x1000 0x2f20
-               fi
+               caldata_extract "0:art" 0x1000 0x2f20
                ;;
        linksys,ea7500-v1 |\
        linksys,ea8500)
@@ -56,14 +46,8 @@ case "$FIRMWARE" in
                caldata_extract "ART" 0x1000 0x2f20
                ;;
        zyxel,nbg6817)
-               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
+               caldata_extract "0:art" 0x1000 0x2f20
+               ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) 1)
                ;;
        esac
        ;;
@@ -73,12 +57,7 @@ case "$FIRMWARE" in
                caldata_extract "0:ART" 0x5000 0x2f20
                ;;
        asrock,g10)
-               if [ -b "$(find_mtd_part 0:art)" ]; then
-                       caldata_extract "0:art" 0x5000 0x2f20
-               else
-                       # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
-                       caldata_extract "0:ART" 0x5000 0x2f20
-               fi
+               caldata_extract "0:art" 0x5000 0x2f20
                ;;
        buffalo,wxr-2533dhp)
                caldata_extract "ART" 0x5000 0x2f20
@@ -108,26 +87,15 @@ case "$FIRMWARE" in
                caldata_extract "ART" 0x5000 0x2f20
                ;;
        zyxel,nbg6817)
-               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
+               caldata_extract "0:art" 0x5000 0x2f20
+               ath10k_patch_mac $(mtd_get_mac_ascii 0:appsblenv ethaddr)
                ;;
        esac
        ;;
 "ath10k/pre-cal-pci-0002:01:00.0.bin")
        case $board in
        edgecore,ecw5410)
-               if [ -b "$(find_mtd_part 0:art)" ]; then
-                       caldata_extract "0:art" 0x5000 0x2f20
-               else
-                       # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
-                       caldata_extract "0:ART" 0x5000 0x2f20
-               fi
+               caldata_extract "0:art" 0x5000 0x2f20
                ;;
        esac
        ;;
index 8be737d2dad915bb5b1f5502de6e05b9fb5b91e8..9645b646710718c51bc14f586ad99dd359420bb2 100644 (file)
@@ -2,8 +2,6 @@
 
 asrock_bootconfig_mangle() {
        local mtdnum="$(find_mtd_index 0:bootconfig)"
-       # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
-       [ -n "$mtdnum" ] || mtdnum="$(find_mtd_index 0:BOOTCONFIG)"
 
        if [ -z "$mtdnum" ]; then
                echo "cannot find bootconfig mtd partition"
index 50f8a3ceaf3687682d04dec2ddacde882050c74c..f5501822f3476bb3a4b30d8e1d6af44fc4e371ec 100644 (file)
@@ -91,9 +91,6 @@ zyxel_do_upgrade() {
        case "$board" in
        zyxel,nbg6817)
                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