ramips: convert rt2x00 EEPROM to NVMEM format
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / mt7620a_netgear_wn3x00rp.dtsi
1 /* This file is released into the public domain */
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 aliases {
10 led-boot = &led_power_green;
11 led-failsafe = &led_power_green;
12 led-running = &led_power_green;
13 led-upgrade = &led_power_green;
14 };
15
16 keys {
17 compatible = "gpio-keys";
18
19 reset {
20 label = "reset";
21 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
22 linux,code = <KEY_RESTART>;
23 };
24
25 wps {
26 label = "wps";
27 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
28 linux,code = <KEY_WPS_BUTTON>;
29 };
30 };
31
32 leds {
33 compatible = "gpio-leds";
34
35 led_power_green: power_g {
36 label = "green:power";
37 gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
38 default-state = "on";
39 };
40
41 power_r {
42 label = "red:power";
43 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
44 };
45
46 client_g {
47 label = "green:client";
48 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
49 };
50
51 client_r {
52 label = "red:client";
53 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
54 };
55
56 router_g {
57 label = "green:router";
58 gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
59 };
60
61 router_r {
62 label = "red:router";
63 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
64 };
65
66 wps {
67 label = "green:wps";
68 gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
69 };
70
71 l_arrow {
72 label = "blue:leftarrow";
73 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
74 };
75
76 r_arrow {
77 label = "blue:rightarrow";
78 gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
79 };
80 };
81 };
82
83 &gpio1 {
84 status = "okay";
85 };
86
87 &spi0 {
88 status = "okay";
89
90 flash@0 {
91 compatible = "jedec,spi-nor";
92 reg = <0>;
93 spi-max-frequency = <10000000>;
94
95 partitions {
96 compatible = "fixed-partitions";
97 #address-cells = <1>;
98 #size-cells = <1>;
99
100 partition@0 {
101 label = "u-boot";
102 reg = <0x0 0x30000>;
103 read-only;
104 };
105
106 partition@30000 {
107 label = "u-boot-env";
108 reg = <0x30000 0x10000>;
109 read-only;
110 };
111
112 partition@40000 {
113 compatible = "denx,uimage";
114 label = "firmware";
115 reg = <0x40000 0x7b0000>;
116 };
117
118 art: partition@7f0000 {
119 compatible = "nvmem-cells";
120 label = "art";
121 reg = <0x7f0000 0x10000>;
122 #address-cells = <1>;
123 #size-cells = <1>;
124 read-only;
125
126 macaddr_art_0: macaddr@0 {
127 reg = <0x0 0x6>;
128 };
129
130 macaddr_art_6: macaddr@6 {
131 reg = <0x6 0x6>;
132 };
133
134 eeprom_art_1000: eeprom@1000 {
135 reg = <0x1000 0x200>;
136 };
137 };
138 };
139 };
140 };
141
142 &ethernet {
143 nvmem-cells = <&macaddr_art_0>;
144 nvmem-cell-names = "mac-address";
145 };
146
147 &wmac {
148 nvmem-cells = <&eeprom_art_1000>, <&macaddr_art_6>;
149 nvmem-cell-names = "eeprom", "mac-address";
150 };
151
152 &state_default {
153 default {
154 groups = "i2c", "uartf", "spi refclk";
155 function = "gpio";
156 };
157 };