ramips: add support for UniElec U7628-01
[openwrt/openwrt.git] / target / linux / ramips / dts / U7628-01.dtsi
1 /*
2 * BSD LICENSE
3 *
4 * Copyright(c) 2017 Kristian Evensen <kristian.evensen@gmail.com>.
5 * Copyright(c) 2017 Piotr Dymacz <pepe2k@gmail.com>.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the
17 * distribution.
18 * * Neither the name of Broadcom Corporation nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35 #include "mt7628an.dtsi"
36
37 #include <dt-bindings/gpio/gpio.h>
38 #include <dt-bindings/input/input.h>
39
40 / {
41 compatible = "unielec,u7628-01", "mediatek,mt7628an-soc";
42
43 chosen {
44 bootargs = "console=ttyS0,115200";
45 };
46
47 gpio-keys-polled {
48 compatible = "gpio-keys-polled";
49 #address-cells = <1>;
50 #size-cells = <0>;
51 poll-interval = <20>;
52 reset {
53 label = "reset";
54 gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
55 linux,code = <KEY_RESTART>;
56 };
57 };
58
59 gpio-leds {
60 compatible = "gpio-leds";
61
62 power {
63 label = "u7628-01:green:power";
64 gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
65 };
66
67 wlan {
68 label = "u7628-01:green:wlan";
69 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
70 };
71
72 wan {
73 label = "u7628-01:green:wan";
74 gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
75 };
76
77 lan1 {
78 label = "u7628-01:green:lan1";
79 gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
80 };
81
82 lan2 {
83 label = "u7628-01:green:lan2";
84 gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
85 };
86
87 lan3 {
88 label = "u7628-01:green:lan3";
89 gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
90 };
91
92 lan4 {
93 label = "u7628-01:green:lan4";
94 gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
95 };
96
97 usb {
98 label = "u7628-01:green:usb";
99 gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
100 };
101 };
102 };
103
104 &gpio0 {
105 status = "okay";
106 };
107
108 &gpio1 {
109 status = "okay";
110 };
111
112 &pcie {
113 status = "okay";
114 };
115
116 &ethernet {
117 mtd-mac-address = <&factory 0x28>;
118 };
119
120 &wmac {
121 status = "okay";
122 ralink,mtd-eeprom = <&factory 0x0>;
123 };
124
125 &pinctrl {
126 state_default: pinctrl0 {
127 gpio {
128 ralink,group = "gpio", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an", "perst", "wdt", "wled_an";
129 ralink,function = "gpio";
130 };
131 };
132 };