ramips: convert to new LED color/function format where possible
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7620a_netcore_nw5212.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620a.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 = "netcore,nw5212", "ralink,mt7620a-soc";
11 model = "Netcore NW5212";
12
13 aliases {
14 label-mac-device = &ethernet;
15 };
16
17 leds {
18 compatible = "gpio-leds";
19
20 lan4 {
21 label = "green:lan4";
22 gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
23 };
24
25 lan3 {
26 label = "green:lan3";
27 gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
28 };
29
30 lan2 {
31 label = "green:lan2";
32 gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
33 };
34
35 lan1 {
36 label = "green:lan1";
37 gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
38 };
39
40 wan {
41 function = LED_FUNCTION_WAN;
42 color = <LED_COLOR_ID_GREEN>;
43 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
44 };
45
46 wlan2g {
47 label = "green:wlan2g";
48 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
49 linux,default-trigger = "phy0tpt";
50 };
51 };
52
53 keys {
54 compatible = "gpio-keys";
55
56 reset {
57 label = "reset";
58 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
59 linux,code = <KEY_RESTART>;
60 };
61 };
62 };
63
64 &gpio2 {
65 status = "okay";
66 };
67
68 &gpio3 {
69 status = "okay";
70 };
71
72 &spi0 {
73 status = "okay";
74
75 flash@0 {
76 compatible = "jedec,spi-nor";
77 reg = <0>;
78 spi-max-frequency = <70000000>;
79 m25p,fast-read;
80
81 partitions {
82 compatible = "fixed-partitions";
83 #address-cells = <1>;
84 #size-cells = <1>;
85
86 partition@0 {
87 label = "u-boot";
88 reg = <0x0 0x30000>;
89 read-only;
90 };
91
92 partition@30000 {
93 label = "u-boot-env";
94 reg = <0x30000 0x10000>;
95 };
96
97 factory: partition@40000 {
98 label = "factory";
99 reg = <0x40000 0x10000>;
100 read-only;
101
102 nvmem-layout {
103 compatible = "fixed-layout";
104 #address-cells = <1>;
105 #size-cells = <1>;
106
107 eeprom_factory_0: eeprom@0 {
108 reg = <0x0 0x200>;
109 };
110
111 macaddr_factory_28: macaddr@28 {
112 reg = <0x28 0x6>;
113 };
114 };
115 };
116
117 partition@50000 {
118 compatible = "denx,uimage";
119 label = "firmware";
120 reg = <0x50000 0xfb0000>;
121 };
122 };
123 };
124 };
125
126 &state_default {
127 gpio {
128 groups = "uartf", "wled", "ephy";
129 function = "gpio";
130 };
131 };
132
133 &ethernet {
134 mediatek,portmap = "llllw";
135 nvmem-cells = <&macaddr_factory_28>;
136 nvmem-cell-names = "mac-address";
137 };
138
139 &ehci {
140 status = "okay";
141 };
142
143 &ohci {
144 status = "okay";
145 };
146
147 &wmac {
148 nvmem-cells = <&eeprom_factory_0>;
149 nvmem-cell-names = "eeprom";
150 };