ramips: add support for indicating the boot state using multiple leds
[openwrt/staging/mkresin.git] / target / linux / ramips / dts / AC1200RM.dts
1 /*
2 * BSD LICENSE
3 *
4 * Copyright (C) 2018 Piotr Dymacz <pepe2k@gmail.com>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the names of the copyright holders nor the names of any
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33 /dts-v1/;
34
35 #include "mt7620a.dtsi"
36
37 #include <dt-bindings/gpio/gpio.h>
38 #include <dt-bindings/input/input.h>
39
40 / {
41 compatible = "alfa-network,ac1200rm", "ralink,mt7620a-soc";
42 model = "ALFA Network AC1200RM";
43
44 aliases {
45 led-boot = &led_wps;
46 led-failsafe = &led_wps;
47 led-running = &led_wps;
48 led-upgrade = &led_wps;
49 };
50
51 chosen {
52 bootargs = "console=ttyS0,115200";
53 };
54
55 gpio-keys-polled {
56 compatible = "gpio-keys-polled";
57 poll-interval = <20>;
58
59 reset {
60 label = "reset";
61 gpios = <&gpio2 15 GPIO_ACTIVE_LOW>;
62 linux,code = <KEY_RESTART>;
63 };
64 };
65
66 gpio-leds {
67 compatible = "gpio-leds";
68
69 wlan2g {
70 label = "ac1200rm:green:wlan2g";
71 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
72 };
73
74 led_wps: wps {
75 label = "ac1200rm:green:wps";
76 gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
77 };
78 };
79 };
80
81 &ehci {
82 status = "okay";
83 };
84
85 &ethernet {
86 mtd-mac-address = <&factory 0x28>;
87 mediatek,portmap = "llllw";
88 pinctrl-names = "default";
89 pinctrl-0 = <&ephy_pins>;
90 };
91
92 &gpio1 {
93 status = "okay";
94 };
95
96 &gpio2 {
97 status = "okay";
98 };
99
100 &gpio3 {
101 status = "okay";
102 };
103
104 &gsw {
105 mediatek,port4 = "ephy";
106 };
107
108 &ohci {
109 status = "okay";
110 };
111
112 &pcie {
113 status = "okay";
114 };
115
116 &pcie0 {
117 mt76@0,0 {
118 reg = <0x0000 0 0 0 0>;
119 mediatek,mtd-eeprom = <&factory 0x8000>;
120 ieee80211-freq-limit = <5000000 6000000>;
121
122 led {
123 led-sources = <2>;
124 led-active-low;
125 };
126 };
127 };
128
129 &pinctrl {
130 state_default: pinctrl0 {
131 gpio {
132 ralink,group = "nd_sd", "spi refclk", "wled";
133 ralink,function = "gpio";
134 };
135 };
136 };
137
138 &spi0 {
139 status = "okay";
140
141 m25p80@0 {
142 compatible = "jedec,spi-nor";
143 reg = <0>;
144 spi-max-frequency = <10000000>;
145
146 partitions {
147 compatible = "fixed-partitions";
148 #address-cells = <1>;
149 #size-cells = <1>;
150
151 partition@0 {
152 label = "u-boot";
153 reg = <0x0 0x30000>;
154 read-only;
155 };
156
157 partition@30000 {
158 label = "u-boot-env";
159 reg = <0x30000 0x1000>;
160 };
161
162 partition@31000 {
163 label = "config";
164 reg = <0x31000 0xf000>;
165 read-only;
166 };
167
168 factory: partition@40000 {
169 label = "factory";
170 reg = <0x40000 0x10000>;
171 read-only;
172 };
173
174 partition@50000 {
175 label = "firmware";
176 reg = <0x50000 0xfb0000>;
177 };
178 };
179 };
180 };
181
182 &wmac {
183 ralink,mtd-eeprom = <&factory 0>;
184 };