8632f5ce0433a1e4d26bab9676dad74916486c16
[openwrt/staging/dedeckeh.git] / target / linux / ramips / dts / mt7620a_alfa-network_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 #include "mt7620a.dtsi"
34
35 #include <dt-bindings/gpio/gpio.h>
36 #include <dt-bindings/input/input.h>
37
38 / {
39 compatible = "alfa-network,ac1200rm", "ralink,mt7620a-soc";
40 model = "ALFA Network AC1200RM";
41
42 aliases {
43 led-boot = &led_wps;
44 led-failsafe = &led_wps;
45 };
46
47 chosen {
48 bootargs = "console=ttyS0,115200";
49 };
50
51 keys {
52 compatible = "gpio-keys";
53
54 reset {
55 label = "reset";
56 gpios = <&gpio2 15 GPIO_ACTIVE_LOW>;
57 linux,code = <KEY_RESTART>;
58 };
59 };
60
61 leds {
62 compatible = "gpio-leds";
63
64 wlan2g {
65 label = "ac1200rm:green:wlan2g";
66 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
67 };
68
69 led_wps: wps {
70 label = "ac1200rm:green:wps";
71 gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
72 };
73 };
74 };
75
76 &ehci {
77 status = "okay";
78 };
79
80 &ethernet {
81 pinctrl-names = "default";
82 pinctrl-0 = <&ephy_pins>;
83
84 mtd-mac-address = <&factory 0x28>;
85
86 mediatek,portmap = "llllw";
87 };
88
89 &gpio1 {
90 status = "okay";
91 };
92
93 &gpio2 {
94 status = "okay";
95 };
96
97 &gpio3 {
98 status = "okay";
99 };
100
101 &gsw {
102 mediatek,port4 = "ephy";
103 };
104
105 &ohci {
106 status = "okay";
107 };
108
109 &pcie {
110 status = "okay";
111 };
112
113 &pcie0 {
114 mt76@0,0 {
115 reg = <0x0000 0 0 0 0>;
116 mediatek,mtd-eeprom = <&factory 0x8000>;
117 ieee80211-freq-limit = <5000000 6000000>;
118
119 led {
120 led-sources = <2>;
121 led-active-low;
122 };
123 };
124 };
125
126 &state_default {
127 gpio {
128 groups = "nd_sd", "spi refclk", "wled";
129 function = "gpio";
130 };
131 };
132
133 &spi0 {
134 status = "okay";
135
136 flash@0 {
137 compatible = "jedec,spi-nor";
138 reg = <0>;
139 spi-max-frequency = <10000000>;
140
141 partitions {
142 compatible = "fixed-partitions";
143 #address-cells = <1>;
144 #size-cells = <1>;
145
146 partition@0 {
147 label = "u-boot";
148 reg = <0x0 0x30000>;
149 read-only;
150 };
151
152 partition@30000 {
153 label = "u-boot-env";
154 reg = <0x30000 0x1000>;
155 };
156
157 partition@31000 {
158 label = "config";
159 reg = <0x31000 0xf000>;
160 read-only;
161 };
162
163 factory: partition@40000 {
164 label = "factory";
165 reg = <0x40000 0x10000>;
166 read-only;
167 };
168
169 partition@50000 {
170 compatible = "denx,uimage";
171 label = "firmware";
172 reg = <0x50000 0xfb0000>;
173 };
174 };
175 };
176 };
177
178 &wmac {
179 ralink,mtd-eeprom = <&factory 0x0>;
180 };