Fresh pull from upstream
[librecmc/librecmc.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         rtl8367rb {
66                 compatible = "realtek,rtl8367b";
67                 cpu_port = <7>;
68                 realtek,extif2 = <1 0 1 1 1 1 1 1 2>;
69                 mdio = <&mdio0>;
70         };
71 };
72
73 &spi0 {
74         status = "okay";
75
76         m25p80@0 {
77                 #address-cells = <1>;
78                 #size-cells = <1>;
79                 compatible = "jedec,spi-nor";
80                 reg = <0>;
81                 spi-max-frequency = <10000000>;
82
83                 partition@0 {
84                         label = "u-boot";
85                         reg = <0x0 0x30000>;
86                         read-only;
87                 };
88
89                 partition@30000 {
90                         label = "u-boot-env";
91                         reg = <0x30000 0x10000>;
92                         read-only;
93                 };
94
95                 factory: partition@40000 {
96                         label = "factory";
97                         reg = <0x40000 0x10000>;
98                         read-only;
99                 };
100
101                 partition@50000 {
102                         label = "firmware";
103                         reg = <0x50000 0xfb0000>;
104                 };
105         };
106 };
107
108 &pinctrl {
109         state_default: pinctrl0 {
110                 gpio {
111                         ralink,group = "i2c", "uartf";
112                         ralink,function = "gpio";
113                 };
114         };
115 };
116
117 &ethernet {
118         status = "okay";
119         pinctrl-names = "default";
120         pinctrl-0 = <&rgmii2_pins &mdio_pins>;
121         mtd-mac-address = <&factory 0x00004>;
122
123         port@4 {
124                 status = "okay";
125                 mediatek,fixed-link = <1000 1 1 1>;
126                 phy-mode = "rgmii";
127                 phy-handle = <&phy4>;
128         };
129
130         mdio0: mdio-bus {
131                 status = "okay";
132
133                 phy4: ethernet-phy@4 {
134                         reg = <4>;
135                         phy-mode = "rgmii";
136                 };
137         };
138 };
139
140 &gsw {
141         mediatek,port4 = "gmac";
142 };
143
144 &wmac {
145         ralink,mtd-eeprom = <&factory 0>;
146 };
147
148 &ehci {
149         status = "okay";
150 };
151
152 &ohci {
153         status = "okay";
154 };