ramips: convert mtd-mac-address to nvmem implementation
[openwrt/staging/wigyori.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 = "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
52 gpio_export {
53 compatible = "gpio-export";
54 #size-cells = <0>;
55
56 usb2power {
57 gpio-export,name = "usb2power";
58 gpio-export,output = <1>;
59 gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
60 };
61
62 usb3power {
63 gpio-export,name = "usb3power";
64 gpio-export,output = <1>;
65 gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
66 };
67 };
68 };
69
70 &sdhci {
71 status = "okay";
72 };
73
74 &spi0 {
75 status = "okay";
76
77 flash@0 {
78 compatible = "jedec,spi-nor";
79 reg = <0>;
80 spi-max-frequency = <45000000>;
81 broken-flash-reset;
82
83 partitions {
84 compatible = "fixed-partitions";
85 #address-cells = <1>;
86 #size-cells = <1>;
87
88 partition@0 {
89 label = "u-boot";
90 reg = <0x0 0x30000>;
91 read-only;
92 };
93
94 partition@30000 {
95 label = "u-boot-env";
96 reg = <0x30000 0x10000>;
97 read-only;
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 0x1fb0000>;
110 };
111 };
112 };
113 };
114
115 &pcie {
116 status = "okay";
117 };
118
119 &pcie0 {
120 mt76@0,0 {
121 reg = <0x0000 0 0 0 0>;
122 mediatek,mtd-eeprom = <&factory 0x8000>;
123 ieee80211-freq-limit = <5000000 6000000>;
124 };
125 };
126
127 &pcie1 {
128 mt76@0,0 {
129 reg = <0x0000 0 0 0 0>;
130 mediatek,mtd-eeprom = <&factory 0x0000>;
131 };
132 };
133
134 &gmac0 {
135 nvmem-cells = <&macaddr_factory_e000>;
136 nvmem-cell-names = "mac-address";
137 };
138
139 &switch0 {
140 ports {
141 port@1 {
142 status = "okay";
143 label = "lan2";
144 };
145
146 port@2 {
147 status = "okay";
148 label = "lan1";
149 };
150
151 port@4 {
152 status = "okay";
153 label = "wan";
154 nvmem-cells = <&macaddr_factory_e006>;
155 nvmem-cell-names = "mac-address";
156 };
157 };
158 };
159
160 &state_default {
161 gpio {
162 groups = "jtag", "uart2";
163 function = "gpio";
164 };
165 };
166
167 &factory {
168 compatible = "nvmem-cells";
169 #address-cells = <1>;
170 #size-cells = <1>;
171
172 macaddr_factory_e000: macaddr@e000 {
173 reg = <0xe000 0x6>;
174 };
175
176 macaddr_factory_e006: macaddr@e006 {
177 reg = <0xe006 0x6>;
178 };
179 };