ramips: convert rt2x00 EEPROM to NVMEM format
[openwrt/staging/stintel.git] / target / linux / ramips / dts / mt7620a_xiaomi_miwifi-mini.dts
1 #include "mt7620a.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "xiaomi,miwifi-mini", "ralink,mt7620a-soc";
8 model = "Xiaomi MiWiFi Mini";
9
10 aliases {
11 led-boot = &led_yellow;
12 led-failsafe = &led_red;
13 led-running = &led_blue;
14 led-upgrade = &led_blue;
15 label-mac-device = &ethernet;
16 };
17
18 chosen {
19 bootargs = "console=ttyS0,115200";
20 };
21
22 leds {
23 compatible = "gpio-leds";
24
25 led_blue: blue {
26 label = "blue:status";
27 gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
28 };
29
30 led_yellow: yellow {
31 label = "yellow:status";
32 gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
33 };
34
35 led_red: red {
36 label = "red:status";
37 gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
38 };
39
40 wan {
41 label = "green:wan";
42 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
43 };
44
45 lan1 {
46 label = "green:lan1";
47 gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
48 };
49
50 lan2 {
51 label = "green:lan2";
52 gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
53 };
54 };
55
56 keys {
57 compatible = "gpio-keys";
58
59 reset {
60 label = "reset";
61 gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
62 linux,code = <KEY_RESTART>;
63 };
64 };
65 };
66
67 &gpio1 {
68 status = "okay";
69 };
70
71 &gpio2 {
72 status = "okay";
73 };
74
75 &spi0 {
76 status = "okay";
77
78 flash@0 {
79 compatible = "jedec,spi-nor";
80 reg = <0>;
81 spi-max-frequency = <70000000>;
82 m25p,fast-read;
83
84 partitions {
85 compatible = "fixed-partitions";
86 #address-cells = <1>;
87 #size-cells = <1>;
88
89 partition@0 {
90 label = "u-boot";
91 reg = <0x0 0x30000>;
92 read-only;
93 };
94
95 partition@30000 {
96 label = "u-boot-env";
97 reg = <0x30000 0x10000>;
98 };
99
100 factory: partition@40000 {
101 compatible = "nvmem-cells";
102 label = "factory";
103 reg = <0x40000 0x10000>;
104 #address-cells = <1>;
105 #size-cells = <1>;
106 read-only;
107
108 eeprom_factory_0: eeprom@0 {
109 reg = <0x0 0x200>;
110 };
111
112 macaddr_factory_28: macaddr@28 {
113 reg = <0x28 0x6>;
114 };
115 };
116
117 partition@50000 {
118 compatible = "denx,uimage";
119 label = "firmware";
120 reg = <0x50000 0xf80000>;
121 };
122
123 partition@fd0000 {
124 label = "crash";
125 reg = <0xfd0000 0x10000>;
126 };
127
128 partition@fe0000 {
129 label = "reserved";
130 reg = <0xfe0000 0x10000>;
131 read-only;
132 };
133
134 partition@ff0000 {
135 label = "Bdata";
136 reg = <0xff0000 0x10000>;
137 };
138 };
139 };
140 };
141
142 &ehci {
143 status = "okay";
144 };
145
146 &ohci {
147 status = "okay";
148 };
149
150 &ethernet {
151 nvmem-cells = <&macaddr_factory_28>;
152 nvmem-cell-names = "mac-address";
153
154 mediatek,portmap = "llllw";
155 };
156
157 &wmac {
158 pinctrl-names = "default", "pa_gpio";
159 pinctrl-0 = <&pa_pins>;
160 pinctrl-1 = <&pa_gpio_pins>;
161 nvmem-cells = <&eeprom_factory_0>;
162 nvmem-cell-names = "eeprom";
163 };
164
165 &pcie {
166 status = "okay";
167 };
168
169 &pcie0 {
170 mt76@0,0 {
171 reg = <0x0000 0 0 0 0>;
172 mediatek,mtd-eeprom = <&factory 0x8000>;
173 ieee80211-freq-limit = <5000000 6000000>;
174 };
175 };
176
177 &state_default {
178 gpio {
179 groups = "ephy", "i2c", "rgmii1";
180 function = "gpio";
181 };
182 };