summaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/mt7621/base-files
diff options
context:
space:
mode:
authorArne Zachlod <arne@nerdkeller.org>2022-08-06 15:35:15 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2022-11-12 18:15:55 +0100
commitffa4b5283b390099a207dcd22c6e9b0b528ac1e4 (patch)
treee24c5e59321cfc36ae2fa8756232ed18318f4313 /target/linux/ramips/mt7621/base-files
parent5a1af6ed621d4547d8bf486d0d3e4de5443b9b58 (diff)
downloadopenwrt-ffa4b5283b390099a207dcd22c6e9b0b528ac1e4.tar.gz
openwrt-ffa4b5283b390099a207dcd22c6e9b0b528ac1e4.tar.bz2
openwrt-ffa4b5283b390099a207dcd22c6e9b0b528ac1e4.zip
ramips: add support for Mikrotik LtAP-2HnD
Mikrotik LtAP-2HnD is a outdoor/automotive WLAN 4 router with integrated GPS receiver and two mPCIe slots. Specifications: * SoC: MT7621A * RAM: 128 MiB Nanya NT5CC64M16GP-DI * Flash: 16 MiB winbond W25Q128JV * WLAN: * Atheros AR9382 with power amplifier SKY 85330 (2x2 internal antennas, with RF switches for external connectors) * Ethernet: 1 Gbps, single port * USB Host: USB 2.0 Speeds * Serial: 115200 baud * LEDs: Power, System, GPS, 5* RSSI * mPCIe: * miniPCIe slot 1: PCIe and USB 2.0 Host (via switch shared with USB Host) * miniPCIe slot 2: USB 2.0 and 3.0 * SIM Cards: * Slot 1 Connected to mPCIe slot 1 * Slot 2 and 3 connected to mPCIe slot 2 via switch * GPS: MTK 3333 on serial port 2 (/dev/ttyS1), 115200 baud and PPS on gpio 14 gpios are exposed to /sys/class/gpio: * usb-select: swithes USB 2.0 interface between external port and internal mPCIe slot 1 default is the external USB interface * gps-reset: resets the GPS interface chip * sim-select: switches between sim slot 2 and 3 connected to mPCIe slot 2 * gps-ant-select: switches GPS antenna between internal antenna and SMA connected antenna * lte-reset: resets mPCIe slot 2 Flashing: TFTP boot initramfs image and then perform sysupgrade. Follow common MikroTik procedure as in https://openwrt.org/toh/mikrotik/common. Signed-off-by: Arne Zachlod <arne@nerdkeller.org>
Diffstat (limited to 'target/linux/ramips/mt7621/base-files')
-rw-r--r--target/linux/ramips/mt7621/base-files/etc/board.d/01_leds1
-rw-r--r--target/linux/ramips/mt7621/base-files/etc/board.d/02_network4
-rw-r--r--target/linux/ramips/mt7621/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom33
-rwxr-xr-xtarget/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh1
4 files changed, 39 insertions, 0 deletions
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
index 9cf83c357c..a3c233a20f 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
@@ -95,6 +95,7 @@ linksys,ea8100-v2)
mikrotik,routerboard-760igs)
ucidef_set_led_netdev "sfp" "SFP" "blue:sfp" "sfp"
;;
+mikrotik,ltap-2hnd|\
mikrotik,routerboard-m11g)
ucidef_set_rssimon "wlan0" "200000" "1"
ucidef_set_led_rssi "rssilow" "RSSILOW" "green:rssi0" "wlan0" "1" "100"
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index bfc654a23a..cef5d55925 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -12,6 +12,7 @@ ramips_setup_interfaces()
asus,rp-ac56|\
asus,rp-ac87|\
edimax,re23s|\
+ mikrotik,ltap-2hnd|\
mikrotik,routerboard-m11g|\
netgear,ex6150|\
sercomm,na502|\
@@ -218,6 +219,9 @@ ramips_setup_macs()
lan_mac=$(mtd_get_mac_ascii Config lan_hwaddr)
wan_mac=$(mtd_get_mac_ascii Config wan_hwaddr)
label_mac=$lan_mac
+ mikrotik,ltap-2hnd)
+ label_mac=$(cat "/sys/firmware/mikrotik/hard_config/mac_base")
+ lan_mac=$label_mac
;;
tplink,mr600-v2-eu)
label_mac=$(cat "/sys/class/net/eth0/address")
diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
new file mode 100644
index 0000000000..0bf5e85cd0
--- /dev/null
+++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/functions/caldata.sh
+
+caldata_mikrotik_ath9k() {
+ local offset=$(($1))
+ local count=$(($2))
+ local macaddr=$3
+ local wlan_data="/sys/firmware/mikrotik/hard_config/wlan_data"
+
+ caldata_from_file $wlan_data $offset $count /tmp/$FIRMWARE
+ ath9k_patch_mac "$macaddr" /tmp/$FIRMWARE
+ caldata_sysfsload_from_file /tmp/$FIRMWARE 0x0 $count
+ rm -f /tmp/$FIRMWARE
+}
+
+board=$(board_name)
+
+case "$FIRMWARE" in
+"ath9k-eeprom-pci-0000:01:00.0.bin")
+ case $board in
+ mikrotik,ltap-2hnd)
+ mac_base="$(cat /sys/firmware/mikrotik/hard_config/mac_base)"
+ caldata_mikrotik_ath9k 0x5000 0x440 $(macaddr_add "$mac_base" 1)
+ ;;
+ *)
+ caldata_die "board $board is not supported yet"
+ ;;
+ esac
+ ;;
+esac
diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
index ebe4c638be..d380ea66f7 100755
--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
@@ -33,6 +33,7 @@ platform_do_upgrade() {
fw_setenv --lock / bootImage 0 || exit 1
fi
;;
+ mikrotik,ltap-2hnd|\
mikrotik,routerboard-750gr3|\
mikrotik,routerboard-760igs|\
mikrotik,routerboard-m11g|\