diff mbox series

[v2,3/3] ath79: add support for MikroTik RouterBOARD 911 Lite2/Lite5

Message ID 20220720203152.313400-3-tmn505@terefe.re
State Superseded
Headers show
Series [v2,1/3] ath79: mikrotik: stack ar9344 devices to single dtsi | expand

Commit Message

Tomasz Maciej Nowak July 20, 2022, 8:31 p.m. UTC
From: Tomasz Maciej Nowak <tmn505@gmail.com>

Forward-port from ar71xx target the board introduced in commit
eb9e3651dd1a (" ar71xx: add support for the MikroTik RB911-2Hn/5Hn
boards"). Follow intallation instruction from that commit message, using
images found in ath79 directory. Be advised that the board accepts
10-30 V on PoE input.

Known issues
Compared to ar71xx target image, there is still small leak of current to
user LED, which makes it lit, although weaker, even if brightness is set
to 0. The cause of that is still unknown.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
---
v1 -> v2
- rebase

 .../ar9344_mikrotik_routerboard-911-lite.dts  | 36 +++++++++++++++++++
 target/linux/ath79/image/mikrotik.mk          | 10 ++++++
 .../mikrotik/base-files/etc/board.d/01_leds   | 19 +++++-----
 .../base-files/etc/board.d/02_network         |  2 ++
 .../etc/hotplug.d/firmware/10-ath9k-eeprom    |  1 +
 5 files changed, 59 insertions(+), 9 deletions(-)
 create mode 100644 target/linux/ath79/dts/ar9344_mikrotik_routerboard-911-lite.dts

Comments

Hauke Mehrtens Aug. 6, 2022, 6:33 p.m. UTC | #1
On 7/20/22 22:31, Tomasz Maciej Nowak wrote:
> From: Tomasz Maciej Nowak <tmn505@gmail.com>
> 
> Forward-port from ar71xx target the board introduced in commit
> eb9e3651dd1a (" ar71xx: add support for the MikroTik RB911-2Hn/5Hn
> boards"). Follow intallation instruction from that commit message, using
> images found in ath79 directory. Be advised that the board accepts
> 10-30 V on PoE input.
> 
> Known issues
> Compared to ar71xx target image, there is still small leak of current to
> user LED, which makes it lit, although weaker, even if brightness is set
> to 0. The cause of that is still unknown.
> 
> Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
> ---
> v1 -> v2
> - rebase

Please mention some details about the hardware in the commit message 
like it is done for many other commits adding new devices.

Hauke
Tomasz Maciej Nowak Aug. 7, 2022, 11:42 a.m. UTC | #2
W dniu 6.08.2022 o 20:33, Hauke Mehrtens pisze:
> On 7/20/22 22:31, Tomasz Maciej Nowak wrote:
>> From: Tomasz Maciej Nowak <tmn505@gmail.com>
>>
>> Forward-port from ar71xx target the board introduced in commit
>> eb9e3651dd1a (" ar71xx: add support for the MikroTik RB911-2Hn/5Hn
>> boards"). Follow intallation instruction from that commit message, using
>> images found in ath79 directory. Be advised that the board accepts
>> 10-30 V on PoE input.
>>
>> Known issues
>> Compared to ar71xx target image, there is still small leak of current to
>> user LED, which makes it lit, although weaker, even if brightness is set
>> to 0. The cause of that is still unknown.
>>
>> Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
>> ---
>> v1 -> v2
>> - rebase
> 
> Please mention some details about the hardware in the commit message like it is done for many other commits adding new devices.

Sorry for asking for confirmation, but this is not exactly a new device,
since it was added in mentioned commit, where the hardware details are
included in commit message with installation instruction. I thought it's
redundant when I pointed to it. Should I replicate what's written there?

> Hauke

Regards
diff mbox series

Patch

diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-911-lite.dts b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-911-lite.dts
new file mode 100644
index 000000000000..d77078c5a22c
--- /dev/null
+++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-911-lite.dts
@@ -0,0 +1,36 @@ 
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "ar9344_mikrotik_routerboard.dtsi"
+#include "ar9344_mikrotik_routerboard-16m-nor.dtsi"
+
+/ {
+	model = "MikroTik RouterBOARD 911-2Hn/5Hn (Lite2/Lite5)";
+	compatible = "mikrotik,routerboard-911-lite", "qca,ar9344";
+};
+
+&leds {
+	pinctrl-names = "default";
+	pinctrl-0 = <&enable_gpio_20>;
+
+	lan {
+		label = "green:lan";
+		gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
+	};
+
+	power {
+		label = "green:power";
+		gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
+		default-state = "on";
+	};
+
+	led_user: user {
+		label = "green:user";
+		gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
+	};
+};
+
+&pinmux {
+	enable_gpio_20: pinmux_gpio_out_function5 {
+		pinctrl-single,bits = <0x14 0x0 0xff>;
+	};
+};
diff --git a/target/linux/ath79/image/mikrotik.mk b/target/linux/ath79/image/mikrotik.mk
index c90579fbb58d..fb0035fb6537 100644
--- a/target/linux/ath79/image/mikrotik.mk
+++ b/target/linux/ath79/image/mikrotik.mk
@@ -9,6 +9,16 @@  define Device/mikrotik_routerboard-493g
 endef
 TARGET_DEVICES += mikrotik_routerboard-493g
 
+define Device/mikrotik_routerboard-911-lite
+  $(Device/mikrotik_nor)
+  SOC := ar9344
+  DEVICE_MODEL := RouterBOARD 911 Lite2/Lite5 (2Hn/5Hn)
+  DEVICE_PACKAGES += rssileds
+  IMAGE_SIZE := 16256k
+  SUPPORTED_DEVICES += rb-911-2hn rb-911-5hn
+endef
+TARGET_DEVICES += mikrotik_routerboard-911-lite
+
 define Device/mikrotik_routerboard-912uag-2hpnd
   $(Device/mikrotik_nand)
   SOC := ar9342
diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds b/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds
index 76b91a54a5f2..4c1b98fff223 100644
--- a/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds
@@ -6,6 +6,16 @@  board_config_update
 board=$(board_name)
 
 case "$board" in
+mikrotik,routerboard-911-lite|\
+mikrotik,routerboard-lhg-5nd)
+	ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0"
+	ucidef_set_rssimon "wlan0" "200000" "1"
+	ucidef_set_led_rssi "rssilow" "rssilow" "green:rssilow" "wlan0" "1" "100"
+	ucidef_set_led_rssi "rssimediumlow" "rssimediumlow" "green:rssimediumlow" "wlan0" "20" "100"
+	ucidef_set_led_rssi "rssimedium" "rssimedium" "green:rssimedium" "wlan0" "40" "100"
+	ucidef_set_led_rssi "rssimediumhigh" "rssimediumhigh" "green:rssimediumhigh" "wlan0" "60" "100"
+	ucidef_set_led_rssi "rssihigh" "rssihigh" "green:rssihigh" "wlan0" "80" "100"
+	;;
 mikrotik,routerboard-951ui-2nd|\
 mikrotik,routerboard-952ui-5ac2nd)
 	ucidef_set_led_netdev "port1" "port1" "green:port1" "eth1"
@@ -19,15 +29,6 @@  mikrotik,routerboard-mapl-2nd|\
 mikrotik,routerboard-wap-2nd)
 	ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0"
 	;;
