ath79: add support for MikroTik RouterBOARD 750 r2 (hEX lite)
authorRoger Pueyo Centelles <roger.pueyo@guifi.net>
Wed, 2 Jun 2021 16:45:30 +0000 (18:45 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 16 Sep 2023 10:49:26 +0000 (12:49 +0200)
This patch adds support for the MikroTik RouterBOARD 750 r2, marketed as
hEX lite, a small indoor router with 5x 10/100 Mbps Ethernet ports, one
with PoE in. The device was already supported by the ar71xx target.

Specifications:
 - SoC: Qualcomm Atheros QCA9533
 - Flash: 16 MB SPI NOR
 - RAM: 64 MB
 - Ethernet: 4x 10/100 Mbps LAN, 1x 10/100 Mbps WAN (PoE in)
 - LEDs: 5x Ethernet port activity (green), 1x user (green)
 - Buttons: 1x reset

 See https://mikrotik.com/product/RB750r2 for more details.

Not working:
 - Serial port (already not working in ar71xx)

Flashing:
 TFTP boot initramfs image and then perform sysupgrade. Only the
 "Internet" port will ask for an initramfs image. Follow common
 MikroTik procedure as in https://openwrt.org/toh/mikrotik/common.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi
target/linux/ath79/dts/qca9533_mikrotik_routerboard-750-r2.dts [new file with mode: 0644]
target/linux/ath79/dts/qca9533_mikrotik_routerboard-95x.dtsi
target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi
target/linux/ath79/dts/qca9533_mikrotik_routerboard-map-2nd.dts
target/linux/ath79/dts/qca9533_mikrotik_routerboard-mapl-2nd.dts
target/linux/ath79/dts/qca9533_mikrotik_routerboard-wap-2nd.dts
target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts
target/linux/ath79/image/mikrotik.mk
target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds
target/linux/ath79/mikrotik/base-files/etc/board.d/02_network

index e9bd05487c63d2b8a31c6dc23d072c1d562bd2f5..c112b9a193f3cb759ecabc44bea282306aa41a3f 100644 (file)
@@ -75,9 +75,3 @@
                };
        };
 };
-
-&wmac {
-       status = "okay";
-
-       qca,no-eeprom;
-};
diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-750-r2.dts b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-750-r2.dts
new file mode 100644 (file)
index 0000000..b8fa9f2
--- /dev/null
@@ -0,0 +1,78 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca9533_mikrotik_routerboard-16m.dtsi"
+
+/ {
+       compatible = "mikrotik,routerboard-750-r2", "qca,qca9533";
+       model = "MikroTik RouterBOARD 750 r2 (hEX lite)";
+
+       aliases {
+               led-boot = &led_usr;
+               led-failsafe = &led_usr;
+               led-upgrade = &led_usr;
+               led-running = &led_usr;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+
+               led_usr: usr {
+                       label = "green:usr";
+                       gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
+               };
+
+               led1 {
+                       label = "green:port1";
+                       gpios = <&ssr 0 GPIO_ACTIVE_LOW>;
+               };
+
+               led2 {
+                       label = "green:port2";
+                       gpios = <&ssr 1 GPIO_ACTIVE_LOW>;
+               };
+
+               led3 {
+                       label = "green:port3";
+                       gpios = <&ssr 2 GPIO_ACTIVE_LOW>;
+               };
+
+               led4 {
+                       label = "green:port4";
+                       gpios = <&ssr 3 GPIO_ACTIVE_LOW>;
+               };
+
+               led5 {
+                       label = "green:port5";
+                       gpios = <&ssr 4 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&pinmux {
+       pmx_spi_cs1: pinmux_spi_cs1 {
+               pinctrl-single,bits = <0x8 0x0a000000 0xff000000>;
+       };
+};
+
+&spi {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pmx_spi_cs1>;
+
+       cs-gpios = <0>, <&gpio 11 GPIO_ACTIVE_LOW>;
+
+       ssr: ssr@1 {
+               compatible = "fairchild,74hc595";
+               gpio-controller;
+               #gpio-cells = <2>;
+               registers-number = <1>;
+               reg = <1>;
+               spi-max-frequency = <10000000>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+
+       phy-handle = <&swphy4>;
+};
index 79c9f44d3280124ef2028bc6e8027e350a38f8d4..4f6503f9eac4e6f072d98583ab2e4b18b0e63c61 100644 (file)
        };
 };
 
+&wmac {
+       status = "okay";
+
+       qca,no-eeprom;
+};
+
 &eth0 {
        status = "okay";
 
index a45365073be65cb5514b0098c51d97023085035a..aa5c57b27891d6b3da97fbd2456d0f578bdb2fca 100644 (file)
        };
 };
 
+&wmac {
+       status = "okay";
+
+       qca,no-eeprom;
+};
+
 &eth0 {
        status = "okay";
 
index 25971e6f4321c324cedc678efb03960190214462..062c3bd061a617b10c8dc78bfe02243d247b0b76 100644 (file)
        };
 };
 
