rockchip: add Radxa CM3 IO board support
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7628an_tplink_re200.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7628an.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.h>
8
9 / {
10 aliases {
11 label-mac-device = &ethernet;
12 led-boot = &led_power;
13 led-failsafe = &led_power;
14 led-running = &led_power;
15 led-upgrade = &led_power;
16 };
17
18 chosen {
19 bootargs = "console=ttyS0,57600n8";
20 };
21
22 keys {
23 compatible = "gpio-keys";
24
25 reset {
26 label = "reset";
27 gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
28 linux,code = <KEY_RESTART>;
29 };
30
31 wps {
32 label = "wps";
33 gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
34 linux,code = <KEY_WPS_BUTTON>;
35 };
36 };
37
38 leds {
39 compatible = "gpio-leds";
40
41 wps {
42 function = LED_FUNCTION_WPS;
43 color = <LED_COLOR_ID_GREEN>;
44 gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
45 };
46
47 wifi {
48 label = "green:wifi";
49 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
50 };
51
52 lan {
53 function = LED_FUNCTION_LAN;
54 color = <LED_COLOR_ID_GREEN>;
55 gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
56 };
57
58 led_power: power {
59 function = LED_FUNCTION_POWER;
60 color = <LED_COLOR_ID_GREEN>;
61 };
62
63 wifi2g_green {
64 label = "green:wifi2g";
65 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
66 linux,default-trigger = "phy0tpt";
67 };
68
69 wifi5g_green {
70 label = "green:wifi5g";
71 gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
72 linux,default-trigger = "phy1tpt";
73 };
74 };
75 };
76
77 &spi0 {
78 status = "okay";
79
80 flash@0 {
81 compatible = "jedec,spi-nor";
82 reg = <0>;
83 spi-max-frequency = <50000000>;
84
85 partitions {
86 compatible = "fixed-partitions";
87 #address-cells = <1>;
88 #size-cells = <1>;
89
90 partition@0 {
91 label = "u-boot";
92 reg = <0x0 0x20000>;
93 read-only;
94 };
95
96 partition@20000 {
97 compatible = "tplink,firmware";
98 label = "firmware";
99 reg = <0x20000 0x7a0000>;
100 };
101
102 config: partition@7c0000 {
103 label = "config";
104 reg = <0x7c0000 0x30000>;
105 read-only;
106
107 nvmem-layout {
108 compatible = "fixed-layout";
109 #address-cells = <1>;
110 #size-cells = <1>;
111
112 macaddr_config_2008: macaddr@2008 {
113 compatible = "mac-base";
114 reg = <0x2008 0x6>;
115 #nvmem-cell-cells = <1>;
116 };
117 };
118 };
119
120 radio: partition@7f0000 {
121 label = "radio";
122 reg = <0x7f0000 0x10000>;
123 read-only;
124
125 nvmem-layout {
126 compatible = "fixed-layout";
127 #address-cells = <1>;
128 #size-cells = <1>;
129
130 eeprom_radio_0: eeprom@0 {
131 reg = <0x0 0x400>;
132 };
133
134 eeprom_radio_8000: eeprom@8000 {
135 reg = <0x8000 0x200>;
136 };
137 };
138 };
139 };
140 };
141 };
142
143 &state_default {
144 gpio {
145 groups = "p4led_an", "p3led_an", "p2led_an", "p1led_an",
146 "p0led_an", "wled_an", "i2c", "wdt", "refclk";
147 function = "gpio";
148 };
149 };
150
151 &ethernet {
152 nvmem-cells = <&macaddr_config_2008 0>;
153 nvmem-cell-names = "mac-address";
154 };
155
156 &wmac {
157 status = "okay";
158
159 nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_2008 1>;
160 nvmem-cell-names = "eeprom", "mac-address";
161 };
162
163 &pcie {
164 status = "okay";
165 };
166
167 &pcie0 {
168 mt76@0,0 {
169 reg = <0x0000 0 0 0 0>;
170 ieee80211-freq-limit = <5000000 6000000>;
171 nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_2008 2>;
172 nvmem-cell-names = "eeprom", "mac-address";
173 };
174 };