ipq806x: g10: case-insensitive qcom-smem partitions
authorStefan Lippers-Hollmann <s.l-h@gmx.de>
Thu, 6 May 2021 23:00:58 +0000 (01:00 +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/hotplug.d/firmware/11-ath10k-caldata
target/linux/ipq806x/base-files/lib/upgrade/asrock.sh

index a05bd99bc716c9cca83db6e1f3c011b6e9cab48f..3dd7a51d5d0b63166410c5baae675d57e15102ef 100644 (file)
@@ -10,7 +10,12 @@ case "$FIRMWARE" in
 "ath10k/pre-cal-pci-0000:01:00.0.bin")
        case $board in
        asrock,g10)
-               caldata_extract "0:ART" 0x1000 0x2f20
+               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
                ;;
        buffalo,wxr-2533dhp)
                caldata_extract "ART" 0x1000 0x2f20
@@ -59,7 +64,12 @@ case "$FIRMWARE" in
 "ath10k/pre-cal-pci-0001:01:00.0.bin")
        case $board in
        asrock,g10)
-               caldata_extract "0:ART" 0x5000 0x2f20
+               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
                ;;
        buffalo,wxr-2533dhp)
                caldata_extract "ART" 0x5000 0x2f20
index 9e1376a5788894ee0a0443bde392e11cca09c5fd..8be737d2dad915bb5b1f5502de6e05b9fb5b91e8 100644 (file)
@@ -1,7 +1,9 @@
 . /lib/functions.sh
 
 asrock_bootconfig_mangle() {
-       local mtdnum="$( find_mtd_index 0:BOOTCONFIG )"
+       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"