ramips: convert most mtd-mac-address cases in DTSI to nvmem
[openwrt/staging/wigyori.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 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 factory: partition@40000 {
77 label = "factory";
78 reg = <0x40000 0x10000>;
79 read-only;
80 };
81
82 firmware: partition@50000 {
83 compatible = "denx,uimage";
84 label = "firmware";
85 /* reg property is set based on flash size in DTS files */
86 };
87 };
88 };
89
90 spidev@1 {
91 #address-cells = <1>;
92 #size-cells = <1>;
93 compatible = "linux,spidev";
94 reg = <1>;
95 spi-max-frequency = <40000000>;
96 };
97 };
98
99 &state_default {
100 gpio {
101 groups = "gpio";
102 function = "gpio";
103 };
104
105 perst {
106 groups = "perst";
107 function = "gpio";
108 };
109
110 refclk {
111 groups = "refclk";
112 function = "gpio";
113 };
114
115 i2s {
116 groups = "i2s";
117 function = "gpio";
118 };
119
120 spis {
121 groups = "spis";
122 function = "gpio";
123 };
124
125 wled_kn {
126 groups = "wled_kn";
127 function = "gpio";
128 };
129
130 wled_an {
131 groups = "wled_an";
132 function = "wled_an";
133 };
134
135 wdt {
136 groups = "wdt";
137 function = "gpio";
138 };
139 };
140
141 &i2c {
142 status = "okay";
143 };
144
145 &uart1 {
146 status = "okay";
147 };
148
149 &uart2 {
150 status = "okay";
151 };
152
153 &pwm {
154 status = "okay";
155 };
156
157 &ethernet {
158 nvmem-cells = <&macaddr_factory_28>;
159 nvmem-cell-names = "mac-address";
160 };
161
162 &sdhci {
163 status = "okay";
164 mediatek,cd-low;
165 };
166
167 &wmac {
168 status = "okay";
169
170 mediatek,mtd-eeprom = <&factory 0x0>;
171 };
172
173 &factory {
174 compatible = "nvmem-cells";
175 #address-cells = <1>;
176 #size-cells = <1>;
177
178 macaddr_factory_28: macaddr@28 {
179 reg = <0x28 0x6>;
180 };
181 };