aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq40xx/base-files
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ipq40xx/base-files')
-rwxr-xr-xtarget/linux/ipq40xx/base-files/etc/board.d/01_leds7
-rwxr-xr-xtarget/linux/ipq40xx/base-files/etc/board.d/02_network10
-rw-r--r--target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata26
-rw-r--r--target/linux/ipq40xx/base-files/lib/upgrade/platform.sh35
4 files changed, 78 insertions, 0 deletions
diff --git a/target/linux/ipq40xx/base-files/etc/board.d/01_leds b/target/linux/ipq40xx/base-files/etc/board.d/01_leds
index 31c6e32a06..6a493be3ec 100755
--- a/target/linux/ipq40xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ipq40xx/base-files/etc/board.d/01_leds
@@ -11,6 +11,13 @@ board=$(board_name)
boardname="${board##*,}"
case "$board" in
+asus,rt-ac58u)
+ ucidef_set_led_wlan "wlan2g" "WLAN2G" "${boardname}:blue:wlan2G" "phy0tpt"
+ ucidef_set_led_wlan "wlan5g" "WLAN5G" "${boardname}:blue:wlan5G" "phy1tpt"
+ ucidef_set_led_usbport "usb" "USB" "${boardname}:blue:usb" "usb1-port1" "usb2-port1" "usb3-port1" "usb4-port1"
+ ucidef_set_led_netdev "wan" "WAN" "${boardname}:blue:wan" "eth1"
+ ucidef_set_led_switch "lan" "LAN" "${boardname}:blue:lan" "switch0" "0x1e"
+ ;;
avm,fritzbox-4040)
ucidef_set_led_wlan "wlan" "WLAN" "fritz4040:green:wlan" "phy0tpt" "phy1tpt"
ucidef_set_led_netdev "wan" "WAN" "fritz4040:green:wan" "eth1"
diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network
index 7c83e2e754..8f8d67db32 100755
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -12,6 +12,16 @@ board_config_update
board=$(board_name)
case "$board" in
+asus,rt-ac58u)
+ CI_UBIPART=UBI_DEV
+ wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 20486)
+ lan_mac_addr=$(mtd_get_mac_binary_ubi Factory 4102)
+ ucidef_set_interfaces_lan_wan "eth0" "eth1"
+ ucidef_add_switch "switch0" \
+ "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
+ ucidef_set_interface_macaddr "lan" "$lan_mac_addr"
+ ucidef_set_interface_macaddr "wan" "$wan_mac_addr"
+ ;;
avm,fritzbox-4040)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 33ea9b426c..bc64d5b8ab 100644
--- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -19,6 +19,24 @@ ath10kcal_extract() {
ath10kcal_die "failed to extract calibration data from $mtd"
}
+ath10kcal_ubi_extract() {
+ local part=$1
+ local offset=$2
+ local count=$3
+ local ubidev
+ local ubi
+
+ . /lib/upgrade/nand.sh
+
+ ubidev=$(nand_find_ubi $CI_UBIPART)
+ ubi=$(nand_find_volume $ubidev $part)
+ [ -n "$ubi" ] || \
+ ath10kcal_die "no UBI volume found for $part"
+
+ dd if=/dev/$ubi of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
+ ath10kcal_die "failed to extract from $ubi"
+}
+
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions.sh
@@ -30,6 +48,10 @@ board=$(board_name)
case "$FIRMWARE" in
"ath10k/pre-cal-ahb-a000000.wifi.bin")
case "$board" in
+ asus,rt-ac58u)
+ CI_UBIPART=UBI_DEV
+ ath10kcal_ubi_extract "Factory" 4096 12064
+ ;;
avm,fritzbox-4040)
/usr/bin/fritz_cal_extract -i 1 -s 0x400 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader_config")
;;
@@ -44,6 +66,10 @@ case "$FIRMWARE" in
;;
"ath10k/pre-cal-ahb-a800000.wifi.bin")
case "$board" in
+ asus,rt-ac58u)
+ CI_UBIPART=UBI_DEV
+ ath10kcal_ubi_extract "Factory" 20480 12064
+ ;;
avm,fritzbox-4040)
/usr/bin/fritz_cal_extract -i 1 -s 0x400 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader_config")
;;
diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
index defa04d880..261c468813 100644
--- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
@@ -5,11 +5,37 @@ RAMFS_COPY_BIN='fw_printenv fw_setenv'
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
platform_check_image() {
+ case "$(board_name)" in
+ asus,rt-ac58u)
+ CI_UBIPART="UBI_DEV"
+ local ubidev=$(nand_find_ubi $CI_UBIPART)
+ local asus_root=$(nand_find_volume $ubidev jffs2)
+
+ [ -n "$asus_root" ] || return 0
+
+ cat << EOF
+jffs2 partition is still present.
+There's probably no space left
+to install the filesystem.
+
+You need to delete the jffs2 partition first:
+# ubirmvol /dev/ubi0 --name=jffs2
+
+Once this is done. Retry.
+EOF
+ return 1
+ ;;
+ esac
return 0;
}
platform_do_upgrade() {
case "$(board_name)" in
+ asus,rt-ac58u)
+ CI_UBIPART="UBI_DEV"
+ CI_KERNPART="linux"
+ nand_do_upgrade "$1"
+ ;;
openmesh,a42)
PART_NAME="inactive"
platform_do_upgrade_openmesh "$ARGV"
@@ -20,6 +46,15 @@ platform_do_upgrade() {
esac
}
+platform_nand_pre_upgrade() {
+ case "$(board_name)" in
+ asus,rt-ac58u)
+ CI_UBIPART="UBI_DEV"
+ CI_KERNPART="linux"
+ ;;
+ esac
+}
+
blink_led() {
. /etc/diag.sh; set_state upgrade
}