ramips: mt7621: convert MT7915 EEPROM to NVMEM format
[openwrt/staging/dangole.git] / target / linux / ramips / dts / mt7621_iptime_ax2004m.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 = "iptime,ax2004m", "mediatek,mt7621-soc";
10 model = "ipTIME AX2004M";
11
12 aliases {
13 led-boot = &led_cpu;
14 led-failsafe = &led_cpu;
15 led-running = &led_cpu;
16 led-upgrade = &led_cpu;
17 };
18
19 chosen {
20 bootargs = "console=ttyS0,115200";
21 };
22
23 leds {
24 compatible = "gpio-leds";
25
26 led_cpu: cpu {
27 label = "amber:cpu";
28 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
29 };
30
31 wlan2g {
32 label = "amber:wlan2g";
33 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
34 linux,default-trigger = "phy0radio";
35 };
36
37 wlan5g {
38 label = "amber:wlan5g";
39 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
40 linux,default-trigger = "phy1radio";
41 };
42 };
43
44 keys {
45 compatible = "gpio-keys";
46
47 reset {
48 label = "reset";
49 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
50 linux,code = <KEY_RESTART>;
51 };
52 };
53 };
54
55 &nand {
56 status = "okay";
57
58 partitions {
59 compatible = "fixed-partitions";
60 #address-cells = <1>;
61 #size-cells = <1>;
62
63 partition@0 {
64 label = "u-boot";
65 reg = <0x0 0x80000>;
66 read-only;
67 };
68
69 partition@80000 {
70 label = "config";
71 reg = <0x80000 0x80000>;
72 read-only;
73 };
74
75 factory: partition@100000 {
76 label = "factory";
77 reg = <0x100000 0x80000>;
78 read-only;
79
80 nvmem-layout {
81 compatible = "fixed-layout";
82 #address-cells = <1>;
83 #size-cells = <1>;
84
85 eeprom_factory_0: eeprom@0 {
86 reg = <0x0 0xe00>;
87 };
88
89 macaddr_factory_4: macaddr@4 {
90 compatible = "mac-base";
91 reg = <0x4 0x6>;
92 #nvmem-cell-cells = <1>;
93 };
94
95 precal_factory_e10: precal@e10 {
96 reg = <0xe10 0x19c10>;
97 };
98 };
99 };
100
101 partition@180000 {
102 label = "firmware";
103 reg = <0x180000 0x7680000>;
104
105 compatible = "fixed-partitions";
106 #address-cells = <1>;
107 #size-cells = <1>;
108
109 partition@0 {
110 label = "kernel";
111 reg = <0x0 0x400000>;
112 };
113
114 partition@400000 {
115 label = "ubi";
116 reg = <0x400000 0x7280000>;
117 };
118 };
119 };
120 };
121
122 &state_default {
123 gpio {
124 groups = "i2c", "jtag", "wdt";
125 function = "gpio";
126 };
127 };
128
129 &gmac0 {
130 nvmem-cells = <&macaddr_factory_4 3>;
131 nvmem-cell-names = "mac-address";
132 };
133
134 &gmac1 {
135 status = "okay";
136 label = "wan";
137 phy-handle = <&ethphy0>;
138
139 nvmem-cells = <&macaddr_factory_4 1>;
140 nvmem-cell-names = "mac-address";
141 };
142
143 &mdio {
144 ethphy0: ethernet-phy@0 {
145 reg = <0>;
146 };
147 };
148
149 &switch0 {
150 ports {
151 port@1 {
152 status = "okay";
153 label = "lan4";
154 };
155
156 port@2 {
157 status = "okay";
158 label = "lan3";
159 };
160
161 port@3 {
162 status = "okay";
163 label = "lan2";
164 };
165
166 port@4 {
167 status = "okay";
168 label = "lan1";
169 };
170 };
171 };
172
173 &pcie {
174 status = "okay";
175 };
176
177 &pcie1 {
178 wifi@0,0 {
179 compatible = "mediatek,mt76";
180 reg = <0x0000 0 0 0 0>;
181 nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>;
182 nvmem-cell-names = "eeprom", "precal";
183 };
184 };