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