+&wmac {
+       status = "okay";
+
+       qca,no-eeprom;
+};
+
 &eth0 {
        status = "okay";
 
index e2442f00950cf77dec4a1c77288ffce06e68bfd4..e337bcc70db878fc04a4b0acd86e33a00a09e509 100644 (file)
        };
 };
 
+&wmac {
+       status = "okay";
+
+       qca,no-eeprom;
+};
+
 &eth0 {
        status = "okay";
 
index 807941c6081a501f564fc463f01588f491bcb93a..d4d049920c7f3d2fafa442e752f971715555f2d3 100644 (file)
        };
 };
 
+&wmac {
+       status = "okay";
+
+       qca,no-eeprom;
+};
+
 &eth0 {
        status = "okay";
 
index 49756f3336de29487ea2f6e787d7e52ad9dbfcc6..19ada708d99083a3658b09e7de82a57b792069c4 100644 (file)
        };
 };
 
+&wmac {
+       status = "okay";
+
+       qca,no-eeprom;
+};
+
 &eth0 {
        status = "okay";
 
index 683e9a33304dc0620f4f3993f65ef0b9308c3005..d26420c7f54c4b600b44af9272ae87bc54534ebe 100644 (file)
@@ -9,6 +9,15 @@ define Device/mikrotik_routerboard-493g
 endef
 TARGET_DEVICES += mikrotik_routerboard-493g
 
+define Device/mikrotik_routerboard-750-r2
+  $(Device/mikrotik_nor)
+  SOC := qca9533
+  DEVICE_MODEL := RouterBOARD 750 r2 (hEX lite)
+  IMAGE_SIZE := 16256k
+  SUPPORTED_DEVICES += rb-750-r2
+endef
+TARGET_DEVICES += mikrotik_routerboard-750-r2
+
 define Device/mikrotik_routerboard-911-lite
   $(Device/mikrotik_nor)
   SOC := ar9344
index 31346ebdf581bf4c70f673e094b85d71150d0150..66fa2ee6acdf8abc9ab29ffc86b4e6089edca95d 100644 (file)
@@ -16,6 +16,7 @@ mikrotik,routerboard-lhg-5nd)
        ucidef_set_led_rssi "rssimediumhigh" "rssimediumhigh" "green:rssimediumhigh" "wlan0" "60" "100"
        ucidef_set_led_rssi "rssihigh" "rssihigh" "green:rssihigh" "wlan0" "80" "100"
        ;;
+mikrotik,routerboard-750-r2|\
 mikrotik,routerboard-951ui-2hnd|\
 mikrotik,routerboard-951ui-2nd|\
 mikrotik,routerboard-952ui-5ac2nd)
index 68c8cfb96e7534749699fc11aab5628e93414372..d45af6dbb39b4275fbf6c60c49fed46aeead0481 100644 (file)
@@ -14,6 +14,11 @@ ath79_setup_interfaces()
                ucidef_add_switch "switch1" \
                        "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
                ;;
+       mikrotik,routerboard-750-r2)
+               ucidef_set_interface_wan "eth1"
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2"
+               ;;
        mikrotik,routerboard-911-lite|\
        mikrotik,routerboard-912uag-2hpnd|\
        mikrotik,routerboard-lhg-2nd|\