ramips: mt7621: convert to nvmem-layout
[openwrt/staging/stintel.git] / target / linux / ramips / dts / mt7621_iptime_a3002mesh.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 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "iptime,a3002mesh", "mediatek,mt7621-soc";
11 model = "ipTIME A3002MESH";
12
13 aliases {
14 led-boot = &led_cpu;
15 led-failsafe = &led_cpu;
16 led-running = &led_cpu;
17 led-upgrade = &led_cpu;
18 };
19
20 leds {
21 compatible = "gpio-leds";
22
23 led_cpu: led-0 {
24 label = "amber:cpu";
25 color = <LED_COLOR_ID_AMBER>;
26 function = LED_FUNCTION_CPU;
27 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
28 };
29
30 led-1 {
31 color = <LED_COLOR_ID_AMBER>;
32 function = LED_FUNCTION_WLAN;
33 function-enumerator = <0>;
34 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
35 linux,default-trigger = "phy0radio";
36 };
37
38 led-2 {
39 color = <LED_COLOR_ID_AMBER>;
40 function = LED_FUNCTION_WLAN;
41 function-enumerator = <1>;
42 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
43 linux,default-trigger = "phy1radio";
44 };
45 };
46
47 keys {
48 compatible = "gpio-keys";
49
50 reset {
51 label = "reset";
52 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
53 linux,code = <KEY_RESTART>;
54 };
55 };
56 };
57
58 &spi0 {
59 status = "okay";
60
61 flash@0 {
62 compatible = "jedec,spi-nor";
63 reg = <0>;
64 spi-max-frequency = <50000000>;
65
66 partitions {
67 compatible = "fixed-partitions";
68 #address-cells = <1>;
69 #size-cells = <1>;
70
71 partition@0 {
72 label = "u-boot";
73 reg = <0x0 0x20000>;
74 read-only;
75
76 nvmem-layout {
77 compatible = "fixed-layout";
78 #address-cells = <1>;
79 #size-cells = <1>;
80
81 macaddr_uboot_1fc40: macaddr@1fc40 {
82 reg = <0x1fc40 0x6>;
83 };
84 };
85 };
86
87 partition@20000 {
88 label = "config";
89 reg = <0x20000 0x10000>;
90 read-only;
91 };
92
93 factory: partition@30000 {
94 label = "factory";
95 reg = <0x30000 0x10000>;
96 read-only;
97
98 nvmem-layout {
99 compatible = "fixed-layout";
100 #address-cells = <1>;
101 #size-cells = <1>;
102
103 eeprom_factory_0: eeprom@0 {
104 reg = <0x0 0x4da8>;
105 };
106 };
107 };
108
109 partition@40000 {
110 compatible = "denx,uimage";
111 label = "firmware";
112 reg = <0x40000 0xfc0000>;
113 };
114 };
115 };
116 };
117
118 &gmac0 {
119 nvmem-cells = <&macaddr_uboot_1fc40>;
120 nvmem-cell-names = "mac-address";
121 mac-address-increment = <(2)>;
122 };
123
124 &gmac1 {
125 status = "okay";
126 label = "wan";
127 phy-handle = <&ethphy0>;
128
129 nvmem-cells = <&macaddr_uboot_1fc40>;
130 nvmem-cell-names = "mac-address";
131 };
132
133 &mdio {
134 ethphy0: ethernet-phy@0 {
135 reg = <0>;
136 };
137 };
138
139 &switch0 {
140 ports {
141 port@3 {
142 status = "okay";
143 label = "lan1";
144 };
145
146 port@4 {
147 status = "okay";
148 label = "lan2";
149 };
150 };
151 };
152
153 &pcie {
154 status = "okay";
155 };
156
157 &pcie0 {
158 wifi@0,0 {
159 compatible = "mediatek,mt76";
160 reg = <0x0000 0 0 0 0>;
161 nvmem-cells = <&eeprom_factory_0>;
162 nvmem-cell-names = "eeprom";
163 };
164 };
165
166 &state_default {
167 gpio {
168 groups = "i2c", "jtag", "wdt";
169 function = "gpio";
170 };
171 };