1354d7675SEmmanuel Vadot// SPDX-License-Identifier: GPL-2.0+
2354d7675SEmmanuel Vadot/*
3354d7675SEmmanuel Vadot * Copyright (C) 2020 Marvell International Ltd.
4354d7675SEmmanuel Vadot */
5354d7675SEmmanuel Vadot
6354d7675SEmmanuel Vadot#include "cn9130.dtsi" /* include SoC device tree */
7354d7675SEmmanuel Vadot
8354d7675SEmmanuel Vadot#include <dt-bindings/gpio/gpio.h>
9354d7675SEmmanuel Vadot
10354d7675SEmmanuel Vadot/ {
11354d7675SEmmanuel Vadot	chosen {
12354d7675SEmmanuel Vadot		stdout-path = "serial0:115200n8";
13354d7675SEmmanuel Vadot	};
14354d7675SEmmanuel Vadot
15354d7675SEmmanuel Vadot	aliases {
16354d7675SEmmanuel Vadot		i2c0 = &cp0_i2c0;
17354d7675SEmmanuel Vadot		ethernet0 = &cp0_eth0;
18354d7675SEmmanuel Vadot		ethernet1 = &cp0_eth1;
19354d7675SEmmanuel Vadot		ethernet2 = &cp0_eth2;
20e67e8565SEmmanuel Vadot		gpio1 = &cp0_gpio1;
21e67e8565SEmmanuel Vadot		gpio2 = &cp0_gpio2;
22354d7675SEmmanuel Vadot	};
23354d7675SEmmanuel Vadot
24354d7675SEmmanuel Vadot	memory@0 {
25354d7675SEmmanuel Vadot		device_type = "memory";
26354d7675SEmmanuel Vadot		reg = <0x0 0x0 0x0 0x80000000>;
27354d7675SEmmanuel Vadot	};
28354d7675SEmmanuel Vadot
29354d7675SEmmanuel Vadot	ap0_reg_mmc_vccq: ap0_mmc_vccq@0 {
30354d7675SEmmanuel Vadot		compatible = "regulator-gpio";
31354d7675SEmmanuel Vadot		regulator-name = "ap0_mmc_vccq";
32354d7675SEmmanuel Vadot		regulator-min-microvolt = <1800000>;
33354d7675SEmmanuel Vadot		regulator-max-microvolt = <3300000>;
34354d7675SEmmanuel Vadot		gpios = <&expander0 5 GPIO_ACTIVE_HIGH>;
35354d7675SEmmanuel Vadot		states = <1800000 0x1
36354d7675SEmmanuel Vadot			  3300000 0x0>;
37354d7675SEmmanuel Vadot	};
38354d7675SEmmanuel Vadot
39354d7675SEmmanuel Vadot	cp0_reg_usb3_vbus1: cp0_usb3_vbus@1 {
40354d7675SEmmanuel Vadot		compatible = "regulator-fixed";
41354d7675SEmmanuel Vadot		regulator-name = "cp0-xhci1-vbus";
42354d7675SEmmanuel Vadot		regulator-min-microvolt = <5000000>;
43354d7675SEmmanuel Vadot		regulator-max-microvolt = <5000000>;
44354d7675SEmmanuel Vadot		enable-active-high;
45354d7675SEmmanuel Vadot		gpio = <&expander0 8 GPIO_ACTIVE_HIGH>;
46354d7675SEmmanuel Vadot	};
47354d7675SEmmanuel Vadot
48354d7675SEmmanuel Vadot	cp0_usb3_0_phy0: cp0_usb3_phy0 {
49354d7675SEmmanuel Vadot		compatible = "usb-nop-xceiv";
50354d7675SEmmanuel Vadot	};
51354d7675SEmmanuel Vadot
52354d7675SEmmanuel Vadot	cp0_usb3_0_phy1: cp0_usb3_phy1 {
53354d7675SEmmanuel Vadot		compatible = "usb-nop-xceiv";
54354d7675SEmmanuel Vadot		vcc-supply = <&cp0_reg_usb3_vbus1>;
55354d7675SEmmanuel Vadot	};
56354d7675SEmmanuel Vadot
57354d7675SEmmanuel Vadot	cp0_reg_sd_vccq: cp0_sd_vccq@0 {
58354d7675SEmmanuel Vadot		compatible = "regulator-gpio";
59354d7675SEmmanuel Vadot		regulator-name = "cp0_sd_vccq";
60354d7675SEmmanuel Vadot		regulator-min-microvolt = <1800000>;
61354d7675SEmmanuel Vadot		regulator-max-microvolt = <3300000>;
62354d7675SEmmanuel Vadot		gpios = <&cp0_gpio2 18 GPIO_ACTIVE_HIGH>;
63354d7675SEmmanuel Vadot		states = <1800000 0x1
64354d7675SEmmanuel Vadot			  3300000 0x0>;
65354d7675SEmmanuel Vadot	};
66354d7675SEmmanuel Vadot
67354d7675SEmmanuel Vadot	cp0_reg_sd_vcc: cp0_sd_vcc@0 {
68354d7675SEmmanuel Vadot		compatible = "regulator-fixed";
69354d7675SEmmanuel Vadot		regulator-name = "cp0_sd_vcc";
70354d7675SEmmanuel Vadot		regulator-min-microvolt = <3300000>;
71354d7675SEmmanuel Vadot		regulator-max-microvolt = <3300000>;
72354d7675SEmmanuel Vadot		gpio = <&cp0_gpio2 19 GPIO_ACTIVE_HIGH>;
73354d7675SEmmanuel Vadot		enable-active-high;
74354d7675SEmmanuel Vadot		regulator-always-on;
75354d7675SEmmanuel Vadot	};
76e67e8565SEmmanuel Vadot
77e67e8565SEmmanuel Vadot	sfp: sfp {
78e67e8565SEmmanuel Vadot		compatible = "sff,sfp";
79e67e8565SEmmanuel Vadot		i2c-bus = <&cp0_i2c1>;
80e67e8565SEmmanuel Vadot		mod-def0-gpios = <&expander0 3 GPIO_ACTIVE_LOW>;
81b97ee269SEmmanuel Vadot		los-gpios = <&expander0 15 GPIO_ACTIVE_HIGH>;
82b97ee269SEmmanuel Vadot		tx-disable-gpios = <&expander0 2 GPIO_ACTIVE_HIGH>;
83b97ee269SEmmanuel Vadot		tx-fault-gpios = <&cp0_gpio1 24 GPIO_ACTIVE_HIGH>;
84e67e8565SEmmanuel Vadot		maximum-power-milliwatt = <3000>;
85e67e8565SEmmanuel Vadot		status = "okay";
86e67e8565SEmmanuel Vadot	};
87354d7675SEmmanuel Vadot};
88354d7675SEmmanuel Vadot
89354d7675SEmmanuel Vadot&uart0 {
90354d7675SEmmanuel Vadot	status = "okay";
91354d7675SEmmanuel Vadot};
92354d7675SEmmanuel Vadot
93354d7675SEmmanuel Vadot/* on-board eMMC U6 */
94354d7675SEmmanuel Vadot&ap_sdhci0 {
95354d7675SEmmanuel Vadot	pinctrl-names = "default";
96354d7675SEmmanuel Vadot	bus-width = <8>;
97354d7675SEmmanuel Vadot	status = "okay";
98354d7675SEmmanuel Vadot	mmc-ddr-1_8v;
99354d7675SEmmanuel Vadot	vqmmc-supply = <&ap0_reg_mmc_vccq>;
100354d7675SEmmanuel Vadot};
101354d7675SEmmanuel Vadot
102354d7675SEmmanuel Vadot&cp0_syscon0 {
103354d7675SEmmanuel Vadot	cp0_pinctrl: pinctrl {
104354d7675SEmmanuel Vadot		compatible = "marvell,cp115-standalone-pinctrl";
105354d7675SEmmanuel Vadot
106354d7675SEmmanuel Vadot		cp0_i2c0_pins: cp0-i2c-pins-0 {
107354d7675SEmmanuel Vadot			marvell,pins = "mpp37", "mpp38";
108354d7675SEmmanuel Vadot			marvell,function = "i2c0";
109354d7675SEmmanuel Vadot		};
110354d7675SEmmanuel Vadot		cp0_i2c1_pins: cp0-i2c-pins-1 {
111354d7675SEmmanuel Vadot			marvell,pins = "mpp35", "mpp36";
112354d7675SEmmanuel Vadot			marvell,function = "i2c1";
113354d7675SEmmanuel Vadot		};
114354d7675SEmmanuel Vadot		cp0_sdhci_cd_pins_crb: cp0-sdhci-cd-pins-crb {
115354d7675SEmmanuel Vadot			marvell,pins = "mpp55";
116354d7675SEmmanuel Vadot			marvell,function = "gpio";
117354d7675SEmmanuel Vadot		};
118354d7675SEmmanuel Vadot		cp0_sdhci_pins: cp0-sdhi-pins-0 {
119354d7675SEmmanuel Vadot			marvell,pins = "mpp56", "mpp57", "mpp58",
120354d7675SEmmanuel Vadot				       "mpp59", "mpp60", "mpp61";
121354d7675SEmmanuel Vadot			marvell,function = "sdio";
122354d7675SEmmanuel Vadot		};
12384943d6fSEmmanuel Vadot		cp0_spi1_pins: cp0-spi-pins-1 {
124354d7675SEmmanuel Vadot			marvell,pins = "mpp13", "mpp14", "mpp15", "mpp16";
125354d7675SEmmanuel Vadot			marvell,function = "spi1";
126354d7675SEmmanuel Vadot		};
127354d7675SEmmanuel Vadot	};
128354d7675SEmmanuel Vadot};
129354d7675SEmmanuel Vadot
130e67e8565SEmmanuel Vadot&cp0_gpio1 {
131e67e8565SEmmanuel Vadot	status = "okay";
132e67e8565SEmmanuel Vadot};
133e67e8565SEmmanuel Vadot
134e67e8565SEmmanuel Vadot&cp0_gpio2 {
135e67e8565SEmmanuel Vadot	status = "okay";
136e67e8565SEmmanuel Vadot};
137e67e8565SEmmanuel Vadot
138354d7675SEmmanuel Vadot&cp0_i2c0 {
139354d7675SEmmanuel Vadot	pinctrl-names = "default";
140354d7675SEmmanuel Vadot	pinctrl-0 = <&cp0_i2c0_pins>;
141354d7675SEmmanuel Vadot	status = "okay";
142354d7675SEmmanuel Vadot	clock-frequency = <100000>;
143354d7675SEmmanuel Vadot	expander0: mcp23x17@20 {
144354d7675SEmmanuel Vadot		compatible = "microchip,mcp23017";
145354d7675SEmmanuel Vadot		gpio-controller;
146354d7675SEmmanuel Vadot		#gpio-cells = <2>;
147354d7675SEmmanuel Vadot		reg = <0x20>;
148354d7675SEmmanuel Vadot		status = "okay";
149354d7675SEmmanuel Vadot	};
150354d7675SEmmanuel Vadot};
151354d7675SEmmanuel Vadot
152354d7675SEmmanuel Vadot&cp0_i2c1 {
153354d7675SEmmanuel Vadot	pinctrl-names = "default";
154354d7675SEmmanuel Vadot	pinctrl-0 = <&cp0_i2c1_pins>;
155354d7675SEmmanuel Vadot	clock-frequency = <100000>;
156354d7675SEmmanuel Vadot	status = "okay";
157354d7675SEmmanuel Vadot};
158354d7675SEmmanuel Vadot
159354d7675SEmmanuel Vadot
160354d7675SEmmanuel Vadot&cp0_sdhci0 {
161354d7675SEmmanuel Vadot	pinctrl-names = "default";
162354d7675SEmmanuel Vadot	pinctrl-0 = <&cp0_sdhci_pins
163354d7675SEmmanuel Vadot		     &cp0_sdhci_cd_pins_crb>;
164354d7675SEmmanuel Vadot	bus-width = <4>;
165354d7675SEmmanuel Vadot	cd-gpios = <&cp0_gpio2 23 GPIO_ACTIVE_HIGH>;
166354d7675SEmmanuel Vadot	vqmmc-supply = <&cp0_reg_sd_vccq>;
167354d7675SEmmanuel Vadot	vmmc-supply = <&cp0_reg_sd_vcc>;
168354d7675SEmmanuel Vadot	status = "okay";
169354d7675SEmmanuel Vadot};
170354d7675SEmmanuel Vadot
171354d7675SEmmanuel Vadot&cp0_spi1 {
172354d7675SEmmanuel Vadot	pinctrl-names = "default";
17384943d6fSEmmanuel Vadot	pinctrl-0 = <&cp0_spi1_pins>;
174354d7675SEmmanuel Vadot	reg = <0x700680 0x50>,		/* control */
175354d7675SEmmanuel Vadot	      <0x2000000 0x1000000>;	/* CS0 */
176354d7675SEmmanuel Vadot	status = "okay";
177354d7675SEmmanuel Vadot
178d5b0e70fSEmmanuel Vadot	flash@0 {
179354d7675SEmmanuel Vadot		#address-cells = <0x1>;
180354d7675SEmmanuel Vadot		#size-cells = <0x1>;
181354d7675SEmmanuel Vadot		compatible = "jedec,spi-nor";
182354d7675SEmmanuel Vadot		reg = <0x0>;
183354d7675SEmmanuel Vadot		/* On-board MUX does not allow higher frequencies */
184354d7675SEmmanuel Vadot		spi-max-frequency = <40000000>;
185354d7675SEmmanuel Vadot
186354d7675SEmmanuel Vadot		partitions {
187354d7675SEmmanuel Vadot			compatible = "fixed-partitions";
188354d7675SEmmanuel Vadot			#address-cells = <1>;
189354d7675SEmmanuel Vadot			#size-cells = <1>;
190354d7675SEmmanuel Vadot
191354d7675SEmmanuel Vadot			partition@0 {
192354d7675SEmmanuel Vadot				label = "U-Boot";
193354d7675SEmmanuel Vadot				reg = <0x0 0x200000>;
194354d7675SEmmanuel Vadot			};
195354d7675SEmmanuel Vadot
196354d7675SEmmanuel Vadot			partition@400000 {
197354d7675SEmmanuel Vadot				label = "Filesystem";
198354d7675SEmmanuel Vadot				reg = <0x200000 0xe00000>;
199354d7675SEmmanuel Vadot			};
200354d7675SEmmanuel Vadot		};
201354d7675SEmmanuel Vadot	};
202354d7675SEmmanuel Vadot};
203354d7675SEmmanuel Vadot
204354d7675SEmmanuel Vadot&cp0_mdio {
205354d7675SEmmanuel Vadot	status = "okay";
206354d7675SEmmanuel Vadot	phy0: ethernet-phy@0 {
207354d7675SEmmanuel Vadot		reg = <0>;
208354d7675SEmmanuel Vadot	};
209e67e8565SEmmanuel Vadot
210*8d13bc63SEmmanuel Vadot	switch6: ethernet-switch@6 {
211e67e8565SEmmanuel Vadot		/* Actual device is MV88E6393X */
212e67e8565SEmmanuel Vadot		compatible = "marvell,mv88e6190";
213e67e8565SEmmanuel Vadot		reg = <6>;
214e67e8565SEmmanuel Vadot		interrupt-parent = <&cp0_gpio1>;
215e67e8565SEmmanuel Vadot		interrupts = <28 IRQ_TYPE_LEVEL_LOW>;
216e67e8565SEmmanuel Vadot		interrupt-controller;
217e67e8565SEmmanuel Vadot		#interrupt-cells = <2>;
218e67e8565SEmmanuel Vadot
219e67e8565SEmmanuel Vadot		dsa,member = <0 0>;
220e67e8565SEmmanuel Vadot
221*8d13bc63SEmmanuel Vadot		ethernet-ports {
222e67e8565SEmmanuel Vadot			#address-cells = <1>;
223e67e8565SEmmanuel Vadot			#size-cells = <0>;
224e67e8565SEmmanuel Vadot
225*8d13bc63SEmmanuel Vadot			ethernet-port@1 {
226e67e8565SEmmanuel Vadot				reg = <1>;
227e67e8565SEmmanuel Vadot				label = "p1";
228e67e8565SEmmanuel Vadot				phy-handle = <&switch0phy1>;
229e67e8565SEmmanuel Vadot			};
230e67e8565SEmmanuel Vadot
231*8d13bc63SEmmanuel Vadot			ethernet-port@2 {
232e67e8565SEmmanuel Vadot				reg = <2>;
233e67e8565SEmmanuel Vadot				label = "p2";
234e67e8565SEmmanuel Vadot				phy-handle = <&switch0phy2>;
235e67e8565SEmmanuel Vadot			};
236e67e8565SEmmanuel Vadot
237*8d13bc63SEmmanuel Vadot			ethernet-port@3 {
238e67e8565SEmmanuel Vadot				reg = <3>;
239e67e8565SEmmanuel Vadot				label = "p3";
240e67e8565SEmmanuel Vadot				phy-handle = <&switch0phy3>;
241e67e8565SEmmanuel Vadot			};
242e67e8565SEmmanuel Vadot
243*8d13bc63SEmmanuel Vadot			ethernet-port@4 {
244e67e8565SEmmanuel Vadot				reg = <4>;
245e67e8565SEmmanuel Vadot				label = "p4";
246e67e8565SEmmanuel Vadot				phy-handle = <&switch0phy4>;
247e67e8565SEmmanuel Vadot			};
248e67e8565SEmmanuel Vadot
249*8d13bc63SEmmanuel Vadot			ethernet-port@5 {
250e67e8565SEmmanuel Vadot				reg = <5>;
251e67e8565SEmmanuel Vadot				label = "p5";
252e67e8565SEmmanuel Vadot				phy-handle = <&switch0phy5>;
253e67e8565SEmmanuel Vadot			};
254e67e8565SEmmanuel Vadot
255*8d13bc63SEmmanuel Vadot			ethernet-port@6 {
256e67e8565SEmmanuel Vadot				reg = <6>;
257e67e8565SEmmanuel Vadot				label = "p6";
258e67e8565SEmmanuel Vadot				phy-handle = <&switch0phy6>;
259e67e8565SEmmanuel Vadot			};
260e67e8565SEmmanuel Vadot
261*8d13bc63SEmmanuel Vadot			ethernet-port@7 {
262e67e8565SEmmanuel Vadot				reg = <7>;
263e67e8565SEmmanuel Vadot				label = "p7";
264e67e8565SEmmanuel Vadot				phy-handle = <&switch0phy7>;
265e67e8565SEmmanuel Vadot			};
266e67e8565SEmmanuel Vadot
267*8d13bc63SEmmanuel Vadot			ethernet-port@8 {
268e67e8565SEmmanuel Vadot				reg = <8>;
269e67e8565SEmmanuel Vadot				label = "p8";
270e67e8565SEmmanuel Vadot				phy-handle = <&switch0phy8>;
271e67e8565SEmmanuel Vadot			};
272e67e8565SEmmanuel Vadot
273*8d13bc63SEmmanuel Vadot			ethernet-port@9 {
274e67e8565SEmmanuel Vadot				reg = <9>;
275e67e8565SEmmanuel Vadot				label = "p9";
276e67e8565SEmmanuel Vadot				phy-mode = "10gbase-r";
277e67e8565SEmmanuel Vadot				sfp = <&sfp>;
278e67e8565SEmmanuel Vadot				managed = "in-band-status";
279e67e8565SEmmanuel Vadot			};
280e67e8565SEmmanuel Vadot
281*8d13bc63SEmmanuel Vadot			ethernet-port@a {
282e67e8565SEmmanuel Vadot				reg = <10>;
283e67e8565SEmmanuel Vadot				ethernet = <&cp0_eth0>;
284fac71e4eSEmmanuel Vadot				phy-mode = "10gbase-r";
285fac71e4eSEmmanuel Vadot				managed = "in-band-status";
286e67e8565SEmmanuel Vadot			};
287e67e8565SEmmanuel Vadot
288e67e8565SEmmanuel Vadot		};
289e67e8565SEmmanuel Vadot
290e67e8565SEmmanuel Vadot		mdio {
291e67e8565SEmmanuel Vadot			#address-cells = <1>;
292e67e8565SEmmanuel Vadot			#size-cells = <0>;
293e67e8565SEmmanuel Vadot
294*8d13bc63SEmmanuel Vadot			switch0phy1: ethernet-phy@1 {
295e67e8565SEmmanuel Vadot				reg = <0x1>;
296e67e8565SEmmanuel Vadot			};
297e67e8565SEmmanuel Vadot
298*8d13bc63SEmmanuel Vadot			switch0phy2: ethernet-phy@2 {
299e67e8565SEmmanuel Vadot				reg = <0x2>;
300e67e8565SEmmanuel Vadot			};
301e67e8565SEmmanuel Vadot
302*8d13bc63SEmmanuel Vadot			switch0phy3: ethernet-phy@3 {
303e67e8565SEmmanuel Vadot				reg = <0x3>;
304e67e8565SEmmanuel Vadot			};
305e67e8565SEmmanuel Vadot
306*8d13bc63SEmmanuel Vadot			switch0phy4: ethernet-phy@4 {
307e67e8565SEmmanuel Vadot				reg = <0x4>;
308e67e8565SEmmanuel Vadot			};
309e67e8565SEmmanuel Vadot
310*8d13bc63SEmmanuel Vadot			switch0phy5: ethernet-phy@5 {
311e67e8565SEmmanuel Vadot				reg = <0x5>;
312e67e8565SEmmanuel Vadot			};
313e67e8565SEmmanuel Vadot
314*8d13bc63SEmmanuel Vadot			switch0phy6: ethernet-phy@6 {
315e67e8565SEmmanuel Vadot				reg = <0x6>;
316e67e8565SEmmanuel Vadot			};
317e67e8565SEmmanuel Vadot
318*8d13bc63SEmmanuel Vadot			switch0phy7: ethernet-phy@7 {
319e67e8565SEmmanuel Vadot				reg = <0x7>;
320e67e8565SEmmanuel Vadot			};
321e67e8565SEmmanuel Vadot
322*8d13bc63SEmmanuel Vadot			switch0phy8: ethernet-phy@8 {
323e67e8565SEmmanuel Vadot				reg = <0x8>;
324e67e8565SEmmanuel Vadot			};
325e67e8565SEmmanuel Vadot		};
326e67e8565SEmmanuel Vadot	};
327354d7675SEmmanuel Vadot};
328354d7675SEmmanuel Vadot
329354d7675SEmmanuel Vadot&cp0_xmdio {
330354d7675SEmmanuel Vadot	status = "okay";
331354d7675SEmmanuel Vadot	nbaset_phy0: ethernet-phy@0 {
332354d7675SEmmanuel Vadot		compatible = "ethernet-phy-ieee802.3-c45";
333354d7675SEmmanuel Vadot		reg = <0>;
334354d7675SEmmanuel Vadot	};
335354d7675SEmmanuel Vadot};
336354d7675SEmmanuel Vadot
337354d7675SEmmanuel Vadot&cp0_ethernet {
338354d7675SEmmanuel Vadot	status = "okay";
339354d7675SEmmanuel Vadot};
340354d7675SEmmanuel Vadot
341354d7675SEmmanuel Vadot&cp0_eth0 {
342354d7675SEmmanuel Vadot	/* This port is connected to 88E6393X switch */
343354d7675SEmmanuel Vadot	status = "okay";
344354d7675SEmmanuel Vadot	phy-mode = "10gbase-r";
345354d7675SEmmanuel Vadot	managed = "in-band-status";
346354d7675SEmmanuel Vadot	phys = <&cp0_comphy4 0>;
347354d7675SEmmanuel Vadot};
348354d7675SEmmanuel Vadot
349354d7675SEmmanuel Vadot&cp0_eth1 {
350354d7675SEmmanuel Vadot	status = "okay";
351354d7675SEmmanuel Vadot	phy = <&phy0>;
352354d7675SEmmanuel Vadot	phy-mode = "rgmii-id";
353354d7675SEmmanuel Vadot};
354354d7675SEmmanuel Vadot
355354d7675SEmmanuel Vadot&cp0_eth2 {
356354d7675SEmmanuel Vadot	/* This port uses "2500base-t" phy-mode */
357354d7675SEmmanuel Vadot	status = "disabled";
358354d7675SEmmanuel Vadot	phy = <&nbaset_phy0>;
359354d7675SEmmanuel Vadot	phys = <&cp0_comphy5 2>;
360354d7675SEmmanuel Vadot};
361354d7675SEmmanuel Vadot
362