Skip to content

Instantly share code, notes, and snippets.

@EdoaLive
Created September 13, 2021 15:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EdoaLive/f36b4392cd32f078604db5900e759215 to your computer and use it in GitHub Desktop.
Save EdoaLive/f36b4392cd32f078604db5900e759215 to your computer and use it in GitHub Desktop.
[PARTIAL] Patch to OpenWRT 19.07 for ASUS RT-AC52U B1
diff --git a/target/linux/ramips/dts/RT-AC52U-B1.dts b/target/linux/ramips/dts/RT-AC52U-B1.dts
new file mode 100644
index 0000000..aad625c
--- /dev/null
+++ b/target/linux/ramips/dts/RT-AC52U-B1.dts
@@ -0,0 +1,184 @@
+/dts-v1/;
+
+#include "mt7620a.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ compatible = "asus,rt-ac52u-b1", "ralink,mt7620a-soc";
+ model = "Asus RT-AC52U B1";
+
+ chosen {
+ bootargs = "console=ttyS0,115200";
+ };
+
+ aliases {
+ led-boot = &led_power;
+ led-failsafe = &led_power;
+ led-running = &led_power;
+ led-upgrade = &led_power;
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led_power: power {
+ label = "rt-ac51u:blue:power";
+ gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
+ };
+
+ usb {
+ label = "rt-ac51u:blue:usb";
+ gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
+ trigger-sources = <&ohci_port1>, <&ehci_port1>;
+ linux,default-trigger = "usbport";
+ };
+
+ wifi {
+ label = "rt-ac51u:blue:wifi";
+ gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ keys {
+ compatible = "gpio-keys-polled";
+ poll-interval = <20>;
+
+ reset {
+ label = "reset";
+ gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RESTART>;
+ };
+
+ wps {
+ label = "wps";
+ gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_WPS_BUTTON>;
+ };
+ };
+
+ rtl8367rb {
+ compatible = "realtek,rtl8367b", "rtl8367b";
+ cpu_port = <5>;
+ realtek,extif2 = <1 0 1 1 1 1 1 1 2>;
+ mii-bus = <&mdio0>;
+ };
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <10000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ compatible = "denx,uimage";
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
+ };
+ };
+};
+
+&ethernet {
+ status = "okay";
+ mediatek,portmap = "wllll";
+ pinctrl-names = "default";
+ mtd-mac-address = <&factory 0x00004>;
+ pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
+
+ port@5 {
+ status = "okay";
+ mediatek,fixed-link = <1000 1 1 1>;
+ phy-mode = "rgmii";
+ };
+
+ mdio0: mdio-bus {
+ status = "okay";
+ };
+};
+
+&gsw {
+ mediatek,port4 = "ephy";
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&gpio0 {
+ enable-leds {
+ gpio-hog;
+ line-name = "enable-leds";
+ output-low;
+ gpios = <10 GPIO_ACTIVE_HIGH>;
+ };
+ /*
+ rtl8367rb_reset {
+ gpio-hog;
+ gpios = <10 GPIO_ACTIVE_HIGH>;
+ output-high;
+ line-name = "rtl8367rb-reset";
+ };
+ */
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "wled", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+};
+
+&pcie0 {
+ wifi@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ };
+};
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index 0347ff2..60034af 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -606,6 +606,14 @@ define Device/rt-ac51u
endef
TARGET_DEVICES += rt-ac51u
+define Device/rt-ac52u-b1
+ DTS := RT-AC52U-B1
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := Asus RT-AC52U B1
+ DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport kmod-switch-rtl8366-smi kmod-switch-rtl8367b kmod-switch-rtl8367rb
+endef
+TARGET_DEVICES += rt-ac52u-b1
+
define Device/tiny-ac
DTS := TINY-AC
DEVICE_TITLE := Dovado Tiny AC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment