ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_alfa-network_ac1200rm.dts
1 // SPDX-License-Identifier: BSD-3-Clause
2 /*
3 * Copyright (C) 2018 Piotr Dymacz <pepe2k@gmail.com>
4 * All rights reserved.
5 */
6
7 #include "mt7620a.dtsi"
8
9 #include <dt-bindings/gpio/gpio.h>
10 #include <dt-bindings/input/input.h>
11 #include <dt-bindings/leds/common.h>
12
13 / {
14 compatible = "alfa-network,ac1200rm", "ralink,mt7620a-soc";
15 model = "ALFA Network AC1200RM";
16
17 aliases {
18 led-boot = &led_wps;
19 led-failsafe = &led_wps;
20 };
21
22 chosen {
23 bootargs = "console=ttyS0,115200";
24 };
25
26 keys {
27 compatible = "gpio-keys";
28
29 reset {
30 label = "reset";
31 gpios = <&gpio2 15 GPIO_ACTIVE_LOW>;
32 linux,code = <KEY_RESTART>;
33 };
34 };
35
36 leds {
37 compatible = "gpio-leds";
38
39 wlan2g {
40 label = "green:wlan2g";
41 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
42 };
43
44 led_wps: wps {
45 function = LED_FUNCTION_WPS;
46 color = <LED_COLOR_ID_GREEN>;
47 gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
48 };
49 };
50 };
51
52 &ehci {
53 status = "okay";
54 };
55
56 &ethernet {
57 pinctrl-names = "default";
58 pinctrl-0 = <&ephy_pins>;
59
60 nvmem-cells = <&macaddr_factory_28>;
61 nvmem-cell-names = "mac-address";
62
63 mediatek,portmap = "llllw";
64 };
65
66 &gpio1 {
67 status = "okay";
68 };
69
70 &gpio2 {
71 status = "okay";
72 };
73
74 &gpio3 {
75 status = "okay";
76 };
77
78 &ohci {
79 status = "okay";
80 };
81
82 &pcie {
83 status = "okay";
84 };
85
86 &pcie0 {
87 mt76@0,0 {
88 reg = <0x0000 0 0 0 0>;
89 nvmem-cells = <&eeprom_factory_8000>;
90 nvmem-cell-names = "eeprom";
91 ieee80211-freq-limit = <5000000 6000000>;
92
93 led {
94 led-sources = <2>;
95 led-active-low;
96 };
97 };
98 };
99
100 &state_default {
101 gpio {
102 groups = "nd_sd", "spi refclk", "wled";
103 function = "gpio";
104 };
105 };
106
107 &spi0 {
108 status = "okay";
109
110 flash@0 {
111 compatible = "jedec,spi-nor";
112 reg = <0>;
113 spi-max-frequency = <10000000>;
114
115 partitions {
116 compatible = "fixed-partitions";
117 #address-cells = <1>;
118 #size-cells = <1>;
119
120 partition@0 {
121 label = "u-boot";
122 reg = <0x0 0x30000>;
123 read-only;
124 };
125
126 partition@30000 {
127 label = "u-boot-env";
128 reg = <0x30000 0x1000>;
129 };
130
131 partition@31000 {
132 label = "config";
133 reg = <0x31000 0xf000>;
134 read-only;
135 };
136
137 factory: partition@40000 {
138 label = "factory";
139 reg = <0x40000 0x10000>;
140 read-only;
141
142 nvmem-layout {
143 compatible = "fixed-layout";
144 #address-cells = <1>;
145 #size-cells = <1>;
146
147 eeprom_factory_0: eeprom@0 {
148 reg = <0x0 0x200>;
149 };
150
151 eeprom_factory_8000: eeprom@8000 {
152 reg = <0x8000 0x200>;
153 };
154
155 macaddr_factory_28: macaddr@28 {
156 reg = <0x28 0x6>;
157 };
158 };
159 };
160
161 partition@50000 {
162 compatible = "denx,uimage";
163 label = "firmware";
164 reg = <0x50000 0xfb0000>;
165 };
166 };
167 };
168 };
169
170 &wmac {
171 nvmem-cells = <&eeprom_factory_0>;
172 nvmem-cell-names = "eeprom";
173 };