]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ath79: add support for MikroTik RouterBOARD 960PGS 22164/head
authorOskari Lemmela <oskari@lemmela.net>
Fri, 19 Nov 2021 05:36:22 +0000 (07:36 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Thu, 23 Apr 2026 13:10:39 +0000 (14:10 +0100)
This patch adds support for the MikroTik RouterBOARD 960PGS (hEX
PoE/PowerBox Pro) router. The device has a USB 2.0 port and an SFP port for
adding optical fiber connectivity. The ports 2-5 can power other PoE
capable devices with the same voltage as applied to the unit.

Specifications:

- SoC: Qualcomm Atheros QCA9557
- Flash: 16 MB (SPI)
- RAM: 128 MB
- 1x Ethernet SFP: 1000
- 1x Ethernet RJ45: 10/100/1000 port with passive POE in
- 4x Ethernet RJ45: 10/100/1000 ports with 802.3af/at PoE out
- 1x USB 2.0 host port
- 1x reset button

See [1] and [2] for more details.

Flashing:
TFTP boot initramfs image and then perform sysupgrade. Follow common
MikroTik procedure as in https://openwrt.org/toh/mikrotik/common.

Link: https://mikrotik.com/product/RB960PGS
Link: https://mikrotik.com/product/RB960PGS-PB
Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
Signed-off-by: Chester A. Unal <chester.a.unal@arinc9.com>
target/linux/ath79/dts/qca9557_mikrotik_routerboard-960pgs.dts [new file with mode: 0644]
target/linux/ath79/image/mikrotik.mk
target/linux/ath79/mikrotik/base-files/etc/board.d/02_network

diff --git a/target/linux/ath79/dts/qca9557_mikrotik_routerboard-960pgs.dts b/target/linux/ath79/dts/qca9557_mikrotik_routerboard-960pgs.dts
new file mode 100644 (file)
index 0000000..1136605
--- /dev/null
@@ -0,0 +1,332 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include "qca955x.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+       compatible = "mikrotik,routerboard-960pgs", "qca,qca9557";
+       model = "MikroTik RouterBOARD 960PGS (hEX PoE/PowerBox Pro)";
+
+       aliases {
+               led-boot = &led_user;
+               led-failsafe = &led_user;
+               led-running = &led_user;
+               led-upgrade = &led_user;
+       };
+
+       gpio_export {
+               compatible = "gpio-export";
+
+               buzzer {
+                       /* Beeper requires PWM for frequency selection */
+                       gpio-export,name = "buzzer";
+                       gpio-export,output = <0>;
+                       gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       i2c: i2c {
+               compatible = "i2c-gpio";
+
+               i2c-gpio,delay-us = <5>;
+               i2c-gpio,timeout-ms = <1>;
+               sda-gpios = <&gpio 18 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+               scl-gpios = <&gpio 19 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+       };
+
+       keys {
+               compatible = "gpio-keys";
+
+               reset {
+                       debounce-interval = <60>;
+                       gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
+                       label = "reset";
+                       linux,code = <KEY_RESTART>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               led_user: user {
+                       label = "green:user";
+                       gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+               };
+
+               sfp {
+                       label = "green:sfp";
+                       gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       sfp1: sfp {
+               compatible = "sff,sfp";
+
+               i2c-bus = <&i2c>;
+               maximum-power-milliwatt = <1000>;
+               los-gpios = <&gpio 21 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+               tx-disable-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
+       };
+
+       reg_usb_vbus {
+               compatible = "regulator-fixed";
+               regulator-boot-on;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               regulator-name = "usb_vbus";
+               gpio = <&gpio 13 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+};
+
+&mdio0 {
+       status = "okay";
+
+       switch@0 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               reg = <0>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&eth0>;
+                               phy-mode = "rgmii-id";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+
+                               leds {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       led@0 {
+                                               reg = <0>;
+                                               color = <LED_COLOR_ID_GREEN>;
+                                               function = LED_FUNCTION_LAN;
+                                               default-state = "keep";
+                                       };
+                               };
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+
+                               leds {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       led@0 {
+                                               reg = <0>;
+                                               color = <LED_COLOR_ID_GREEN>;
+                                               function = LED_FUNCTION_LAN;
+                                               default-state = "keep";
+                                       };
+                               };
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+
+                               leds {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       led@0 {
+                                               reg = <0>;
+                                               color = <LED_COLOR_ID_GREEN>;
+                                               function = LED_FUNCTION_LAN;
+                                               default-state = "keep";
+                                       };
+                               };
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+
+                               leds {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       led@0 {
+                                               reg = <0>;
+                                               color = <LED_COLOR_ID_GREEN>;
+                                               function = LED_FUNCTION_LAN;
+                                               default-state = "keep";
+                                       };
+                               };
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "lan5";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+
+                               leds {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       led@0 {
+                                               reg = <0>;
+                                               color = <LED_COLOR_ID_GREEN>;
+                                               function = LED_FUNCTION_LAN;
+                                               default-state = "keep";
+                                       };
+                               };
+                       };
+               };
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
+       };
+};
+
+&eth0 {
+       status = "okay";
+
+       pll-data = <0x8f000000 0xa0000101 0xa0001313>;
+
+       fixed-link {
+               speed = <1000>;
+               full-duplex;
+       };
+};
+
+&mdio1 {
+       status = "okay";
+
+       phy_sfp: ethernet-phy@0 {
+               reg = <0>;
+               phy-mode = "sgmii";
+               sfp = <&sfp1>;
+       };
+};
+
+&eth1 {
+       status = "okay";
+
+       phy-handle = <&phy_sfp>;
+       pll-data = <0x03000000 0x00000101 0x00001616>;
+       qca955x-sgmii-fixup;
+
+       gmac-config {
+               device = <&gmac>;
+       };
+
+       fixed-link {
+               speed = <1000>;
+               full-duplex;
+       };
+};
+
+&spi {
+       status = "okay";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <40000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               compatible = "mikrotik,routerboot-partitions";
+                               label = "RouterBoot";
+                               reg = <0x0 0x20000>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               partition@0 {
+                                       label = "bootloader1";
+                                       reg = <0x0 0x0>;
+                                       read-only;
+                               };
+
+                               hard_config {
+                                       read-only;
+                               };
+
+                               bios {
+                                       size = <0x1000>;
+                                       read-only;
+                               };
+
+                               partition@10000 {
+                                       label = "bootloader2";
+                                       reg = <0x10000 0x0>;
+                                       read-only;
+                               };
+
+                               soft_config {
+                               };
+                       };
+
+                       partition@20000 {
+                               compatible = "mikrotik,minor";
+                               label = "firmware";
+                               reg = <0x020000 0xfe0000>;
+                       };
+               };
+       };
+};
+
+&usb0 {
+       status = "okay";
+};
+
+&usb_phy0 {
+       status = "okay";
+};
index f9a748af1b7586b52c049a053d68bb8c308d316e..fa64b08d288e7112ab5d3e939ac79e3b91f4e110 100644 (file)
@@ -128,6 +128,16 @@ define Device/mikrotik_routerboard-952ui-5ac2nd
 endef
 TARGET_DEVICES += mikrotik_routerboard-952ui-5ac2nd
 
