ramips: fix nvmem-cells for routers based on TP-Link Archer
[openwrt/openwrt.git] / target / linux / ramips / dts / rt3662_omnima_hpm.dts
1 #include "rt3883.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5 #include <dt-bindings/leds/common.h>
6
7 / {
8 compatible = "omnima,hpm", "ralink,rt3662-soc", "ralink,rt3883-soc";
9 model = "Omnima HPM";
10
11 aliases {
12 led-boot = &led_status;
13 led-failsafe = &led_status;
14 led-running = &led_status;
15 led-upgrade = &led_status;
16 };
17
18 chosen {
19 bootargs = "console=ttyS0,115200";
20 };
21
22 keys {
23 compatible = "gpio-keys-polled";
24 poll-interval = <100>;
25
26 reset {
27 label = "reset";
28 gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
29 linux,code = <KEY_RESTART>;
30 };
31 };
32
33 leds {
34 compatible = "gpio-leds";
35
36 power {
37 function = LED_FUNCTION_POWER;
38 color = <LED_COLOR_ID_ORANGE>;
39 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
40 default-state = "on";
41 };
42
43 led_status: status {
44 function = LED_FUNCTION_STATUS;
45 color = <LED_COLOR_ID_GREEN>;
46 gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
47 default-state = "on";
48 };
49
50 eth {
51 label = "green:eth";
52 gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
53 };
54
55 eth2 {
56 label = "red:eth";
57 gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
58 };
59
60 wifi {
61 label = "green:wifi";
62 gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
63 };
64
65 wifi2 {
66 label = "red:wifi";
67 gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
68 };
69 };
70
71 gpio_export {
72 compatible = "gpio-export";
73 #size-cells = <0>;
74 /* gpio 12 and 13 handle the OC input */
75
76 usb0 {
77 gpio-export,name = "usb0";
78 gpio-export,output = <1>;
79 gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
80 };
81
82 usb1 {
83 gpio-export,name = "usb1";
84 gpio-export,output = <1>;
85 gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
86 };
87 };
88 };
89
90 &spi0 {
91 status = "okay";
92
93 flash@0 {
94 compatible = "jedec,spi-nor";
95 spi-max-frequency = <25000000>;
96 reg = <0>;
97
98 partitions {
99 compatible = "fixed-partitions";
100 #address-cells = <1>;
101 #size-cells = <1>;
102
103 partition@0 {
104 reg = <0x0 0x0030000>;
105 label = "u-boot";
106 read-only;
107 };
108
109 partition@30000 {
110 reg = <0x00030000 0x00010000>;
111 label = "config";
112 read-only;
113 };
114
115 partition@40000 {
116 reg = <0x00040000 0x00010000>;
117 label = "factory";
118 read-only;
119
120 nvmem-layout {
121 compatible = "fixed-layout";
122 #address-cells = <1>;
123 #size-cells = <1>;
124
125 eeprom_factory_0: eeprom@0 {
126 reg = <0x0 0x200>;
127 };
128
129 macaddr_factory_28: macaddr@28 {
130 reg = <0x28 0x6>;
131 };
132 };
133 };
134
135 partition@50000 {
136 compatible = "denx,uimage";
137 reg = <0x00050000 0x00fb0000>;
138 label = "firmware";
139 };
140 };
141 };
142 };
143
144 &state_default {
145 gpio {
146 groups = "i2c", "jtag", "uartf";
147 function = "gpio";
148 };
149 };
150
151 &ethernet {
152 phy-handle = <&phy0>;
153 phy-mode = "rgmii";
154 nvmem-cells = <&macaddr_factory_28>;
155 nvmem-cell-names = "mac-address";
156
157 mdio-bus {
158 status = "okay";
159
160 phy0: ethernet-phy@4 {
161 reg = <4>;
162 };
163 };
164 };
165
166 &wmac {
167 nvmem-cells = <&eeprom_factory_0>;
168 nvmem-cell-names = "eeprom";
169 };
170
171 &ehci {
172 status = "okay";
173 };
174
175 &ohci {
176 status = "okay";
177 };