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