aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79/mikrotik/base-files/etc/hotplug.d
diff options
context:
space:
mode:
authorRoger Pueyo Centelles <roger.pueyo@guifi.net>2020-02-28 16:01:02 +0100
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-03-17 11:50:47 +0100
commita66eee63368eb5625b359244bfffc9b9eb921875 (patch)
tree6a76e6a9d54527f8a41b41fa80fbc40d30a240ee /target/linux/ath79/mikrotik/base-files/etc/hotplug.d
parentb78f61c336542a3658c3b1c595b3bb2810f93500 (diff)
downloadupstream-a66eee63368eb5625b359244bfffc9b9eb921875.tar.gz
upstream-a66eee63368eb5625b359244bfffc9b9eb921875.tar.bz2
upstream-a66eee63368eb5625b359244bfffc9b9eb921875.zip
ath79: add mikrotik subtarget
This commit creates the ath79/mikrotik subtarget in order to support MikroTik devices based on Qualcomm Atheros MIPS SoCs. MikroTik devices need a couple of specific features: the split MiNOR firmware MTD format, which is not used by other devices, and the 4k sector erase size on SPI NOR storage, which can not be added to the ath79/generic and ath79/nand subtargets now. Additionally, the commit moves the two MikroTik devices already in the generic and nand subtargets to this new one. Tested on the RB922 board and the wAP AC router. Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Diffstat (limited to 'target/linux/ath79/mikrotik/base-files/etc/hotplug.d')
-rw-r--r--target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom22
-rw-r--r--target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/11-ath10k-caldata28
2 files changed, 50 insertions, 0 deletions
diff --git a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
new file mode 100644
index 0000000000..f5f88484b5
--- /dev/null
+++ b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/functions/caldata.sh
+. /lib/functions/mikrotik-caldata.sh
+
+board=$(board_name)
+
+case "$FIRMWARE" in
+"ath9k-eeprom-ahb-18100000.wmac.bin")
+ case $board in
+ mikrotik,routerboard-wap-g-5hact2hnd)
+ mikrotik_caldata_extract "art" 0x1000 0x440
+ ath9k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x10) +2)
+ ;;
+ *)
+ caldata_die "board $board is not supported yet"
+ ;;
+ esac
+ ;;
+esac
diff --git a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
new file mode 100644
index 0000000000..6eb9a93b75
--- /dev/null
+++ b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/functions/caldata.sh
+. /lib/functions/mikrotik-caldata.sh
+
+board=$(board_name)
+
+case "$FIRMWARE" in
+"ath10k/cal-pci-0000:00:00.0.bin")
+ case $board in
+ mikrotik,routerboard-wap-g-5hact2hnd)
+ mikrotik_caldata_extract "art" 0x5000 0x844
+ ;;
+ esac
+ ;;
+"ath10k/cal-pci-0000:01:00.0.bin")
+ case $board in
+ mikrotik,routerboard-922uags-5hpacd)
+ mikrotik_caldata_extract "art" 0x5000 0x844
+ ;;
+ esac
+ ;;
+*)
+ exit 1
+ ;;
+esac