ramips: mt7620a: convert to nvmem-layout
[openwrt/staging/hauke.git] / target / linux / ramips / dts / mt7620a_dlink_dwr-118-a1.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/mtd/partitions/uimage.h>
8
9 / {
10 compatible = "dlink,dwr-118-a1", "ralink,mt7620a-soc";
11 model = "D-Link DWR-118 A1";
12
13 aliases {
14 led-boot = &led_internet;
15 led-failsafe = &led_internet;
16 led-upgrade = &led_internet;
17 };
18
19 keys {
20 compatible = "gpio-keys";
21
22 wps {
23 label = "wps";
24 gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
25 linux,code = <KEY_WPS_BUTTON>;
26 };
27
28 reset {
29 label = "reset";
30 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_RESTART>;
32 };
33 };
34
35 leds {
36 compatible = "gpio-leds";
37
38 wan {
39 label = "green:wan";
40 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
41 };
42
43 led_internet: internet {
44 label = "green:internet";
45 gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
46 };
47
48 lan {
49 label = "green:lan";
50 gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
51 };
52
53 wlan2g {
54 label = "green:wlan2g";
55 gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
56 };
57
58 usb {
59 label = "green:usb";
60 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
61 trigger-sources = <&ohci_port1>, <&ehci_port1>;
62 linux,default-trigger = "usbport";
63 };
64 };
65
66 gpio_export {
67 compatible = "gpio-export";
68 #size-cells = <0>;
69
70 usb {
71 gpio-export,name = "usb";
72 gpio-export,output = <0>;
73 gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
74 };
75 };
76 };
77
78 &gpio1 {
79 status = "okay";
80 };
81
82 &gpio2 {
83 status = "okay";
84 };
85
86 &gpio3 {
87 status = "okay";
88 };
89
90 &spi0 {
91 status = "okay";
92
93 flash@0 {
94 compatible = "jedec,spi-nor";
95 reg = <0>;
96 spi-max-frequency = <80000000>;
97
98 partitions {
99 compatible = "fixed-partitions";
100 #address-cells = <1>;
101 #size-cells = <1>;
102
103 partition@0 {
104 label = "jboot";
105 reg = <0x0 0x10000>;
106 read-only;
107 };
108
109 partition@10000 {
110 compatible = "openwrt,uimage", "denx,uimage";
111 openwrt,ih-magic = <IH_MAGIC_OKLI>;
112 openwrt,offset = <0x10000>;
113 label = "firmware";
114 reg = <0x10000 0xfe0000>;
115 };
116
117 config: partition@ff0000 {
118 label = "config";
119 reg = <0xff0000 0x10000>;
120 read-only;
121
122 nvmem-layout {
123 compatible = "fixed-layout";
124 #address-cells = <1>;
125 #size-cells = <1>;
126
127 eeprom_config_e083: eeprom@e083 {
128 reg = <0xe083 0x200>;
129 };
130
131 macaddr_config_e496: macaddr@e496 {
132 reg = <0xe496 0x6>;
133 };
134 };
135 };
136 };
137 };
138 };
139
140 &ehci {
141 status = "okay";
142 };
143
144 &ohci {
145 status = "okay";
146 };
147
148 &state_default {
149 default {
150 groups = "ephy", "uartf", "spi refclk", "wled";
151 function = "gpio";
152 };
153 };
154
155 &pcie {
156 status = "okay";
157 };
158
159 &pcie0 {
160 wifi@0,0 {
161 reg = <0x0000 0 0 0 0>;
162 nvmem-cells = <&eeprom_config_e083>, <&macaddr_config_e496>;
163 nvmem-cell-names = "eeprom", "mac-address";
164 mac-address-increment = <(2)>;
165
166 led {
167 led-sources = <0>;
168 led-active-low;
169 };
170 };
171 };
172
173 &ethernet {
174 pinctrl-names = "default";
175 pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
176
177 port@4 {
178 status = "okay";
179 phy-handle = <&phy4>;
180 phy-mode = "rgmii";
181 };
182
183 port@5 {
184 status = "okay";
185 phy-handle = <&phy5>;
186 phy-mode = "rgmii";
187 };
188
189 mdio-bus {
190 status = "okay";
191
192 phy4: ethernet-phy@4 {
193 reg = <4>;
194 phy-mode = "rgmii-rxid";
195 };
196
197 phy5: ethernet-phy@5 {
198 reg = <5>;
199 phy-mode = "rgmii-rxid";
200 };
201 };
202 };
203
204 &gsw {
205 mediatek,port4-gmac;
206 mediatek,ephy-base = /bits/ 8 <8>;
207 };