bmips: Build U-Boot into the XG6846 target
[openwrt/staging/stintel.git] / target / linux / bmips / dts / bcm6328-inteno-xg6846.dts
1 // SPDX-License-Identifier: GPL-2.0
2 /dts-v1/;
3
4 /*
5 * Devicetree for the Inteno XG6846 router, mostly used as a
6 * media converter from fiber to twisted pair ethernet
7 * "fiber modem" in many households in Sweden. The Marvell
8 * switch has one of its ports connected to an SFP (Small Form
9 * Factor pluggable) optical fiber receiver, which is bridged
10 * to the twisted pair connector LAN1.
11 *
12 * This device tree is inspired by research from the OpenWrt
13 * and Sweclockers forums, including contributions from
14 * NPeca75, mrhaav and csom.
15 *
16 * Some devices have a USB type A host receptacle mounted,
17 * some do not.
18 */
19 #include "bcm6328.dtsi"
20 #include <dt-bindings/input/input.h>
21 #include <dt-bindings/gpio/gpio.h>
22
23 / {
24 model = "Inteno XG6846";
25 compatible = "inteno,xg6846", "brcm,bcm6328";
26
27 /* OpenWrt-specific aliases */
28 aliases {
29 led-boot = &led_pwr_red;
30 led-failsafe = &led_pwr_red;
31 led-running = &led_pwr_green;
32 led-upgrade = &led_pwr_red;
33 led-usb = &led_usb_green;
34 };
35
36 chosen {
37 bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200";
38 stdout-path = "serial0:115200n8";
39 };
40
41 /*
42 * This I2C port is connected to the SFP and reflects the EEPROM etc
43 * inside the SFP module. If the module is not plugged in, consequently
44 * nothing will be found on the bus.
45 */
46 i2c0: i2c-sfp {
47 compatible = "i2c-gpio";
48 sda-gpios = <&gpio 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
49 scl-gpios = <&gpio 19 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
50 #address-cells = <1>;
51 #size-cells = <0>;
52 };
53
54 /* This I2C bus is used for the external CATV connector (usually unused) */
55 i2c1: i2c-catv {
56 compatible = "i2c-gpio";
57 sda-gpios = <&gpio 23 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
58 scl-gpios = <&gpio 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
59 #address-cells = <1>;
60 #size-cells = <0>;
61 };
62
63 sfp0: sfp0 {
64 compatible = "sff,sfp";
65 i2c-bus = <&i2c0>;
66 los-gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
67 };
68
69 keys {
70 compatible = "gpio-keys-polled";
71 #address-cells = <1>;
72 #size-cells = <0>;
73 poll-interval = <20>;
74
75 reset {
76 label = "reset";
77 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
78 linux,code = <KEY_RESTART>;
79 debounce-interval = <60>;
80 };
81 };
82 };
83
84 &hsspi {
85 status = "okay";
86
87 flash@0 {
88 compatible = "jedec,spi-nor";
89 /*
90 * HW 1.0-1.1: Spansion S25FL128S1
91 * HW 1.3: Winbond W25Q128
92 *
93 * Fast Read Data max speed is 50MHz, see the Winbond W25Q128
94 * datasheet table 9.5 "AC Electrical Characteristics", we can
95 * use this speed because the chip supports fast reads. Older
96 * HW has different NOR chips, I assume they can all do fast
97 * reads.
98 */
99 spi-max-frequency = <104000000>;
100 spi-tx-bus-width = <2>;
101 spi-rx-bus-width = <2>;
102 m25p,fast-read;
103 reg = <0>;
104
105 #address-cells = <1>;
106 #size-cells = <1>;
107
108 partitions {
109 compatible = "fixed-partitions";
110 #address-cells = <1>;
111 #size-cells = <1>;
112
113 cfe: partition@0 {
114 label = "cfe";
115 reg = <0x0000000 0x0010000>;
116 read-only;
117 };
118
119 partition@10000 {
120 compatible = "openwrt,uimage", "denx,uimage";
121 reg = <0x010000 0xfe0000>;
122 label = "firmware";
123 openwrt,offset = <0x30000>;
124 };
125
126 partition@ff0000 {
127 reg = <0xff0000 0x010000>;
128 label = "nvram";
129 };
130 };
131 };
132 };
133
134 &cfe {
135 compatible = "nvmem-cells";
136 #address-cells = <1>;
137 #size-cells = <1>;
138
139 macaddr_cfe_6a0: macaddr@6a0 {
140 reg = <0x6a0 0x6>;
141 };
142 };
143
144 &ethernet {
145 status = "okay";
146
147 nvmem-cells = <&macaddr_cfe_6a0>;
148 nvmem-cell-names = "mac-address";
149 };
150
151 &switch0 {
152 dsa,member = <0 0>;
153
154 ports {
155 switch0port4: port@4 {
156 reg = <4>;
157 label = "extsw";
158
159 phy-mode = "rgmii";
160 fixed-link {
161 speed = <1000>;
162 full-duplex;
163 };
164 };
165 };
166 };
167
168 &mdio_ext {
169 switch1: switch@0 {
170 /* The switch is not using any external IRQ, sadly */
171 compatible = "marvell,mv88e6085";
172 #address-cells = <1>;
173 #size-cells = <0>;
174 reg = <0>;
175 interrupt-controller;
176 #interrupt-cells = <2>;
177 dsa,member = <1 0>;
178
179 ports {
180 #address-cells = <1>;
181 #size-cells = <0>;
182
183 port@0 {
184 reg = <0>;
185 label = "lan1";
186 phy-handle = <&lan1phy>;
187 };
188
189 port@1 {
190 reg = <1>;
191 label = "lan2";
192 phy-handle = <&lan2phy>;
193 };
194
195 port@2 {
196 reg = <2>;
197 label = "lan3";
198 phy-handle = <&lan3phy>;
199 };
200
201 port@3 {
202 reg = <3>;
203 label = "lan4";
204 phy-handle = <&lan4phy>;
205 };
206
207 port@4 {
208 reg = <4>;
209 label = "ext1";
210 phy-handle = <&ext1phy>;
211 };
212
213 port@5 {
214 reg = <5>;
215 phy-mode = "rgmii-id";
216 label = "wan";
217 sfp = <&sfp0>;
218 fixed-link {
219 speed = <1000>;
220 full-duplex;
221 };
222 };
223
224 port@6 {
225 reg = <6>;
226 phy-mode = "rgmii-id";
227 label = "cpu";
228 ethernet = <&switch0port4>;
229 fixed-link {
230 speed = <1000>;
231 full-duplex;
232 };
233 };
234 };
235
236 mdio {
237 #address-cells = <1>;
238 #size-cells = <0>;
239
240 lan1phy: ethernet-phy@0 {
241 reg = <0>;
242 interrupt-parent = <&switch1>;
243 interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
244 };
245 lan2phy: ethernet-phy@1 {
246 reg = <1>;
247 interrupt-parent = <&switch1>;
248 interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
249 };
250 lan3phy: ethernet-phy@2 {
251 reg = <2>;
252 interrupt-parent = <&switch1>;
253 interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
254 };
255 lan4phy: ethernet-phy@3 {
256 reg = <3>;
257 interrupt-parent = <&switch1>;
258 interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
259 };
260 ext1phy: ethernet-phy@4 {
261 reg = <4>;
262 interrupt-parent = <&switch1>;
263 interrupts = <4 IRQ_TYPE_LEVEL_HIGH>;
264 };
265 };
266 };
267 };
268
269 &uart0 {
270 status = "okay";
271 };
272
273 &pinctrl {
274 pinctrl_xg6846_usb_spd_led: xg6846_usb_spd_led-pins {
275 function = "led";
276 pins = "gpio17";
277 };
278 };
279
280 &leds {
281 status = "okay";
282 pinctrl-names = "default";
283 pinctrl-0 = <&pinctrl_xg6846_usb_spd_led>, /* GPIO16 LED USB */
284 <&pinctrl_ephy1_spd_led>, /* GPIO18 LED PWR red */
285 <&pinctrl_ephy3_spd_led>; /* GPIO20 LED PWR green */
286
287 /* On board variants without USB this LED is not mounted */
288 led_usb_green: led@16 {
289 reg = <16>;
290 active-low;
291 label = "green:usb";
292 default-state = "off";
293 };
294
295 /*
296 * LED 18 and 20 drive the same physical LED, the PWR
297 * LED that can be both red and green.
298 */
299 led_pwr_red: led@18 {
300 reg = <18>;
301 active-low;
302 label = "red:pwr";
303 default-state = "off";
304 };
305
306 led_pwr_green: led@20 {
307 reg = <20>;
308 active-low;
309 label = "green:pwr";
310 default-state = "off";
311 };
312
313 };