realtek: EnGenius EWS2910P: add support for SFP ports
[openwrt/staging/ansuel.git] / target / linux / realtek / dts-5.10 / rtl8380_engenius_ews2910p.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later
2
3 #include "rtl838x.dtsi"
4
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/gpio/gpio.h>
7
8 / {
9 compatible = "engenius,ews2910p", "realtek,rtl838x-soc";
10 model = "EnGenius EWS2910P";
11
12 aliases {
13 led-boot = &led_power;
14 led-failsafe = &led_fault;
15 led-running = &led_power;
16 led-upgrade = &led_power;
17 };
18
19 memory@0 {
20 device_type = "memory";
21 reg = <0x0 0x10000000>;
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 reset {
28 label = "reset";
29 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_RESTART>;
31 };
32
33 led_mode {
34 label = "led-mode";
35 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
36 linux,code = <BTN_0>;
37 };
38 };
39
40 gpio1: rtl8231-gpio {
41 compatible = "realtek,rtl8231-gpio";
42 #gpio-cells = <2>;
43 gpio-controller;
44 indirect-access-bus-id = <0>;
45
46 sff_p9_gpios {
47 gpio-hog;
48 gpios = < 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>,
49 < 11 GPIO_ACTIVE_HIGH>, /* los-gpio */
50 < 12 GPIO_ACTIVE_LOW>; /* mod-def0-gpio */
51 input;
52 line-name = "sff-p9-gpios";
53 };
54 };
55
56 gpio-export {
57 compatible = "gpio-export";
58
59 sff-p9-tx-disable {
60 gpio-export,name = "sff-p9-tx-disable";
61 gpio-export,output = <1>;
62 gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
63 };
64 };
65
66 gpio-restart {
67 compatible = "gpio-restart";
68 gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
69 };
70
71 leds {
72 compatible = "gpio-leds";
73
74 led_power: led-0 {
75 label = "green:power";
76 gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
77 };
78
79 led_lan_mode: led-1 {
80 label = "green:lan-mode";
81 gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
82 };
83
84 led_fault: led-2 {
85 label = "amber:fault";
86 gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
87 };
88
89 led_poe_max: led-3 {
90 label = "amber:poe-max";
91 gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
92 };
93 };
94
95 i2c1: i2c-gpio-1 {
96 compatible = "i2c-gpio";
97 sda-gpios = <&gpio1 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
98 scl-gpios = <&gpio1 31 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
99 i2c-gpio,delay-us = <2>;
100 #address-cells = <1>;
101 #size-cells = <0>;
102 };
103 sfp1: sfp-p10 {
104 compatible = "sff,sfp";
105 i2c-bus = <&i2c1>;
106 tx-disable-gpio = <&gpio1 13 GPIO_ACTIVE_HIGH>;
107 los-gpio = <&gpio1 14 GPIO_ACTIVE_HIGH>;
108 mod-def0-gpio = <&gpio1 21 GPIO_ACTIVE_LOW>;
109 };
110 };
111
112 &spi0 {
113 status = "okay";
114
115 flash@0 {
116 compatible = "jedec,spi-nor";
117 reg = <0>;
118 spi-max-frequency = <10000000>;
119
120 partitions {
121 compatible = "fixed-partitions";
122 #address-cells = <1>;
123 #size-cells = <1>;
124
125 partition@0 {
126 label = "u-boot";
127 reg = <0x0 0x80000>;
128 read-only;
129 };
130 partition@80000 {
131 label = "u-boot-env";
132 reg = <0x80000 0x10000>;
133 read-only;
134 };
135 partition@90000 {
136 label = "u-boot-env2";
137 reg = <0x90000 0x10000>;
138 };
139 partition@a0000 {
140 label = "jffs2-cfg";
141 reg = <0xa0000 0xd60000>;
142 };
143 partition@e00000 {
144 label = "jffs2-log";
145 reg = <0xe00000 0x200000>;
146 };
147 partition@1000000 {
148 compatible = "openwrt,uimage";
149 label = "firmware";
150 reg = <0x1000000 0x800000>;
151 openwrt,ih-magic = <0x03802910>;
152 };
153 partition@1800000 {
154 label = "firmware2";
155 reg = <0x1800000 0x800000>;
156 };
157 };
158 };
159 };
160
161 &ethernet0 {
162 mdio: mdio-bus {
163 compatible = "realtek,rtl838x-mdio";
164 regmap = <&ethernet0>;
165 #address-cells = <1>;
166 #size-cells = <0>;
167
168 INTERNAL_PHY(8)
169 INTERNAL_PHY(9)
170 INTERNAL_PHY(10)
171 INTERNAL_PHY(11)
172 INTERNAL_PHY(12)
173 INTERNAL_PHY(13)
174 INTERNAL_PHY(14)
175 INTERNAL_PHY(15)
176
177 INTERNAL_PHY(24)
178 INTERNAL_PHY(26)
179 };
180 };
181
182 &switch0 {
183 ports {
184 #address-cells = <1>;
185 #size-cells = <0>;
186
187 SWITCH_PORT(8, 1, internal)
188 SWITCH_PORT(9, 2, internal)
189 SWITCH_PORT(10, 3, internal)
190 SWITCH_PORT(11, 4, internal)
191 SWITCH_PORT(12, 5, internal)
192 SWITCH_PORT(13, 6, internal)
193 SWITCH_PORT(14, 7, internal)
194 SWITCH_PORT(15, 8, internal)
195
196 SWITCH_SFP_PORT(24, 9, 1000base-x)
197
198 port@26 {
199 reg = <26>;
200 label = "lan10";
201 phy-mode = "1000base-x";
202 phy-handle = <&phy26>;
203 managed = "in-band-status";
204 sfp = <&sfp1>;
205 };
206
207 port@28 {
208 ethernet = <&ethernet0>;
209 reg = <28>;
210 phy-mode = "internal";
211
212 fixed-link {
213 speed = <1000>;
214 full-duplex;
215 };
216 };
217 };
218 };
219
220 &uart1 {
221 status = "okay";
222 };