mediatek: convert to new LED color/function format where possible
[openwrt/staging/mans0n.git] / target / linux / mediatek / dts / mt7629-tplink_eap225-v5.dts
1 // SPDX-License-Identifier: GPL-2.0
2
3 /dts-v1/;
4 #include <dt-bindings/input/input.h>
5 #include <dt-bindings/leds/common.h>
6 #include "mt7629.dtsi"
7
8 / {
9 model = "TP-Link EAP225 v5";
10 compatible = "tplink,eap225-v5", "mediatek,mt7629";
11
12 aliases {
13 led-boot = &led_status_green;
14 led-failsafe = &led_status_amber;
15 led-running = &led_status_green;
16 led-upgrade = &led_status_amber;
17 serial0 = &uart0;
18 };
19
20 chosen {
21 stdout-path = "serial0:115200n8";
22 bootargs-override = "console=ttyS0,115200n8";
23 };
24
25 keys {
26 compatible = "gpio-keys";
27
28 reset {
29 label = "reset";
30 gpios = <&pio 21 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_RESTART>;
32 };
33 };
34
35 leds {
36 compatible = "gpio-leds";
37
38 led_status_green: status_green {
39 function = LED_FUNCTION_STATUS;
40 color = <LED_COLOR_ID_GREEN>;
41 gpios = <&pio 55 GPIO_ACTIVE_HIGH>;
42 default-state = "on";
43 };
44
45 led_status_amber: status_amber {
46 function = LED_FUNCTION_STATUS;
47 color = <LED_COLOR_ID_AMBER>;
48 gpios = <&pio 56 GPIO_ACTIVE_HIGH>;
49 };
50 };
51 };
52
53 &eth {
54 pinctrl-names = "default";
55 pinctrl-0 = <&eth_pins>;
56 pinctrl-1 = <&ephy_leds_pins>;
57 status = "okay";
58
59 mac@1 {
60 compatible = "mediatek,eth-mac";
61 reg = <1>;
62 phy-mode = "gmii";
63 phy-handle = <&phy0>;
64 nvmem-cells = <&macaddr_factory_8>;
65 nvmem-cell-names = "mac-address";
66 };
67
68 mdio-bus {
69 #address-cells = <1>;
70 #size-cells = <0>;
71
72 phy0: ethernet-phy@0 {
73 reg = <0>;
74 };
75 };
76 };
77
78 &qspi {
79 status = "okay";
80
81 pinctrl-names = "default";
82 pinctrl-0 = <&qspi_pins>;
83
84 flash@0 {
85 compatible = "jedec,spi-nor";
86 reg = <0>;
87
88 partitions {
89 compatible = "fixed-partitions";
90 #address-cells = <1>;
91 #size-cells = <1>;
92
93 partition@0 {
94 label = "Bootloader";
95 reg = <0x0 0x00080000>;
96 read-only;
97 };
98
99 partition@80000 {
100 label = "Partition";
101 reg = <0x00080000 0x00010000>;
102 read-only;
103 };
104
105 partition@90000 {
106 label = "Factory";
107 reg = <0x00090000 0x00010000>;
108 read-only;
109
110 nvmem-layout {
111 compatible = "fixed-layout";
112 #address-cells = <1>;
113 #size-cells = <1>;
114
115 macaddr_factory_8: macaddr@8 {
116 reg = <0x8 0x6>;
117 };
118 };
119 };
120
121 partition@A0000 {
122 label = "Radio";
123 reg = <0x000A0000 0x00010000>;
124 read-only;
125 };
126
127 partition@B0000 {
128 label = "Extra";
129 reg = <0x000B0000 0x00010000>;
130 read-only;
131 };
132
133 /* Vendor layout: kernel (0x000C0000 0x001A0000) - rootfs (0x00260000 0x00BE0000) */
134 /* OpenWrt flash layout: combine kernel and rootfs from OEM layout */
135 partition@C0000 {
136 label = "firmware";
137 reg = <0x000C0000 0x00D80000>;
138 };
139
140 partition@E40000 {
141 label = "Config";
142 reg = <0x00E40000 0x0001B0000>;
143 read-only;
144 };
145 };
146 };
147 };
148
149 &pio {
150 eth_pins: eth-pins {
151 mux {
152 function = "eth";
153 groups = "mdc_mdio";
154 };
155 };
156
157 ephy_leds_pins: ephy-leds-pins {
158 mux {
159 function = "led";
160 groups = "ephy_leds";
161 };
162 };
163
164 qspi_pins: qspi-pins {
165 mux {
166 function = "flash";
167 groups = "spi_nor";
168 };
169 };
170
171 uart0_pins: uart0-pins {
172 mux {
173 function = "uart";
174 groups = "uart0_txd_rxd" ;
175 };
176 };
177
178 watchdog_pins: watchdog-pins {
179 mux {
180 function = "watchdog";
181 groups = "watchdog";
182 };
183 };
184 };
185
186 &uart0 {
187 pinctrl-names = "default";
188 pinctrl-0 = <&uart0_pins>;
189 status = "okay";
190 };
191
192 &watchdog {
193 pinctrl-names = "default";
194 pinctrl-0 = <&watchdog_pins>;
195 status = "okay";
196 };