Add MikroTik_RouterBOARD_912UAG-5HPnD (#575)

This commit is contained in:
Tim Wilkinson 2022-12-22 21:34:43 -08:00 committed by GitHub
parent 6950479bf1
commit 7b495f5deb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 316 additions and 4 deletions

View File

@ -35,6 +35,10 @@ jobs:
name: Build
command: make MAINTARGET=ath79 SUBTARGET=mikrotik ALTTARGET=ath10k
no_output_timeout: 1h
- run:
name: Build
command: make MAINTARGET=ath79 SUBTARGET=mikrotik ALTTARGET=nand
no_output_timeout: 1h
- run:
name: Build
command: make MAINTARGET=ath79 SUBTARGET=nand

View File

@ -115,7 +115,7 @@ Mikrotik QRT5 RB911G-5HPnD-QRT | ath79 | - | 64MB | untested
Mikrotik mANTBox RB911G-2HPnD | ath79 | - | 64MB | untested
Mikrotik mANTBox RB911G-5HPnD | ath79 | - | 64MB | untested
Mikrotik mANTBox RB912UAG-2HPnD | ath79 | mikrotik_routerboard-912uag-2hpnd | 128MB | untested
Mikrotik mANTBox RB912UAG-5HPnD | ath79 | - | 128MB | untested
Mikrotik mANTBox RB912UAG-5HPnD | ath79 | mikrotik_routerboard-912uag-5hpnd | 128MB | stable
Mikrotik mANTBox RB921GS-5HPacD 15s | ath79 | mikrotik_routerboard-921gs-5hpacd-15s | 128MB | stable new
Mikrotik mANTBox RB921GS-5HPacD 19s | ath79 | mikrotik_routerboard-921gs-5hpacd-19s | 128MB | stable new
Mikrotik SXTsq 5HPnD | ath79 | mikrotik_routerboard-sxt-5nd | 64MB | stable

View File

@ -0,0 +1,9 @@
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_mikrotik=y
CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-912uag-2hpnd=y
CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-912uag-5hpnd=y
#
# DEVICE_PACKAGES are not included in the initramfs, but for these devices we need
# extra packages pre-installed to successfully install sysupgrade.
#
CONFIG_PACKAGE_nand-utils=y

View File

@ -1,6 +1,5 @@
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_mikrotik=y
CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-912uag-2hpnd=y
CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-952ui-5ac2nd=y
CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-lhg-2nd=y
CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-lhg-5nd=y

View File

@ -322,8 +322,8 @@
"usechains" : true,
"rfband" : "2400"
},
"Mikrotik RouterBOARD 912UAG-5HPnD" : {
"name" : "Mikrotik RouterBOARD 912UAG-5HPnD",
"MikroTik RouterBOARD 912UAG-5HPnD" : {
"name" : "MikroTik RouterBOARD 912UAG-5HPnD",
"comment" : "",
"supported" : "1",
"maxpower" : "30",

View File

@ -498,3 +498,303 @@
mikrotik,routerboard-922uags-5hpacd|\
mikrotik,routerboard-sxt-5nd-r2)
platform_do_upgrade_mikrotik_nand "$1"
--- /dev/null
+++ b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-5hpnd.dts
@@ -0,0 +1,240 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "ar9344.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ compatible = "mikrotik,routerboard-912uag-5hpnd", "qca,ar9342";
+ model = "MikroTik RouterBOARD 912UAG-5HPnD";
+
+ aliases {
+ led-boot = &led_power;
+ led-failsafe = &led_power;
+ led-running = &led_power;
+ led-upgrade = &led_power;
+ };
+
+ gpio_key: gpio_key {
+ compatible = "mikrotik,gpio-rb91x-key";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio = <&gpio 15 GPIO_ACTIVE_HIGH>;
+ };
+
+ gpio_latch: gpio_latch {
+ compatible = "gpio-latch";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpios = <&gpio 0 GPIO_ACTIVE_HIGH>,
+ <&gpio 1 GPIO_ACTIVE_HIGH>,
+ <&gpio 2 GPIO_ACTIVE_HIGH>,
+ <&gpio 3 GPIO_ACTIVE_HIGH>,
+ <0>, /* Not connected */
+ <&gpio 13 GPIO_ACTIVE_HIGH>,
+ <&gpio 14 GPIO_ACTIVE_HIGH>,
+ <&gpio_key 0 GPIO_ACTIVE_HIGH>,
+ <&gpio 11 GPIO_ACTIVE_LOW>; /* Latch Enable */
+ };
+
+ nand_gpio {
+ compatible = "mikrotik,rb91x-nand";
+
+ gpios = <&gpio_latch 3 GPIO_ACTIVE_HIGH>, /* Read */
+ <&gpio 4 GPIO_ACTIVE_HIGH>, /* Ready (RDY) */
+ <&gpio_latch 5 GPIO_ACTIVE_LOW>, /* Chip Enable (nCE) */
+ <&gpio_latch 6 GPIO_ACTIVE_HIGH>, /* Command Latch Enable (CLE) */
+ <&gpio_latch 7 GPIO_ACTIVE_HIGH>, /* Address Latch Enable (ALE) */
+ <&gpio 12 GPIO_ACTIVE_LOW>, /* Read/Write Enable (nRW) */
+ <&gpio_latch 8 GPIO_ACTIVE_LOW>, /* Latch Enable (nLE) */
+ <&gpio_key 2 GPIO_ACTIVE_HIGH>; /* Key poll disable */
+
+ partitions {
+ compatible = "fixed-partitions";
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "booter";
+ reg = <0x0 0x0040000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "kernel";
+ reg = <0x0040000 0x03c0000>;
+ };
+
+ partition@400000 {
+ label = "ubi";
+ reg = <0x0400000 0x7c00000>;
+ };
+ };
+ };
+
+ keys {
+ compatible = "gpio-keys-polled";
+ poll-interval = <20>;
+
+ button@0 {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ gpios = <&gpio_key 1 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led_power: power {
+ label = "green:power";
+ gpios = <&gpio_latch 1 GPIO_ACTIVE_HIGH>;
+ default-state = "on";
+ };
+
+ user {
+ label = "green:user";
+ gpios = <&gpio_latch 2 GPIO_ACTIVE_HIGH>;
+ };
+
+ led1 {
+ label = "green:led1";
+ gpios = <&ssr 0 GPIO_ACTIVE_HIGH>;
+ };
+
+ led2 {
+ label = "green:led2";
+ gpios = <&ssr 1 GPIO_ACTIVE_HIGH>;
+ };
+
+ led3 {
+ label = "green:led3";
+ gpios = <&ssr 2 GPIO_ACTIVE_HIGH>;
+ };
+
+ led4 {
+ label = "green:led4";
+ gpios = <&ssr 3 GPIO_ACTIVE_HIGH>;
+ };
+
+ led5 {
+ label = "green:led5";
+ gpios = <&ssr 4 GPIO_ACTIVE_HIGH>;
+ };
+ };
+
+ gpio-export {
+ compatible = "gpio-export";
+
+ beeper {
+ gpio-export,name = "beeper";
+ gpio-export,output = <1>; /* Must be 1 to avoid EMI induced clicking noise */
+ gpios = <&ssr 5 GPIO_ACTIVE_HIGH>;
+ };
+
+ usb_power {
+ gpio-export,name = "power-usb";
+ gpio-export,output = <1>;
+ gpios = <&ssr 6 GPIO_ACTIVE_HIGH>;
+ };
+
+ pcie_power {
+ gpio-export,name = "power-pcie";
+ gpio-export,output = <0>;
+ gpios = <&ssr 7 GPIO_ACTIVE_HIGH>;
+ };
+ };
+};
+
+&ref {
+ clock-frequency = <25000000>;
+};
+
+&spi {
+ status = "okay";
+
+ compatible = "qca,ar7100-spi";
+
+ cs-gpios = <0>, <&gpio_latch 0 GPIO_ACTIVE_LOW>;
+
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <50000000>;
+
+ partitions {
+ compatible = "mikrotik,routerboot-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "routerboot";
+ reg = <0x0 0x0>;
+ read-only;
+ };
+
+ hard_config: hard_config {
+ read-only;
+ };
+
+ bios {
+ size = <0x1000>;
+ read-only;
+ };
+
+ soft_config {
+ };
+ };
+ };
+
+ ssr: ssr@1 {
+ compatible = "fairchild,74hc595";
+ gpio-controller;
+ #gpio-cells = <2>;
+ registers-number = <1>;
+ reg = <1>;
+ spi-max-frequency = <50000000>;
+ };
+};
+
+&mdio0 {
+ status = "okay";
+
+ phy-mask = <0>;
+
+ phy0: ethernet-phy@0 {
+ reg = <0>;
+ };
+};
+
+&eth0 {
+ status = "okay";
+
+ phy-mode = "rgmii-id";
+ phy-handle = <&phy0>;
+ pll-data = <0x02000000 0x00000101 0x00001313>;
+
+ gmac-config {
+ device = <&gmac>;
+ rgmii-gmac0 = <1>;
+ rxd-delay = <1>;
+ txd-delay = <1>;
+ };
+};
+
+&wmac {
+ status = "okay";
+ qca,no-eeprom;
+};
+
+&pcie {
+ status = "okay";
+};
+
+&usb {
+ status = "okay";
+};
+
+&usb_phy {
+ status = "okay";
+};
--- a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network
@@ -15,6 +15,7 @@
"0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
;;
mikrotik,routerboard-912uag-2hpnd|\
+ mikrotik,routerboard-912uag-5hpnd|\
mikrotik,routerboard-lhg-2nd|\
mikrotik,routerboard-lhg-5nd|\
mikrotik,routerboard-mapl-2nd|\
@@ -69,6 +70,7 @@
case "$board" in
mikrotik,routerboard-912uag-2hpnd|\
+ mikrotik,routerboard-912uag-5hpnd|\
mikrotik,routerboard-lhg-2nd|\
mikrotik,routerboard-lhg-5nd|\
mikrotik,routerboard-map-2nd|\
--- 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
@@ -24,6 +24,7 @@
"ath9k-eeprom-ahb-18100000.wmac.bin")
case $board in
mikrotik,routerboard-912uag-2hpnd|\
+ mikrotik,routerboard-912uag-5hpnd|\
mikrotik,routerboard-lhg-2nd|\
mikrotik,routerboard-lhg-5nd|\
mikrotik,routerboard-sxt-5nd|\
--- a/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh
@@ -33,6 +33,7 @@
case "$board" in
mikrotik,routerboard-493g|\
mikrotik,routerboard-912uag-2hpnd|\
+ mikrotik,routerboard-912uag-5hpnd|\
mikrotik,routerboard-921gs-5hpacd-15s|\
mikrotik,routerboard-921gs-5hpacd-19s|\
mikrotik,routerboard-922uags-5hpacd|\
--- a/target/linux/ath79/image/mikrotik.mk
+++ b/target/linux/ath79/image/mikrotik.mk
@@ -18,6 +18,15 @@
endef
TARGET_DEVICES += mikrotik_routerboard-912uag-2hpnd
+define Device/mikrotik_routerboard-912uag-5hpnd
+ $(Device/mikrotik_nand)
+ SOC := ar9342
+ DEVICE_MODEL := RouterBOARD 912UAG-5HPnD
+ DEVICE_PACKAGES += kmod-usb-ehci kmod-usb2
+ SUPPORTED_DEVICES += rb-912uag-5hpnd
+endef
+TARGET_DEVICES += mikrotik_routerboard-912uag-5hpnd
+
define Device/mikrotik_routerboard-921gs-5hpacd-15s
$(Device/mikrotik_nand)
SOC := qca9558