-mikrotik,routerboard-lhg-5nd)
-	ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0"
-	ucidef_set_rssimon "wlan0" "200000" "1"
-	ucidef_set_led_rssi "rssilow" "rssilow" "green:rssilow" "wlan0" "1" "100"
-	ucidef_set_led_rssi "rssimediumlow" "rssimediumlow" "green:rssimediumlow" "wlan0" "20" "100"
-	ucidef_set_led_rssi "rssimedium" "rssimedium" "green:rssimedium" "wlan0" "40" "100"
-	ucidef_set_led_rssi "rssimediumhigh" "rssimediumhigh" "green:rssimediumhigh" "wlan0" "60" "100"
-	ucidef_set_led_rssi "rssihigh" "rssihigh" "green:rssihigh" "wlan0" "80" "100"
-	;;
 mikrotik,routerboard-map-2nd)
 	ucidef_set_led_netdev "eth_1" "eth_1" "green:eth_1" "eth1"
 	ucidef_set_led_switch "eth_2" "eth_2" "green:eth_2" "switch0" "0x4"
diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network
index 5646d8cf68a7..da63347c3c04 100644
--- a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network
@@ -14,6 +14,7 @@  ath79_setup_interfaces()
 		ucidef_add_switch "switch1" \
 			"0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
 		;;
+	mikrotik,routerboard-911-lite|\
 	mikrotik,routerboard-912uag-2hpnd|\
 	mikrotik,routerboard-lhg-2nd|\
 	mikrotik,routerboard-lhg-5nd|\
@@ -52,6 +53,7 @@  ath79_setup_macs()
 	local mac_base="$(cat /sys/firmware/mikrotik/hard_config/mac_base)"
 
 	case "$board" in
+	mikrotik,routerboard-911-lite|\
 	mikrotik,routerboard-912uag-2hpnd|\
 	mikrotik,routerboard-lhg-2nd|\
 	mikrotik,routerboard-lhg-5nd|\
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
index aa5354bfdb37..e0bf1e47efb4 100644
--- 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
@@ -23,6 +23,7 @@  board=$(board_name)
 case "$FIRMWARE" in
 "ath9k-eeprom-ahb-18100000.wmac.bin")
 	case $board in
+	mikrotik,routerboard-911-lite|\
 	mikrotik,routerboard-912uag-2hpnd|\
 	mikrotik,routerboard-lhg-2nd|\
 	mikrotik,routerboard-lhg-5nd|\