ramips: mt7620a: convert to nvmem-layout
[openwrt/staging/hauke.git] / target / linux / ramips / dts / mt7620a_domywifi.dtsi
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
8 / {
9 aliases {
10 led-boot = &led_system_amber;
11 led-failsafe = &led_system_amber;
12 led-running = &led_system_green;
13 led-upgrade = &led_system_amber;
14 };
15
16 keys {
17 compatible = "gpio-keys";
18
19 reset {
20 label = "reset";
21 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
22 linux,code = <KEY_RESTART>;
23 };
24 };
25
26 leds {
27 compatible = "gpio-leds";
28
29 led_system_green: system_green {
30 label = "green:system";
31 gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
32 };
33
34 led_system_amber: system_amber {
35 label = "amber:system";
36 gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
37 };
38
39 internet_green {
40 label = "green:internet";
41 gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
42 };
43
44 internet_amber {
45 label = "amber:internet";
46 gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
47 };
48
49 lan1 {
50 label = "amber:lan1";
51 gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
52 };
53
54 lan2 {
55 label = "amber:lan2";
56 gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
57 };
58
59 lan3 {
60 label = "amber:lan3";
61 gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
62 };
63
64 lan4 {
65 label = "amber:lan4";
66 gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
67 };
68
69 wan {
70 label = "amber:wan";
71 gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
72 };
73
74 wlan2g {
75 label = "green:wlan2g";
76 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
77 linux,default-trigger = "phy1tpt";
78 };
79 };
80 };
81
82 &gpio1 {
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 m25p,fast-read;
98
99 partitions {
100 compatible = "fixed-partitions";
101 #address-cells = <1>;
102 #size-cells = <1>;
103
104 partition@0 {
105 label = "bootloader";
106 reg = <0x0 0x30000>;
107 read-only;
108 };
109
110 partition@30000 {
111 label = "config";
112 reg = <0x30000 0x10000>;
113 read-only;
114 };
115
116 factory: partition@40000 {
117 label = "factory";
118 reg = <0x40000 0x10000>;
119 read-only;
120
121 nvmem-layout {
122 compatible = "fixed-layout";
123 #address-cells = <1>;
124 #size-cells = <1>;
125
126 eeprom_factory_0: eeprom@0 {
127 reg = <0x0 0x200>;
128 };
129
130 eeprom_factory_8000: eeprom@8000 {
131 reg = <0x8000 0x200>;
132 };
133
134 macaddr_factory_28: macaddr@28 {
135 reg = <0x28 0x6>;
136 };
137 };
138 };
139
140 partition@50000 {
141 compatible = "denx,uimage";
142 label = "firmware";
143 reg = <0x50000 0xfb0000>;
144 };
145 };
146 };
147 };
148
149 &state_default {
150 gpio {
151 groups = "uartf", "rgmii1", "wled";
152 function = "gpio";
153 };
154 };
155
156 &ethernet {
157 pinctrl-names = "default";
158 pinctrl-0 = <&ephy_pins>;
159
160 mediatek,portmap = "wllll";
161
162 nvmem-cells = <&macaddr_factory_28>;
163 nvmem-cell-names = "mac-address";
164 };
165
166 &sdhci {
167 status = "okay";
168 };
169
170 &ehci {
171 status = "okay";
172 };
173
174 &ohci {
175 status = "okay";
176 };
177
178 &pcie {
179 status = "okay";
180 };
181
182 &pcie0 {
183 wifi@0,0 {
184 reg = <0x0000 0 0 0 0>;
185 nvmem-cells = <&eeprom_factory_8000>;
186 nvmem-cell-names = "eeprom";
187 ieee80211-freq-limit = <5000000 6000000>;
188
189 led {
190 led-sources = <0>;
191 led-active-low;
192 };
193 };
194 };
195
196 &wmac {
197 nvmem-cells = <&eeprom_factory_0>;
198 nvmem-cell-names = "eeprom";
199 };