ramips: convert rt2x00 EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620n_elecom_wrh-300cr.dts
1 #include "mt7620n.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "elecom,wrh-300cr", "ralink,mt7620n-soc";
8 model = "ELECOM WRH-300CR";
9
10 aliases {
11 led-boot = &led_wps;
12 led-failsafe = &led_wps;
13 led-running = &led_wps;
14 led-upgrade = &led_wps;
15 };
16
17 leds {
18 compatible = "gpio-leds";
19
20 led_wps: wps {
21 label = "green:wps";
22 gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
23 };
24
25 ethernet {
26 label = "green:ethernet";
27 gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
28 };
29
30 wlan {
31 label = "green:wlan";
32 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
33 };
34 };
35
36 keys {
37 compatible = "gpio-keys";
38
39 reset {
40 label = "reset";
41 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
42 linux,code = <KEY_RESTART>;
43 };
44
45 wps {
46 label = "wps";
47 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
48 linux,code = <KEY_WPS_BUTTON>;
49 };
50 };
51 };
52
53 &gpio2 {
54 status = "okay";
55 };
56
57 &gpio3 {
58 status = "okay";
59 };
60
61 &spi0 {
62 status = "okay";
63
64 flash@0 {
65 compatible = "jedec,spi-nor";
66 reg = <0>;
67 spi-max-frequency = <10000000>;
68
69 partitions {
70 compatible = "fixed-partitions";
71 #address-cells = <1>;
72 #size-cells = <1>;
73
74 partition@0 {
75 label = "u-boot";
76 reg = <0x0 0x30000>;
77 read-only;
78 };
79
80 partition@30000 {
81 label = "u-boot-env";
82 reg = <0x30000 0x10000>;
83 };
84
85 factory: partition@40000 {
86 compatible = "nvmem-cells";
87 label = "factory";
88 reg = <0x40000 0x10000>;
89 #address-cells = <1>;
90 #size-cells = <1>;
91 read-only;
92
93 eeprom_factory_0: eeprom@0 {
94 reg = <0x0 0x200>;
95 };
96
97 macaddr_factory_2e: macaddr@2e {
98 reg = <0x2e 0x6>;
99 };
100 };
101
102 partition@50000 {
103 label = "recover";
104 reg = <0x50000 0x1c0000>;
105 read-only;
106 };
107
108 partition@210000 {
109 compatible = "denx,uimage";
110 label = "firmware";
111 reg = <0x210000 0xdf0000>;
112 };
113 };
114 };
115 };
116
117 &ehci {
118 status = "okay";
119 };
120
121 &ohci {
122 status = "okay";
123 };
124
125 &ethernet {
126 nvmem-cells = <&macaddr_factory_2e>;
127 nvmem-cell-names = "mac-address";
128
129 mediatek,portmap = "llllw";
130 };
131
132 &wmac {
133 nvmem-cells = <&eeprom_factory_0>;
134 nvmem-cell-names = "eeprom";
135 };
136
137 &state_default {
138 default {
139 groups = "i2c", "ephy", "wled";
140 function = "gpio";
141 };
142 };