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