ramips: convert rt2x00 EEPROM to NVMEM format
[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 compatible = "nvmem-cells";
102 label = "factory";
103 reg = <0x40000 0x10000>;
104 #address-cells = <1>;
105 #size-cells = <1>;
106 read-only;
107
108 eeprom_factory_0: eeprom@0 {
109 reg = <0x0 0x200>;
110 };
111
112 macaddr_factory_28: macaddr@28 {
113 reg = <0x28 0x6>;
114 };
115 };
116
117 partition@50000 {
118 compatible = "denx,uimage";
119 label = "firmware";
120 reg = <0x50000 0x790000>;
121 };
122
123 partition@7e0000 {
124 label = "board_data";
125 reg = <0x7e0000 0x10000>;
126 read-only;
127 };
128
129 partition@7f0000 {
130 label = "nvram";
131 reg = <0x7f0000 0x10000>;
132 read-only;
133 };
134 };
135 };
136 };
137
138 &pcie {
139 status = "okay";
140 };
141
142 &pcie0 {
143 mt76@0,0 {
144 reg = <0x0000 0 0 0 0>;
145 mediatek,mtd-eeprom = <&factory 0x8000>;
146 ieee80211-freq-limit = <5000000 6000000>;
147 };
148 };
149
150 &ethernet {
151 nvmem-cells = <&macaddr_factory_28>;
152 nvmem-cell-names = "mac-address";
153 };
154
155 &wmac {
156 nvmem-cells = <&eeprom_factory_0>;
157 nvmem-cell-names = "eeprom";
158 };
159
160 &state_default {
161 default {
162 groups = "i2c", "rgmii2", "spi refclk";
163 function = "gpio";
164 };
165 };
166