ramips: mt7621: convert to nvmem-layout
[openwrt/staging/hauke.git] / target / linux / ramips / dts / mt7621_youhua_wr1200js.dts
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "youhua,wr1200js", "mediatek,mt7621-soc";
8 model = "YouHua WR1200JS";
9
10 aliases {
11 led-boot = &led_wps;
12 led-failsafe = &led_wps;
13 };
14
15 chosen {
16 bootargs = "console=ttyS0,115200";
17 };
18
19 leds {
20 compatible = "gpio-leds";
21
22 internet {
23 label = "blue:internet";
24 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
25 };
26
27 led_wps: wps {
28 label = "blue:wps";
29 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
30 };
31
32 usb {
33 label = "blue:usb";
34 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
35 trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
36 linux,default-trigger = "usbport";
37 };
38 };
39
40 keys {
41 compatible = "gpio-keys";
42
43 reset {
44 label = "reset";
45 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
46 linux,code = <KEY_RESTART>;
47 };
48
49 wps {
50 label = "wps";
51 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
52 linux,code = <KEY_WPS_BUTTON>;
53 };
54
55 wifi {
56 label = "wifi";
57 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
58 linux,code = <KEY_RFKILL>;
59 };
60 };
61 };
62
63 &spi0 {
64 status = "okay";
65
66 flash@0 {
67 compatible = "jedec,spi-nor";
68 reg = <0>;
69 spi-max-frequency = <10000000>;
70
71 partitions {
72 compatible = "fixed-partitions";
73 #address-cells = <1>;
74 #size-cells = <1>;
75
76 partition@0 {
77 label = "u-boot";
78 reg = <0x0 0x30000>;
79 read-only;
80 };
81
82 partition@30000 {
83 label = "u-boot-env";
84 reg = <0x30000 0x10000>;
85 read-only;
86 };
87
88 factory: partition@40000 {
89 label = "factory";
90 reg = <0x40000 0x10000>;
91 read-only;
92
93 nvmem-layout {
94 compatible = "fixed-layout";
95 #address-cells = <1>;
96 #size-cells = <1>;
97
98 eeprom_factory_0: eeprom@0 {
99 reg = <0x0 0x400>;
100 };
101
102 eeprom_factory_8000: eeprom@8000 {
103 reg = <0x8000 0x200>;
104 };
105
106 macaddr_factory_e000: macaddr@e000 {
107 reg = <0xe000 0x6>;
108 };
109
110 macaddr_factory_e006: macaddr@e006 {
111 reg = <0xe006 0x6>;
112 };
113 };
114 };
115
116 partition@50000 {
117 compatible = "denx,uimage";
118 label = "firmware";
119 reg = <0x50000 0xfb0000>;
120 };
121 };
122 };
123 };
124
125 &pcie {
126 status = "okay";
127 };
128
129 &pcie0 {
130 mt76@0,0 {
131 reg = <0x0000 0 0 0 0>;
132 nvmem-cells = <&eeprom_factory_0>;
133 nvmem-cell-names = "eeprom";
134 };
135 };
136
137 &pcie1 {
138 mt76@0,0 {
139 reg = <0x0000 0 0 0 0>;
140 nvmem-cells = <&eeprom_factory_8000>;
141 nvmem-cell-names = "eeprom";
142 ieee80211-freq-limit = <5000000 6000000>;
143
144 led {
145 led-sources = <2>;
146 led-active-low;
147 };
148 };
149 };
150
151 &gmac0 {
152 nvmem-cells = <&macaddr_factory_e000>;
153 nvmem-cell-names = "mac-address";
154 };
155
156 &gmac1 {
157 status = "okay";
158 label = "wan";
159 phy-handle = <&ethphy0>;
160
161 nvmem-cells = <&macaddr_factory_e006>;
162 nvmem-cell-names = "mac-address";
163 };
164
165 &mdio {
166 ethphy0: ethernet-phy@0 {
167 reg = <0>;
168 };
169 };
170
171 &switch0 {
172 ports {
173 port@1 {
174 status = "okay";
175 label = "lan1";
176 };
177
178 port@2 {
179 status = "okay";
180 label = "lan2";
181 };
182
183 port@3 {
184 status = "okay";
185 label = "lan3";
186 };
187
188 port@4 {
189 status = "okay";
190 label = "lan4";
191 };
192 };
193 };
194
195 &state_default {
196 gpio {
197 groups = "i2c", "uart2", "uart3", "wdt";
198 function = "gpio";
199 };
200 };