ramips: add support for Asus RT-AC1200
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7628an_asus_rt-ac1200.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 // Copyright (c) 2022 Ray Wang
3 // Copyright (c) 2022 Ivan Pavlov
4
5 #include "mt7628an.dtsi"
6
7 #include <dt-bindings/gpio/gpio.h>
8 #include <dt-bindings/input/input.h>
9
10 / {
11 compatible = "asus,rt-ac1200", "mediatek,mt7628an-soc";
12 model = "Asus RT-AC1200";
13
14 aliases {
15 led-boot = &led_power;
16 led-failsafe = &led_power;
17 led-running = &led_power;
18 led-upgrade = &led_power;
19 };
20
21 keys {
22 compatible = "gpio-keys";
23
24 reset {
25 label = "reset";
26 gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
27 linux,code = <KEY_RESTART>;
28 };
29
30 wps {
31 label = "wps";
32 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
33 linux,code = <KEY_WPS_BUTTON>;
34 };
35 };
36
37 leds {
38 compatible = "gpio-leds";
39
40 led_power: power {
41 label = "blue:power";
42 gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
43 };
44
45 wlan2g {
46 label = "blue:wlan2g";
47 gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
48 linux,default-trigger = "phy0tpt";
49 };
50
51 usb {
52 label = "blue:usb";
53 gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
54 trigger-sources = <&ohci_port1>, <&ehci_port1>;
55 linux,default-trigger = "usbport";
56 };
57 };
58
59 gpio-export {
60 compatible = "gpio-export";
61 #size-cells = <0>;
62
63 led-all {
64 gpio-export,name = "led_all";
65 gpio-export,output = <0>;
66 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
67 };
68 };
69 };
70
71 &spi0 {
72 status = "okay";
73
74 flash@0 {
75 compatible = "jedec,spi-nor";
76 reg = <0>;
77 spi-max-frequency = <40000000>;
78
79 partitions {
80 compatible = "fixed-partitions";
81 #address-cells = <1>;
82 #size-cells = <1>;
83
84 partition@0 {
85 label = "bootloader";
86 reg = <0x0 0x30000>;
87 read-only;
88 };
89
90 partition@30000 {
91 label = "nvram";
92 reg = <0x30000 0x10000>;
93 read-only;
94 };
95
96 factory: partition@40000 {
97 label = "factory";
98 reg = <0x40000 0x10000>;
99 read-only;
100
101 compatible = "nvmem-cells";
102 #address-cells = <1>;
103 #size-cells = <1>;
104
105 macaddr_factory_28: macaddr@28 {
106 reg = <0x28 0x6>;
107 };
108 };
109
110 partition@50000 {
111 compatible = "denx,uimage";
112 label = "firmware";
113 reg = <0x50000 0xfb0000>;
114 };
115 };
116 };
117 };
118
119 &ethernet {
120 nvmem-cells = <&macaddr_factory_28>;
121 nvmem-cell-names = "mac-address";
122 };
123
124 &esw {
125 mediatek,portmap = <0x3e>;
126 };
127
128 &wmac {
129 status = "okay";
130
131 mediatek,mtd-eeprom = <&factory 0x0>;
132 };
133
134 &pcie {
135 status = "okay";
136 };
137
138 &pcie0 {
139 wifi@0,0 {
140 compatible = "mediatek,mt76";
141 reg = <0x0000 0 0 0 0>;
142 mediatek,mtd-eeprom = <&factory 0x8000>;
143 ieee80211-freq-limit = <5000000 6000000>;
144
145 led {
146 led-sources = <2>;
147 led-active-low;
148 };
149 };
150 };
151
152 &state_default {
153 gpio {
154 groups = "i2c", "spi cs1", "refclk", "wled_an";
155 function = "gpio";
156 };
157 };