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