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