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	status = "okay";
102};
103
104/* J7 */
105&usb3 {
106	status = "okay";
107};
108
109/* J8 */
110&usb2 {
111	status = "okay";
112};
113
114&mdio {
115	switch0: switch0@1 {
116		compatible = "marvell,mv88e6085";
117		#address-cells = <1>;
118		#size-cells = <0>;
119		reg = <1>;
120
121		dsa,member = <0 0>;
122
123		ports {
124			#address-cells = <1>;
125			#size-cells = <0>;
126
127			port@0 {
128				reg = <0>;
129				label = "cpu";
130				ethernet = <&eth0>;
131			};
132
133			port@1 {
134				reg = <1>;
135				label = "wan";
136				phy-handle = <&switch0phy0>;
137			};
138
139			port@2 {
140				reg = <2>;
141				label = "lan0";
142				phy-handle = <&switch0phy1>;
143			};
144
145			port@3 {
146				reg = <3>;
147				label = "lan1";
148				phy-handle = <&switch0phy2>;
149			};
150
151		};
152
153		mdio {
154			#address-cells = <1>;
155			#size-cells = <0>;
156
157			switch0phy0: switch0phy0@11 {
158				reg = <0x11>;
159			};
160			switch0phy1: switch0phy1@12 {
161				reg = <0x12>;
162			};
163			switch0phy2: switch0phy2@13 {
164				reg = <0x13>;
165			};
166		};
167	};
168};
169
170&eth0 {
171	phy-mode = "rgmii-id";
172	status = "okay";
173
174	fixed-link {
175		speed = <1000>;
176		full-duplex;
177	};
178};
179