ramips: move dts-v1 statement to top-level DTSI files
[openwrt/staging/dedeckeh.git] / target / linux / ramips / dts / mt7620a_sanlinking_d240.dts
1 /*
2 * BSD LICENSE
3 *
4 * Copyright(c) 2017 Kristian Evensen <kristian.evensen@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 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 * * Neither the name of Broadcom Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34 #include "mt7620a.dtsi"
35
36 #include <dt-bindings/gpio/gpio.h>
37 #include <dt-bindings/input/input.h>
38
39 / {
40 compatible = "sanlinking,d240", "ralink,mt7620a-soc";
41 model = "Sanlinking Technologies D240";
42
43 aliases {
44 led-boot = &led_power;
45 led-failsafe = &led_power;
46 led-running = &led_power;
47 led-upgrade = &led_power;
48 };
49
50 chosen {
51 bootargs = "console=ttyS0,115200";
52 };
53
54 gpio-export {
55 compatible = "gpio-export";
56 #size-cells = <0>;
57
58 power_mpcie2 {
59 gpio-export,name = "power_mpcie2";
60 gpio-export,output = <1>;
61 gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
62 };
63
64 power_mpcie1 {
65 gpio-export,name = "power_mpcie1";
66 gpio-export,output = <1>;
67 gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>;
68 };
69 };
70
71 leds {
72 compatible = "gpio-leds";
73
74 led_power: power {
75 label = "d240:blue:power";
76 gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
77 };
78
79 usb {
80 label = "d240:blue:usb";
81 gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
82 trigger-sources = <&ohci_port1>, <&ehci_port1>;
83 linux,default-trigger = "usbport";
84 };
85
86 air {
87 label = "d240:blue:wifi";
88 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
89 };
90 };
91
92 keys {
93 compatible = "gpio-keys";
94
95 reset {
96 label = "reset";
97 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
98 linux,code = <KEY_RESTART>;
99 };
100 };
101 };
102
103 &gpio1 {
104 status = "okay";
105 };
106
107 &gpio2 {
108 status = "okay";
109 };
110
111 &gpio3 {
112 status = "okay";
113 };
114
115 &spi0 {
116 status = "okay";
117
118 flash@0 {
119 compatible = "jedec,spi-nor";
120 reg = <0>;
121 spi-max-frequency = <10000000>;
122
123 partitions {
124 compatible = "fixed-partitions";
125 #address-cells = <1>;
126 #size-cells = <1>;
127
128 partition@0 {
129 label = "u-boot";
130 reg = <0x0 0x30000>;
131 read-only;
132 };
133
134 partition@30000 {
135 label = "u-boot-env";
136 reg = <0x30000 0x10000>;
137 read-only;
138 };
139
140 factory: partition@40000 {
141 label = "factory";
142 reg = <0x40000 0x10000>;
143 read-only;
144 };
145
146 partition@50000 {
147 compatible = "denx,uimage";
148 label = "firmware";
149 reg = <0x50000 0xfb0000>;
150 };
151 };
152 };
153 };
154
155 &sdhci {
156 status = "okay";
157 /* the pins function is already set during pinmux driver load */
158 /delete-property/ pinctrl-0;
159 };
160
161 &ehci {
162 status = "okay";
163 };
164
165 &ohci {
166 status = "okay";
167 };
168
169 &ethernet {
170 mtd-mac-address = <&factory 0x4>;
171
172 mediatek,portmap = "llllw";
173 };
174
175 &wmac {
176 ralink,mtd-eeprom = <&factory 0x0>;
177 };
178
179 &state_default {
180 default {
181 groups = "i2c", "uartf", "wled", "spi refclk", "pa";
182 function = "gpio";
183 };
184
185 /*
186 * The sd function of the nd_sd group configures two of the
187 * groups pins as gpios. The pins are used as PCIe reset/power.
188 * Due to the driver load order, the pins are configured way to
189 * late if triggered by the sd-card driver.
190 * To not introduce another kind of driver load order
191 * dependency and configure the pins as early as possible,
192 * means during pinmux driver load.
193 */
194 gpio_sd {
195 groups = "nd_sd";
196 function = "sd";
197 };
198 };
199
200 &pcie {
201 status = "okay";
202 };