+define Device/mikrotik_routerboard-960pgs
+  $(Device/mikrotik_nor)
+  SOC := qca9557
+  DEVICE_MODEL := RouterBOARD 960PGS (hEX PoE/PowerBox Pro)
+  IMAGE_SIZE := 16256k
+  DEVICE_PACKAGES += kmod-usb2 kmod-i2c-gpio kmod-sfp kmod-dsa-qca8k -swconfig \
+       -kmod-switch-ar8xxx -iwinfo -kmod-ath9k -wpad-basic-mbedtls
+endef
+TARGET_DEVICES += mikrotik_routerboard-960pgs
+
 define Device/mikrotik_routerboard-962uigs-5hact2hnt
   $(Device/mikrotik_nor)
   SOC := qca9558
index 023eb9dd4eb6c6230f64f26321d7a8062a9c6e21..a7a1f342a0bb3ee9743b207c62ba234f040ff699 100644 (file)
@@ -47,6 +47,9 @@ ath79_setup_interfaces()
        mikrotik,routerboard-map-2nd)
                ucidef_set_interface_lan "eth0 eth1"
                ;;
+       mikrotik,routerboard-960pgs)
+               ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "eth1 lan1"
+               ;;
        mikrotik,routerboard-951g-2hnd|\
        mikrotik,routerboard-962uigs-5hact2hnt)
                ucidef_add_switch "switch0" \
@@ -90,6 +93,15 @@ ath79_setup_macs()
                lan_mac="$mac_base"
                wan_mac=$(macaddr_add $mac_base 1)
                ;;
+       mikrotik,routerboard-960pgs)
+               label_mac=$mac_base
+               ucidef_set_network_device_mac "eth1" "$mac_base"
+               ucidef_set_network_device_mac "lan1" "$(macaddr_add $mac_base 1)"
+               ucidef_set_network_device_mac "lan2" "$(macaddr_add $mac_base 2)"
+               ucidef_set_network_device_mac "lan3" "$(macaddr_add $mac_base 3)"
+               ucidef_set_network_device_mac "lan4" "$(macaddr_add $mac_base 4)"
+               ucidef_set_network_device_mac "lan5" "$(macaddr_add $mac_base 5)"
+               ;;
        *)
                label_mac="$mac_base"
                wan_mac="$mac_base"