ramips: Use dts alias based status led
[openwrt/staging/hauke.git] / target / linux / ramips / dts / kng_rc.dts
1 /dts-v1/;
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "zyxel,keenetic-viva", "ralink,mt7620a-soc";
10 model = "ZyXEL Keenetic Viva";
11
12 aliases {
13 led-status = &led_power_green;
14 };
15
16 gpio-leds {
17 compatible = "gpio-leds";
18
19 wan {
20 label = "kng_rc:green:wan";
21 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
22 };
23
24 usb {
25 label = "kng_rc:green:usb";
26 gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
27 };
28
29 power_alert {
30 label = "kng_rc:red:power";
31 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
32 };
33
34 wifi {
35 label = "kng_rc:green:wifi";
36 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
37 };
38
39 led_power_green: power {
40 label = "kng_rc:green:power";
41 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
42 };
43 };
44
45 gpio-keys-polled {
46 compatible = "gpio-keys";
47 #address-cells = <1>;
48 #size-cells = <0>;
49 poll-interval = <20>;
50
51 reset {
52 label = "reset";
53 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
54 linux,code = <KEY_RESTART>;
55 };
56
57 wps {
58 label = "wps";
59 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
60 linux,code = <KEY_WPS_BUTTON>;
61 };
62
63 fn {
64 label = "fn";
65 gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
66 linux,code = <BTN_0>;
67 };
68 };
69
70 gpio_export {
71 compatible = "gpio-export";
72 #size-cells = <0>;
73
74 usb_power {
75 gpio-export,name = "usb";
76 gpio-export,output = <1>;
77 gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
78 };
79 };
80
81 rtl8367rb {
82 compatible = "realtek,rtl8367b";
83 cpu_port = <7>;
84 realtek,extif2 = <1 0 1 1 1 1 1 1 2>;
85 mii-bus = <&mdio0>;
86 };
87 };
88
89 &spi0 {
90 status = "okay";
91
92 m25p80@0 {
93 #address-cells = <1>;
94 #size-cells = <1>;
95 compatible = "jedec,spi-nor";
96 reg = <0>;
97 spi-max-frequency = <10000000>;
98
99 partition@0 {
100 label = "u-boot";
101 reg = <0x0 0x30000>;
102 read-only;
103 };
104
105 partition@30000 {
106 label = "u-boot-env";
107 reg = <0x30000 0x10000>;
108 read-only;
109 };
110
111 factory: partition@40000 {
112 label = "factory";
113 reg = <0x40000 0x10000>;
114 read-only;
115 };
116
117 partition@50000 {
118 label = "firmware";
119 reg = <0x50000 0xfb0000>;
120 };
121 };
122 };
123
124 &pinctrl {
125 state_default: pinctrl0 {
126 gpio {
127 ralink,group = "i2c", "uartf";
128 ralink,function = "gpio";
129 };
130 };
131 };
132
133 &ethernet {
134 status = "okay";
135 pinctrl-names = "default";
136 pinctrl-0 = <&rgmii2_pins &mdio_pins>;
137 mtd-mac-address = <&factory 0x00004>;
138
139 port@4 {
140 status = "okay";
141 mediatek,fixed-link = <1000 1 1 1>;
142 phy-mode = "rgmii";
143 phy-handle = <&phy4>;
144 };
145
146 mdio0: mdio-bus {
147 status = "okay";
148
149 phy4: ethernet-phy@4 {
150 reg = <4>;
151 phy-mode = "rgmii";
152 };
153 };
154 };
155
156 &gsw {
157 mediatek,port4 = "gmac";
158 };
159
160 &wmac {
161 ralink,mtd-eeprom = <&factory 0>;
162 };
163
164 &ehci {
165 status = "okay";
166 };
167
168 &ohci {
169 status = "okay";
170 };