From 62a19a239e94f8fd9b04c7f4c8aaed12f81ccfab Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Wed, 17 May 2023 20:52:51 -0700 Subject: [PATCH] Support for Mikrotik LDF 5AC (#841) --- SUPPORTED_DEVICES.md | 1 + configs/ipq40xx-mikrotik.config | 1 + files/etc/radios.json | 3 ++ files/etc/uci-defaults/11_compat_version | 1 + patches/747-mikrotik-extra-support.patch | 36 ++++++++++++++++++++---- 5 files changed, 36 insertions(+), 6 deletions(-) diff --git a/SUPPORTED_DEVICES.md b/SUPPORTED_DEVICES.md index 8b422510..8a23e705 100644 --- a/SUPPORTED_DEVICES.md +++ b/SUPPORTED_DEVICES.md @@ -19,6 +19,7 @@ LHG 5 ac | RBLHGG-5acD | 5 | ipq40xx | mikrotik | mikrotik_lhgg-5acd | 256MB | s LHG XL 5 ac | RBLHGG-5acD-XL | 5 | ipq40xx | mikrotik | mikrotik_lhgg-5acd-xl | 256MB | stable | released LDF 2 | RBLDF-2nD | 2 | ath79 | mikrotik | mikrotik-ldf-2nd | 64MB | stable | nightly LDF 5 | RBLDF-5nD | 5 | ath79 | mikrotik | mikrotik-ldf-5nd | 64MB | stable | released +LDF 5 ac | RBLDFG-5acD | 5 | ipq40xx | mikrotik | mikrotik-ldf-5acd | 64MB | stable | nightly RB911G-2HPnD
mANTBox 2 12s | RB911G-2HPnD
RB911G-2HPnD-12S | 2 | ath79 | mikrotik | - | 64MB | unknown | released RB911G-5HPnD | RB911G-5HPnD | 5 | ath79 | mikrotik | - | 64MB | unknown | released QRT 5 | RB911G-5HPnD-QRT | 5 | ath79 | mikrotik | mikrotik-911g-5hpnd-qrt | 64MB | stable | danger-upgrade diff --git a/configs/ipq40xx-mikrotik.config b/configs/ipq40xx-mikrotik.config index a76f010d..1f0774f7 100644 --- a/configs/ipq40xx-mikrotik.config +++ b/configs/ipq40xx-mikrotik.config @@ -5,6 +5,7 @@ CONFIG_TARGET_DEVICE_ipq40xx_mikrotik_DEVICE_mikrotik_hap-ac3=y CONFIG_TARGET_DEVICE_ipq40xx_mikrotik_DEVICE_mikrotik_lhgg-5acd=y CONFIG_TARGET_DEVICE_ipq40xx_mikrotik_DEVICE_mikrotik_lhgg-5acd-xl=y CONFIG_TARGET_DEVICE_ipq40xx_mikrotik_DEVICE_mikrotik_sxtsq-5-ac=y +CONFIG_TARGET_DEVICE_ipq40xx_mikrotik_DEVICE_mikrotik_ldf-5acd=y # # Mikrotik use initramfs to install diff --git a/files/etc/radios.json b/files/etc/radios.json index 193e8888..2ff7f412 100644 --- a/files/etc/radios.json +++ b/files/etc/radios.json @@ -146,6 +146,9 @@ "MikroTik RouterBOARD LDF 2nD" : { "maxpower" : "28" }, + "MikroTik LDF 5 ac (RBLDFG-5acD)": { + "maxpower" : "25" + }, "MikroTik RouterBOARD RBLDF-5nD" : { "maxpower" : "25" }, diff --git a/files/etc/uci-defaults/11_compat_version b/files/etc/uci-defaults/11_compat_version index 74581ce7..ad2ed533 100644 --- a/files/etc/uci-defaults/11_compat_version +++ b/files/etc/uci-defaults/11_compat_version @@ -3,6 +3,7 @@ case "$(/usr/local/bin/get_boardid)" in MikroTik\ hAP\ ac2|\ MikroTik\ hAP\ ac3|\ MikroTik\ SXTsq\ 5\ ac*|\ + MikroTik\ LDF\ 5\ ac*|\ MikroTik\ LHG\ 5\ ac*) sed -i "s/^compat_version = 1.0/compat_version = 1.1/" /etc/config.mesh/_setup sed -i "s/^compat_version = 1.0/compat_version = 1.1/" /etc/config.mesh/_setup.default diff --git a/patches/747-mikrotik-extra-support.patch b/patches/747-mikrotik-extra-support.patch index f26e1867..dd259f4a 100644 --- a/patches/747-mikrotik-extra-support.patch +++ b/patches/747-mikrotik-extra-support.patch @@ -237,11 +237,19 @@ +}; --- a/target/linux/ipq40xx/image/mikrotik.mk +++ b/target/linux/ipq40xx/image/mikrotik.mk -@@ -62,3 +62,19 @@ +@@ -62,3 +62,27 @@ DEVICE_PACKAGES := rssileds endef TARGET_DEVICES += mikrotik_sxtsq-5-ac + ++define Device/mikrotik_ldf-5acd ++ $(call Device/mikrotik_nor) ++ DEVICE_MODEL := RouterBOARD LDF 5 AC (RBLDFG-5acD) ++ SOC := qcom-ipq4018 ++ DEVICE_PACKAGES := rssileds ++endef ++TARGET_DEVICES += mikrotik_ldf-5acd ++ +define Device/mikrotik_lhgg-5acd + $(call Device/mikrotik_nor) + DEVICE_MODEL := RouterBOARD LHG 5 AC @@ -259,19 +267,21 @@ +TARGET_DEVICES += mikrotik_lhgg-5acd-xl --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network -@@ -35,6 +35,7 @@ +@@ -35,6 +35,8 @@ zyxel,wre6606) ucidef_set_interface_lan "eth0" ;; + mikrotik,lhgg-5acd*|\ ++ mikrotik,ldf-5acd|\ mikrotik,sxtsq-5-ac) ucidef_set_interfaces_lan_wan "lan" "lan.1" ucidef_set_interface "wifi" device "wlan0" protocol "static" -@@ -216,6 +217,7 @@ +@@ -216,6 +217,8 @@ label_mac="$wan_mac" ;; mikrotik,lhgg-60ad|\ + mikrotik,lhgg-5acd*|\ ++ mikrotik,ldf-5acd|\ mikrotik,sxtsq-5-ac) lan_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base) label_mac="$lan_mac" @@ -528,31 +538,45 @@ + compatible = "mikrotik,lhgg-5acd-xl"; + model = "MikroTik LHG 5 ac XL (RBLHGG-5acD-XL)"; +}; +--- /dev/null ++++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ldf-5acd.dts +@@ -0,0 +1,8 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++ ++#include "qcom-ipq4018-sxtsq-5-ac.dts" ++ ++/ { ++ compatible = "mikrotik,ldf-5acd"; ++ model = "MikroTik LDF 5 ac (RBLDFG-5acD)"; ++}; --- 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 -@@ -197,6 +197,7 @@ +@@ -197,6 +197,8 @@ mikrotik,cap-ac |\ mikrotik,hap-ac2 |\ mikrotik,hap-ac3 |\ + mikrotik,lhgg-5acd* |\ ++ mikrotik,ldf-5acd |\ mikrotik,sxtsq-5-ac) wlan_data="/sys/firmware/mikrotik/hard_config/wlan_data" ( [ -f "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data" 0x8000 0x2f20 ) || \ -@@ -236,6 +237,7 @@ +@@ -236,6 +237,8 @@ mikrotik,cap-ac |\ mikrotik,hap-ac2 |\ mikrotik,hap-ac3 |\ + mikrotik,lhgg-5acd* |\ ++ mikrotik,ldf-5acd |\ mikrotik,sxtsq-5-ac) wlan_data="/sys/firmware/mikrotik/hard_config/wlan_data" ( [ -f "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data" 0xaf20 0x2f20 ) || \ --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh -@@ -163,12 +163,13 @@ +@@ -163,12 +163,14 @@ ;; mikrotik,cap-ac|\ mikrotik,hap-ac2|\ + mikrotik,lhgg-5acd*|\ ++ mikrotik,ldf-5acd|\ mikrotik,lhgg-60ad|\ mikrotik,sxtsq-5-ac) [ "$(rootfs_type)" = "tmpfs" ] && mtd erase firmware