ramips: Use dts alias based status led
[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 aliases {
44 led-status = &led_power;
45 };
46
47 chosen {
48 bootargs = "console=ttyS0,115200";
49 };
50
51 gpio-keys-polled {
52 compatible = "gpio-keys-polled";
53 #address-cells = <1>;
54 #size-cells = <0>;
55 poll-interval = <20>;
56 reset {
57 label = "reset";
58 gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
59 linux,code = <KEY_RESTART>;
60 };
61 };
62
63 gpio-leds {
64 compatible = "gpio-leds";
65
66 led_power: power {
67 label = "u7628-01:green:power";
68 gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
69 };
70
71 wlan {
72 label = "u7628-01:green:wlan";
73 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
74 };
75
76 wan {
77 label = "u7628-01:green:wan";
78 gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
79 };
80
81 lan1 {
82 label = "u7628-01:green:lan1";
83 gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
84 };
85
86 lan2 {
87 label = "u7628-01:green:lan2";
88 gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
89 };
90
91 lan3 {
92 label = "u7628-01:green:lan3";
93 gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
94 };
95
96 lan4 {
97 label = "u7628-01:green:lan4";
98 gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
99 };
100
101 usb {
102 label = "u7628-01:green:usb";
103 gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
104 };
105 };
106 };
107
108 &gpio0 {
109 status = "okay";
110 };
111
112 &gpio1 {
113 status = "okay";
114 };
115
116 &pcie {
117 status = "okay";
118 };
119
120 &ethernet {
121 mtd-mac-address = <&factory 0x28>;
122 };
123
124 &wmac {
125 status = "okay";
126 ralink,mtd-eeprom = <&factory 0x0>;
127 };
128
129 &pinctrl {
130 state_default: pinctrl0 {
131 gpio {
132 ralink,group = "gpio", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an", "refclk", "wdt", "wled_an";
133 ralink,function = "gpio";
134 };
135 };
136 };