aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79/generic/base-files
diff options
context:
space:
mode:
authorWenli Looi <wlooi@ucalgary.ca>2022-11-22 18:34:37 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2023-01-25 00:42:52 +0100
commitf0eb73a888e2ed980b0943d4a2e4d19ad0af183a (patch)
tree6274bf1941220e5f2415cdb78122f6b62f866afb /target/linux/ath79/generic/base-files
parentf0e4595188db797446f7b3d29a6162ede90586a6 (diff)
downloadupstream-f0eb73a888e2ed980b0943d4a2e4d19ad0af183a.tar.gz
upstream-f0eb73a888e2ed980b0943d4a2e4d19ad0af183a.tar.bz2
upstream-f0eb73a888e2ed980b0943d4a2e4d19ad0af183a.zip
ath79: consolidate Netgear EX7300 series images
This change consolidates Netgear EX7300 series devices into two images corresponding to devices that share the same manufacturer firmware image. Similar to the manufacturer firmware, the actual device model is detected at runtime. The logic is taken from the netgear GPL dumps in a file called generate_board_conf.sh. Hardware details for EX7300 v2 variants --------------------------------------- SoC: QCN5502 Flash: 16 MiB RAM: 128 MiB Ethernet: 1 gigabit port Wireless 2.4GHz (currently unsupported due to lack of ath9k support): - EX6250 / EX6400 v2 / EX6410 / EX6420: QCN5502 3x3 - EX7300 v2 / EX7320: QCN5502 4x4 Wireless 5GHz: - EX6250: QCA9986 3x3 (detected by ath10k as QCA9984 3x3) - EX6400 v2 / EX6410 / EX6420 / EX7300 v2 / EX7320: QCA9984 4x4 Signed-off-by: Wenli Looi <wlooi@ucalgary.ca>
Diffstat (limited to 'target/linux/ath79/generic/base-files')
-rw-r--r--target/linux/ath79/generic/base-files/etc/board.d/02_network1
-rw-r--r--target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata1
-rw-r--r--target/linux/ath79/generic/base-files/lib/preinit/02_sysinfo_fixup42
3 files changed, 42 insertions, 2 deletions
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index 8b0fba7c69..20352095a4 100644
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -50,7 +50,6 @@ ath79_setup_interfaces()
glinet,gl-usb150|\
hak5,wifi-pineapple-nano|\
meraki,mr16|\
- netgear,ex6400|\
netgear,ex7300|\
netgear,ex7300-v2|\
netgear,wndap360|\
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 74e6738162..b4a2209fdf 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -216,7 +216,6 @@ case "$FIRMWARE" in
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
;;
- netgear,ex6400|\
netgear,ex7300)
caldata_extract "caldata" 0x5000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary caldata 0xc)
diff --git a/target/linux/ath79/generic/base-files/lib/preinit/02_sysinfo_fixup b/target/linux/ath79/generic/base-files/lib/preinit/02_sysinfo_fixup
new file mode 100644
index 0000000000..e01469f0d9
--- /dev/null
+++ b/target/linux/ath79/generic/base-files/lib/preinit/02_sysinfo_fixup
@@ -0,0 +1,42 @@
+. /lib/functions.sh
+
+do_sysinfo_ath79_fixup() {
+ local model=""
+
+ case $(board_name) in
+ netgear,ex7300)
+ local part=$(find_mtd_part caldata)
+ local board_hw_id=$(dd if=$part bs=1 skip=67 count=10 2>/dev/null)
+ case "$board_hw_id" in
+ 5508013406)
+ model="Netgear EX6400"
+ ;;
+ 5508013271)
+ model="Netgear EX7300"
+ ;;
+ esac
+ ;;
+ netgear,ex7300-v2)
+ local part=$(find_mtd_part artmtd)
+ local antenna_cfg=$(dd if=$part bs=1 skip=59 count=7 2>/dev/null)
+ local board_hw_id=$(dd if=$part bs=1 skip=67 count=6 2>/dev/null)
+ case "$antenna_cfg" in
+ 3X3+3X3)
+ model="Netgear EX6250"
+ ;;
+ 3X3+4X4)
+ # EX6400 v2, EX6410, EX6420
+ model="Netgear ${board_hw_id:-EX6400 v2}"
+ ;;
+ 4X4+4X4)
+ # EX7300 v2, EX7320
+ model="Netgear ${board_hw_id:-EX7300 v2}"
+ ;;
+ esac
+ ;;
+ esac
+
+ [ -n "$model" ] && echo "$model" > /tmp/sysinfo/model
+}
+
+boot_hook_add preinit_main do_sysinfo_ath79_fixup