ramips: convert MT7603 EEPROM to NVMEM format
[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 compatible = "nvmem-cells";
108 label = "factory";
109 reg = <0x40000 0x10000>;
110 #address-cells = <1>;
111 #size-cells = <1>;
112 read-only;
113
114 eeprom_factory_0: eeprom@0 {
115 reg = <0x0 0x400>;
116 };
117
118 macaddr_factory_e000: macaddr@e000 {
119 reg = <0xe000 0x6>;
120 };
121
122 macaddr_factory_e006: macaddr@e006 {
123 reg = <0xe006 0x6>;
124 };
125 };
126
127 partition@50000 {
128 compatible = "denx,uimage";
129 label = "firmware";
130 reg = <0x50000 0x1fb0000>;
131 };
132 };
133 };
134 };
135
136 &pcie {
137 status = "okay";
138 };
139
140 &pcie0 {
141 mt76@0,0 {
142 reg = <0x0000 0 0 0 0>;
143 mediatek,mtd-eeprom = <&factory 0x8000>;
144 ieee80211-freq-limit = <5000000 6000000>;
145 };
146 };
147
148 &pcie1 {
149 mt76@0,0 {
150 reg = <0x0000 0 0 0 0>;
151 nvmem-cells = <&eeprom_factory_0>;
152 nvmem-cell-names = "eeprom";
153 };
154 };
155
156 &gmac0 {
157 nvmem-cells = <&macaddr_factory_e000>;
158 nvmem-cell-names = "mac-address";
159 };
160
161 &gmac1 {
162 status = "okay";
163 label = "wan";
164 phy-handle = <&ethphy4>;
165
166 nvmem-cells = <&macaddr_factory_e006>;
167 nvmem-cell-names = "mac-address";
168 };
169
170 &mdio {
171 ethphy4: ethernet-phy@4 {
172 reg = <4>;
173 };
174 };
175
176 &switch0 {
177 ports {
178 port@1 {
179 status = "okay";
180 label = "lan2";
181 };
182
183 port@2 {
184 status = "okay";
185 label = "lan1";
186 };
187 };
188 };
189
190 &state_default {
191 gpio {
192 groups = "jtag", "uart2", "wdt";
193 function = "gpio";
194 };
195 };