mpc85xx: move specific base-files into p1010 subtarget
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Thu, 13 Aug 2020 18:18:34 +0000 (20:18 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Mon, 25 Jan 2021 17:53:29 +0000 (18:53 +0100)
This moves the specific base-files for TL-WDR4900 v1 into the p1010
subtarget.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom [deleted file]
target/linux/mpc85xx/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate [deleted file]
target/linux/mpc85xx/p1010/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom [new file with mode: 0644]
target/linux/mpc85xx/p1010/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate [new file with mode: 0644]

diff --git a/target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
deleted file mode 100644 (file)
index be6ee40..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-[ -e /lib/firmware/$FIRMWARE ] && exit 0
-
-. /lib/functions/caldata.sh
-
-board=$(board_name)
-
-case "$FIRMWARE" in
-"pci_wmac0.eeprom")
-       case $board in
-       tplink,tl-wdr4900-v1)
-               caldata_extract "caldata" 0x1000 0x800
-               ath9k_patch_mac $(mtd_get_mac_binary u-boot 0x4fc00)
-               ;;
-       *)
-               caldata_die "board $board is not supported yet"
-               ;;
-       esac
-       ;;
-
-"pci_wmac1.eeprom")
-       case $board in
-       tplink,tl-wdr4900-v1)
-               caldata_extract "caldata" 0x5000 0x800
-               ath9k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x4fc00) -1)
-               ;;
-       *)
-               caldata_die "board $board is not supported yet"
-               ;;
-       esac
-       ;;
-esac
diff --git a/target/linux/mpc85xx/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate b/target/linux/mpc85xx/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate
deleted file mode 100644 (file)
index 49dde05..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/sh
-
-# This must run before 10-wifi-detect
-
-
-[ "${ACTION}" = "add" ] || return
-
-
-. /lib/functions.sh
-
-
-check_radio()
-{
-       local cfg="$1" to="$2"
-
-       config_get path "$cfg" path
-
-       [ "$path" = "$to" ] && PATH_EXISTS=true
-}
-
-do_migrate_radio()
-{
-       local cfg="$1" from="$2" to="$3"
-
-       config_get path "$cfg" path
-
-       [ "$path" = "$from" ] || return
-
-       uci set "wireless.${cfg}.path=${to}"
-       WIRELESS_CHANGED=true
-
-       logger -t wifi-migrate "Updated path of wireless.${cfg} from '${from}' to '${to}'"
-}
-
-migrate_radio()
-{
-       local from="$1" to="$2"
-
-       config_load wireless
-
-       # Check if there is already a section with the target path: In this case, the system
-       # was already upgraded to a version without this migration script before; better bail out,
-       # as we can't be sure we don't break more than we fix.
-       PATH_EXISTS=false
-       config_foreach check_radio wifi-device "$to"
-       $PATH_EXISTS && return
-
-       config_foreach do_migrate_radio wifi-device "$from" "$to"
-}
-
-
-WIRELESS_CHANGED=false
-
-case "$(board_name)" in
-tplink,tl-wdr4900-v1)
-       migrate_radio 'ffe09000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0' 'ffe09000.pcie/pci9000:00/9000:00:00.0/9000:01:00.0'
-       migrate_radio 'ffe0a000.pcie/pci0001:02/0001:02:00.0/0001:03:00.0' 'ffe0a000.pcie/pcia000:02/a000:02:00.0/a000:03:00.0'
-       ;;
-esac
-
-$WIRELESS_CHANGED && uci commit wireless
-
-exit 0
diff --git a/target/linux/mpc85xx/p1010/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/mpc85xx/p1010/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
new file mode 100644 (file)
index 0000000..be6ee40
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/functions/caldata.sh
+
+board=$(board_name)
+
+case "$FIRMWARE" in
+"pci_wmac0.eeprom")
+       case $board in
+       tplink,tl-wdr4900-v1)
+               caldata_extract "caldata" 0x1000 0x800
+               ath9k_patch_mac $(mtd_get_mac_binary u-boot 0x4fc00)
+               ;;
+       *)
+               caldata_die "board $board is not supported yet"
+               ;;
+       esac
+       ;;
+
+"pci_wmac1.eeprom")
+       case $board in
+       tplink,tl-wdr4900-v1)
+               caldata_extract "caldata" 0x5000 0x800
+               ath9k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x4fc00) -1)
+               ;;
+       *)
+               caldata_die "board $board is not supported yet"
+               ;;
+       esac
+       ;;
+esac
diff --git a/target/linux/mpc85xx/p1010/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate b/target/linux/mpc85xx/p1010/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate
new file mode 100644 (file)
index 0000000..49dde05
--- /dev/null
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+# This must run before 10-wifi-detect
+
+
+[ "${ACTION}" = "add" ] || return
+
+
+. /lib/functions.sh
+
+
+check_radio()
+{
+       local cfg="$1" to="$2"
+
+       config_get path "$cfg" path
+
+       [ "$path" = "$to" ] && PATH_EXISTS=true
+}
+
+do_migrate_radio()
+{
+       local cfg="$1" from="$2" to="$3"
+
+       config_get path "$cfg" path
+
+       [ "$path" = "$from" ] || return
+
+       uci set "wireless.${cfg}.path=${to}"
+       WIRELESS_CHANGED=true
+
+       logger -t wifi-migrate "Updated path of wireless.${cfg} from '${from}' to '${to}'"
+}
+
+migrate_radio()
+{
+       local from="$1" to="$2"
+
+       config_load wireless
+
+       # Check if there is already a section with the target path: In this case, the system
+       # was already upgraded to a version without this migration script before; better bail out,
+       # as we can't be sure we don't break more than we fix.
+       PATH_EXISTS=false
+       config_foreach check_radio wifi-device "$to"
+       $PATH_EXISTS && return
+
+       config_foreach do_migrate_radio wifi-device "$from" "$to"
+}
+
+
+WIRELESS_CHANGED=false
+
+case "$(board_name)" in
+tplink,tl-wdr4900-v1)
+       migrate_radio 'ffe09000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0' 'ffe09000.pcie/pci9000:00/9000:00:00.0/9000:01:00.0'
+       migrate_radio 'ffe0a000.pcie/pci0001:02/0001:02:00.0/0001:03:00.0' 'ffe0a000.pcie/pcia000:02/a000:02:00.0/a000:03:00.0'
+       ;;
+esac
+
+$WIRELESS_CHANGED && uci commit wireless
+
+exit 0