ramips: convert MT7603 EEPROM to NVMEM format
[openwrt/openwrt.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 label = "factory";
102 reg = <0x40000 0x10000>;
103 read-only;
104 };
105
106 partition@50000 {
107 compatible = "denx,uimage";
108 label = "firmware";
109 reg = <0x50000 0xf80000>;
110 };
111
112 partition@fd0000 {
113 label = "crash";
114 reg = <0xfd0000 0x10000>;
115 };
116
117 partition@fe0000 {
118 label = "reserved";
119 reg = <0xfe0000 0x10000>;
120 read-only;
121 };
122
123 partition@ff0000 {
124 label = "Bdata";
125 reg = <0xff0000 0x10000>;
126 };
127 };
128 };
129 };
130
131 &ehci {
132 status = "okay";
133 };
134
135 &ohci {
136 status = "okay";
137 };
138
139 &ethernet {
140 nvmem-cells = <&macaddr_factory_28>;
141 nvmem-cell-names = "mac-address";
142
143 mediatek,portmap = "llllw";
144 };
145
146 &wmac {
147 ralink,mtd-eeprom = <&factory 0x0>;
148
149 pinctrl-names = "default", "pa_gpio";
150 pinctrl-0 = <&pa_pins>;
151 pinctrl-1 = <&pa_gpio_pins>;
152 };
153
154 &pcie {
155 status = "okay";
156 };
157
158 &pcie0 {
159 mt76@0,0 {
160 reg = <0x0000 0 0 0 0>;
161 mediatek,mtd-eeprom = <&factory 0x8000>;
162 ieee80211-freq-limit = <5000000 6000000>;
163 };
164 };
165
166 &state_default {
167 gpio {
168 groups = "ephy", "i2c", "rgmii1";
169 function = "gpio";
170 };
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 };