ramips: fix nvmem-cells for routers based on TP-Link Archer
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7628an_widora_neo.dtsi
1 #include "mt7628an.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "widora,neo", "mediatek,mt7628an-soc";
8
9 aliases {
10 led-boot = &led_wifi;
11 led-failsafe = &led_wifi;
12 led-running = &led_wifi;
13 led-upgrade = &led_wifi;
14 };
15
16 chosen {
17 bootargs = "console=ttyS0,115200";
18 };
19
20 leds {
21 compatible = "gpio-leds";
22
23 led_wifi: wifi {
24 label = "orange:wifi";
25 gpios = <&wgpio 0 GPIO_ACTIVE_HIGH>;
26 default-state = "on";
27 };
28 };
29
30 keys {
31 compatible = "gpio-keys";
32
33 wps {
34 label = "reset";
35 gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
36 linux,code = <KEY_WPS_BUTTON>;
37 };
38 };
39
40 wgpio: gpio-wifi {
41 compatible = "mediatek,gpio-wifi";
42 #address-cells = <1>;
43 #size-cells = <0>;
44 gpio-controller;
45 #gpio-cells = <2>;
46 };
47 };
48
49 &spi0 {
50 status = "okay";
51
52 pinctrl-names = "default";
53 pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;
54
55 flash0: flash@0 {
56 compatible = "jedec,spi-nor";
57 reg = <0>;
58 spi-max-frequency = <40000000>;
59
60 partitions {
61 compatible = "fixed-partitions";
62 #address-cells = <1>;
63 #size-cells = <1>;
64
65 partition@0 {
66 label = "u-boot";
67 reg = <0x0 0x30000>;
68 read-only;
69 };
70
71 partition@30000 {
72 label = "u-boot-env";
73 reg = <0x30000 0x10000>;
74 };
75
76 partition@40000 {
77 label = "factory";
78 reg = <0x40000 0x10000>;
79 read-only;
80
81 nvmem-layout {
82 compatible = "fixed-layout";
83 #address-cells = <1>;
84 #size-cells = <1>;
85
86 eeprom_factory_0: eeprom@0 {
87 reg = <0x0 0x400>;
88 };
89
90 macaddr_factory_28: macaddr@28 {
91 reg = <0x28 0x6>;
92 };
93 };
94 };
95
96 firmware: partition@50000 {
97 compatible = "denx,uimage";
98 label = "firmware";
99 /* reg property is set based on flash size in DTS files */
100 };
101 };
102 };
103
104 spidev@1 {
105 #address-cells = <1>;
106 #size-cells = <1>;
107 compatible = "linux,spidev";
108 reg = <1>;
109 spi-max-frequency = <40000000>;
110 };
111 };
112
113 &state_default {
114 gpio {
115 groups = "gpio";
116 function = "gpio";
117 };
118
119 perst {
120 groups = "perst";
121 function = "gpio";
122 };
123
124 refclk {
125 groups = "refclk";
126 function = "gpio";
127 };
128
129 i2s {
130 groups = "i2s";
131 function = "gpio";
132 };
133
134 spis {
135 groups = "spis";
136 function = "gpio";
137 };
138
139 wled_kn {
140 groups = "wled_kn";
141 function = "gpio";
142 };
143
144 wled_an {
145 groups = "wled_an";
146 function = "wled_an";
147 };
148
149 wdt {
150 groups = "wdt";
151 function = "gpio";
152 };
153 };
154
155 &i2c {
156 status = "okay";
157 };
158
159 &uart1 {
160 status = "okay";
161 };
162
163 &uart2 {
164 status = "okay";
165 };
166
167 &pwm {
168 status = "okay";
169 };
170
171 &ethernet {
172 nvmem-cells = <&macaddr_factory_28>;
173 nvmem-cell-names = "mac-address";
174 };
175
176 &sdhci {
177 status = "okay";
178 mediatek,cd-low;
179 };
180
181 &wmac {
182 status = "okay";
183
184 nvmem-cells = <&eeprom_factory_0>;
185 nvmem-cell-names = "eeprom";
186 };