1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Device Tree file for Globalscale Marvell ESPRESSOBin Board
4 * Copyright (C) 2016 Marvell
5 *
6 * Romain Perier <romain.perier@free-electrons.com>
7 *
8 */
9
10#include <dt-bindings/gpio/gpio.h>
11#include "armada-372x.dtsi"
12
13/ {
14	aliases {
15		ethernet0 = &eth0;
16		/* for dsa slave device */
17		ethernet1 = &switch0port1;
18		ethernet2 = &switch0port2;
19		ethernet3 = &switch0port3;
20	};
21
22	chosen {
23		stdout-path = "serial0:115200n8";
24	};
25
26	memory@0 {
27		device_type = "memory";
28		reg = <0x00000000 0x00000000 0x00000000 0x20000000>;
29	};
30
31	vcc_sd_reg1: regulator {
32		compatible = "regulator-gpio";
33		regulator-name = "vcc_sd1";
34		regulator-min-microvolt = <1800000>;
35		regulator-max-microvolt = <3300000>;
36		regulator-boot-on;
37
38		gpios = <&gpionb 4 GPIO_ACTIVE_HIGH>;
39		gpios-states = <0>;
40		states = <1800000 0x1
41			  3300000 0x0>;
42		enable-active-high;
43	};
44};
45
46/* J9 */
47&pcie0 {
48	status = "okay";
49	pinctrl-names = "default";
50	pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>;
51	reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>;
52};
53
54/* J6 */
55&sata {
56	status = "okay";
57	phys = <&comphy2 0>;
58	phy-names = "sata-phy";
59};
60
61/* U11 */
62&sdhci0 {
63	/* Main DTS file for Espressobin is without eMMC */
64	status = "disabled";
65
66	non-removable;
67	bus-width = <8>;
68	mmc-ddr-1_8v;
69	mmc-hs400-1_8v;
70	marvell,xenon-emmc;
71	marvell,xenon-tun-count = <9>;
72	marvell,pad-type = "fixed-1-8v";
73
74	pinctrl-names = "default";
75	pinctrl-0 = <&mmc_pins>;
76
77	#address-cells = <1>;
78	#size-cells = <0>;
79	mmccard: mmccard@0 {
80		compatible = "mmc-card";
81		reg = <0>;
82	};
83};
84
85/* J1 */
86&sdhci1 {
87	wp-inverted;
88	bus-width = <4>;
89	cd-gpios = <&gpionb 3 GPIO_ACTIVE_LOW>;
90	marvell,pad-type = "sd";
91	vqmmc-supply = <&vcc_sd_reg1>;
92
93	pinctrl-names = "default";
94	pinctrl-0 = <&sdio_pins>;
95	status = "okay";
96};
97
98&spi0 {
99	status = "okay";
100
101	flash@0 {
102		reg = <0>;
103		compatible = "jedec,spi-nor";
104		spi-max-frequency = <104000000>;
105		m25p,fast-read;
106	};
107};
108
109/* Exported on the micro USB connector J5 through an FTDI */
110&uart0 {
111	pinctrl-names = "default";
112	pinctrl-0 = <&uart1_pins>;
113	status = "okay";
114};
115
116/*
117 * Connector J17 and J18 expose a number of different features. Some pins are
118 * multiplexed. This is the case for instance for the following features:
119 * - UART1 (pin 24 = RX, pin 26 = TX). See armada-3720-db.dts for an example of
120 *   how to enable it. Beware that the signals are 1.8V TTL.
121 * - I2C
122 * - SPI
123 * - MMC
124 */
125
126/* J7 */
127&usb3 {
128	status = "okay";
129};
130
131/* J8 */
132&usb2 {
133	status = "okay";
134};
135
136&mdio {
137	switch0: switch0@1 {
138		compatible = "marvell,mv88e6085";
139		#address-cells = <1>;
140		#size-cells = <0>;
141		reg = <1>;
142
143		dsa,member = <0 0>;
144
145		ports {
146			#address-cells = <1>;
147			#size-cells = <0>;
148
149			switch0port0: port@0 {
150				reg = <0>;
151				label = "cpu";
152				ethernet = <&eth0>;
153				phy-mode = "rgmii-id";
154				fixed-link {
155					speed = <1000>;
156					full-duplex;
157				};
158			};
159
160			switch0port1: port@1 {
161				reg = <1>;
162				label = "wan";
163				phy-handle = <&switch0phy0>;
164			};
165
166			switch0port2: port@2 {
167				reg = <2>;
168				label = "lan0";
169				phy-handle = <&switch0phy1>;
170			};
171
172			switch0port3: port@3 {
173				reg = <3>;
174				label = "lan1";
175				phy-handle = <&switch0phy2>;
176			};
177
178		};
179
180		mdio {
181			#address-cells = <1>;
182			#size-cells = <0>;
183
184			switch0phy0: switch0phy0@11 {
185				reg = <0x11>;
186			};
187			switch0phy1: switch0phy1@12 {
188				reg = <0x12>;
189			};
190			switch0phy2: switch0phy2@13 {
191				reg = <0x13>;
192			};
193		};
194	};
195};
196
197&eth0 {
198	pinctrl-names = "default";
199	pinctrl-0 = <&rgmii_pins>, <&smi_pins>;
200	phy-mode = "rgmii-id";
201	status = "okay";
202
203	fixed-link {
204		speed = <1000>;
205		full-duplex;
206	};
207};
208