1/*
2 * Device Tree file for Globalscale Marvell ESPRESSOBin Board
3 * Copyright (C) 2016 Marvell
4 *
5 * Romain Perier <romain.perier@free-electrons.com>
6 *
7 * This file is dual-licensed: you can use it either under the terms
8 * of the GPL or the X11 license, at your option. Note that this dual
9 * licensing only applies to this file, and not this project as a
10 * whole.
11 *
12 *  a) This file is free software; you can redistribute it and/or
13 *     modify it under the terms of the GNU General Public License as
14 *     published by the Free Software Foundation; either version 2 of the
15 *     License, or (at your option) any later version.
16 *
17 *     This file is distributed in the hope that it will be useful,
18 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
19 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 *     GNU General Public License for more details.
21 *
22 * Or, alternatively,
23 *
24 *  b) Permission is hereby granted, free of charge, to any person
25 *     obtaining a copy of this software and associated documentation
26 *     files (the "Software"), to deal in the Software without
27 *     restriction, including without limitation the rights to use,
28 *     copy, modify, merge, publish, distribute, sublicense, and/or
29 *     sell copies of the Software, and to permit persons to whom the
30 *     Software is furnished to do so, subject to the following
31 *     conditions:
32 *
33 *     The above copyright notice and this permission notice shall be
34 *     included in all copies or substantial portions of the Software.
35 *
36 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
38 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
39 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
40 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
41 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
42 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
43 *     OTHER DEALINGS IN THE SOFTWARE.
44 */
45
46/dts-v1/;
47
48#include <dt-bindings/gpio/gpio.h>
49#include "armada-372x.dtsi"
50
51/ {
52	model = "Globalscale Marvell ESPRESSOBin Board";
53	compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710";
54
55	chosen {
56		stdout-path = "serial0:115200n8";
57	};
58
59	memory@0 {
60		device_type = "memory";
61		reg = <0x00000000 0x00000000 0x00000000 0x20000000>;
62	};
63
64	vcc_sd_reg1: regulator {
65		compatible = "regulator-gpio";
66		regulator-name = "vcc_sd1";
67		regulator-min-microvolt = <1800000>;
68		regulator-max-microvolt = <3300000>;
69		regulator-boot-on;
70
71		gpios = <&gpionb 4 GPIO_ACTIVE_HIGH>;
72		gpios-states = <0>;
73		states = <1800000 0x1
74			  3300000 0x0>;
75		enable-active-high;
76	};
77};
78
79/* J9 */
80&pcie0 {
81	status = "okay";
82};
83
84/* J6 */
85&sata {
86	status = "okay";
87};
88
89/* J1 */
90&sdhci1 {
91	wp-inverted;
92	bus-width = <4>;
93	cd-gpios = <&gpionb 3 GPIO_ACTIVE_LOW>;
94	marvell,pad-type = "sd";
95	vqmmc-supply = <&vcc_sd_reg1>;
96	status = "okay";
97};
98
99/* Exported on the micro USB connector J5 through an FTDI */
100&uart0 {
101	pinctrl-names = "default";
102	pinctrl-0 = <&uart1_pins>;
103	status = "okay";
104};
105
106/*
107 * Connector J17 and J18 expose a number of different features. Some pins are
108 * multiplexed. This is the case for instance for the following features:
109 * - UART1 (pin 24 = RX, pin 26 = TX). See armada-3720-db.dts for an example of
110 *   how to enable it. Beware that the signals are 1.8V TTL.
111 * - I2C
112 * - SPI
113 * - MMC
114 */
115
116/* J7 */
117&usb3 {
118	status = "okay";
119};
120
121/* J8 */
122&usb2 {
123	status = "okay";
124};
125
126&mdio {
127	switch0: switch0@1 {
128		compatible = "marvell,mv88e6085";
129		#address-cells = <1>;
130		#size-cells = <0>;
131		reg = <1>;
132
133		dsa,member = <0 0>;
134
135		ports {
136			#address-cells = <1>;
137			#size-cells = <0>;
138
139			port@0 {
140				reg = <0>;
141				label = "cpu";
142				ethernet = <&eth0>;
143			};
144
145			port@1 {
146				reg = <1>;
147				label = "wan";
148				phy-handle = <&switch0phy0>;
149			};
150
151			port@2 {
152				reg = <2>;
153				label = "lan0";
154				phy-handle = <&switch0phy1>;
155			};
156
157			port@3 {
158				reg = <3>;
159				label = "lan1";
160				phy-handle = <&switch0phy2>;
161			};
162
163		};
164
165		mdio {
166			#address-cells = <1>;
167			#size-cells = <0>;
168
169			switch0phy0: switch0phy0@11 {
170				reg = <0x11>;
171			};
172			switch0phy1: switch0phy1@12 {
173				reg = <0x12>;
174			};
175			switch0phy2: switch0phy2@13 {
176				reg = <0x13>;
177			};
178		};
179	};
180};
181
182&eth0 {
183	phy-mode = "rgmii-id";
184	status = "okay";
185
186	fixed-link {
187		speed = <1000>;
188		full-duplex;
189	};
190};
191