ramips: mt7620a: convert to nvmem-layout
[openwrt/staging/hauke.git] / target / linux / ramips / dts / mt7620a_netgear_ex3x00_ex61xx.dtsi
1 #include "mt7620a.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 aliases {
8 led-boot = &led_power_amber;
9 led-failsafe = &led_power_amber;
10 led-running = &led_power_green;
11 led-upgrade = &led_power_green;
12 };
13
14 keys {
15 compatible = "gpio-keys";
16
17 reset {
18 label = "reset";
19 gpios = <&gpio2 26 GPIO_ACTIVE_LOW>;
20 linux,code = <KEY_RESTART>;
21 };
22
23 wps {
24 label = "wps";
25 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
26 linux,code = <KEY_WPS_BUTTON>;
27 };
28 };
29
30 leds {
31 compatible = "gpio-leds";
32
33 led_power_green: power_green {
34 label = "green:power";
35 gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
36 default-state = "on";
37 };
38
39 led_power_amber: power_amber {
40 label = "amber:power";
41 gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
42 };
43
44 router_green {
45 label = "green:router";
46 gpios = <&gpio2 25 GPIO_ACTIVE_LOW>;
47 };
48
49 router_red {
50 label = "red:router";
51 gpios = <&gpio2 24 GPIO_ACTIVE_LOW>;
52 };
53
54 device_green {
55 label = "green:device";
56 gpios = <&gpio2 20 GPIO_ACTIVE_LOW>;
57 };
58
59 device_red {
60 label = "red:device";
61 gpios = <&gpio2 21 GPIO_ACTIVE_LOW>;
62 };
63
64 wps {
65 label = "green:wps";
66 gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
67 };
68 };
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 = <50000000>;
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 = "config";
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 nvmem-layout {
106 compatible = "fixed-layout";
107 #address-cells = <1>;
108 #size-cells = <1>;
109
110 eeprom_factory_0: eeprom@0 {
111 reg = <0x0 0x200>;
112 };
113
114 eeprom_factory_8000: eeprom@8000 {
115 reg = <0x8000 0x200>;
116 };
117
118 macaddr_factory_28: macaddr@28 {
119 reg = <0x28 0x6>;
120 };
121 };
122 };
123
124 partition@50000 {
125 compatible = "denx,uimage";
126 label = "firmware";
127 reg = <0x50000 0x790000>;
128 };
129
130 partition@7e0000 {
131 label = "board_data";
132 reg = <0x7e0000 0x10000>;
133 read-only;
134 };
135
136 partition@7f0000 {
137 label = "nvram";
138 reg = <0x7f0000 0x10000>;
139 read-only;
140 };
141 };
142 };
143 };
144
145 &pcie {
146 status = "okay";
147 };
148
149 &pcie0 {
150 mt76@0,0 {
151 reg = <0x0000 0 0 0 0>;
152 nvmem-cells = <&eeprom_factory_8000>;
153 nvmem-cell-names = "eeprom";
154 ieee80211-freq-limit = <5000000 6000000>;
155 };
156 };
157
158 &ethernet {
159 nvmem-cells = <&macaddr_factory_28>;
160 nvmem-cell-names = "mac-address";
161 };
162
163 &wmac {
164 nvmem-cells = <&eeprom_factory_0>;
165 nvmem-cell-names = "eeprom";
166 };
167
168 &state_default {
169 default {
170 groups = "i2c", "rgmii2", "spi refclk";
171 function = "gpio";
172 };
173 };
174