ramips: convert rt2x00 EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_gehua_ghl-r-001.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "gehua,ghl-r-001", "mediatek,mt7621-soc";
10 model = "GeHua GHL-R-001";
11
12 leds {
13 compatible = "gpio-leds";
14
15 internet {
16 label = "blue:internet";
17 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
18 };
19
20 usb {
21 label = "blue:usb";
22 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
23 trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
24 linux,default-trigger = "usbport";
25 };
26 };
27
28 keys {
29 compatible = "gpio-keys";
30
31 reset {
32 label = "reset";
33 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
34 linux,code = <KEY_RESTART>;
35 };
36 };
37 };
38
39 &uartlite3 {
40 status = "okay";
41 };
42
43 &spi0 {
44 status = "okay";
45
46 flash@0 {
47 compatible = "jedec,spi-nor";
48 reg = <0>;
49 spi-max-frequency = <25000000>;
50 broken-flash-reset;
51 m25p,fast-read;
52
53 partitions {
54 compatible = "fixed-partitions";
55 #address-cells = <1>;
56 #size-cells = <1>;
57
58 partition@0 {
59 label = "u-boot";
60 reg = <0x0 0x30000>;
61 read-only;
62 };
63
64 partition@30000 {
65 label = "u-boot-env";
66 reg = <0x30000 0x10000>;
67 read-only;
68 };
69
70 factory: partition@40000 {
71 compatible = "nvmem-cells";
72 label = "factory";
73 reg = <0x40000 0x10000>;
74 #address-cells = <1>;
75 #size-cells = <1>;
76 read-only;
77
78 eeprom_factory_0: eeprom@0 {
79 reg = <0x0 0x400>;
80 };
81
82 eeprom_factory_8000: eeprom@8000 {
83 reg = <0x8000 0x200>;
84 };
85
86 macaddr_factory_e000: macaddr@e000 {
87 reg = <0xe000 0x6>;
88 };
89 };
90
91 partition@50000 {
92 compatible = "denx,uimage";
93 label = "firmware";
94 reg = <0x50000 0x1fb0000>;
95 };
96 };
97 };
98 };
99
100 &pcie {
101 status = "okay";
102 };
103
104 &pcie0 {
105 wifi@0,0 {
106 reg = <0x0000 0 0 0 0>;
107 nvmem-cells = <&eeprom_factory_0>;
108 nvmem-cell-names = "eeprom";
109 };
110 };
111
112 &pcie1 {
113 wifi@0,0 {
114 reg = <0x0000 0 0 0 0>;
115 nvmem-cells = <&eeprom_factory_8000>;
116 nvmem-cell-names = "eeprom";
117 ieee80211-freq-limit = <5000000 6000000>;
118
119 led {
120 led-sources = <2>;
121 led-active-low;
122 };
123 };
124 };
125
126 &gmac0 {
127 nvmem-cells = <&macaddr_factory_e000>;
128 nvmem-cell-names = "mac-address";
129 };
130
131 &gmac1 {
132 status = "okay";
133 label = "wan";
134 phy-handle = <&ethphy4>;
135
136 nvmem-cells = <&macaddr_factory_e000>;
137 nvmem-cell-names = "mac-address";
138 mac-address-increment = <1>;
139 };
140
141 &mdio {
142 ethphy4: ethernet-phy@4 {
143 reg = <4>;
144 };
145 };
146
147 &switch0 {
148 ports {
149 port@0 {
150 status = "okay";
151 label = "lan1";
152 };
153
154 port@1 {
155 status = "okay";
156 label = "lan2";
157 };
158
159 port@2 {
160 status = "okay";
161 label = "lan3";
162 };
163 };
164 };
165
166 &state_default {
167 gpio {
168 groups = "jtag", "wdt";
169 function = "gpio";
170 };
171 };