ramips: mt7621: convert to nvmem-layout
[openwrt/staging/hauke.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 macaddr_factory_4: macaddr@4 {
86 reg = <0x4 0x6>;
87 };
88 };
89 };
90
91 partition@180000 {
92 label = "firmware";
93 reg = <0x180000 0x7680000>;
94
95 compatible = "fixed-partitions";
96 #address-cells = <1>;
97 #size-cells = <1>;
98
99 partition@0 {
100 label = "kernel";
101 reg = <0x0 0x400000>;
102 };
103
104 partition@400000 {
105 label = "ubi";
106 reg = <0x400000 0x7280000>;
107 };
108 };
109 };
110 };
111
112 &state_default {
113 gpio {
114 groups = "i2c", "jtag", "wdt";
115 function = "gpio";
116 };
117 };
118
119 &gmac0 {
120 nvmem-cells = <&macaddr_factory_4>;
121 nvmem-cell-names = "mac-address";
122 mac-address-increment = <3>;
123 };
124
125 &gmac1 {
126 status = "okay";
127 label = "wan";
128 phy-handle = <&ethphy0>;
129
130 nvmem-cells = <&macaddr_factory_4>;
131 nvmem-cell-names = "mac-address";
132 mac-address-increment = <1>;
133 };
134
135 &mdio {
136 ethphy0: ethernet-phy@0 {
137 reg = <0>;
138 };
139 };
140
141 &switch0 {
142 ports {
143 port@1 {
144 status = "okay";
145 label = "lan4";
146 };
147
148 port@2 {
149 status = "okay";
150 label = "lan3";
151 };
152
153 port@3 {
154 status = "okay";
155 label = "lan2";
156 };
157
158 port@4 {
159 status = "okay";
160 label = "lan1";
161 };
162 };
163 };
164
165 &pcie {
166 status = "okay";
167 };
168
169 &pcie1 {
170 wifi@0,0 {
171 compatible = "mediatek,mt76";
172 reg = <0x0000 0 0 0 0>;
173 mediatek,mtd-eeprom = <&factory 0x0>;
174 };
175 };