1114abfe1SNeil Armstrong// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
285596034SKevin Hilman/*
385596034SKevin Hilman * Copyright (c) 2016 Andreas Färber
485596034SKevin Hilman * Copyright (c) 2016 BayLibre, Inc.
585596034SKevin Hilman * Author: Kevin Hilman <khilman@kernel.org>
685596034SKevin Hilman */
785596034SKevin Hilman
885596034SKevin Hilman/dts-v1/;
985596034SKevin Hilman
1085596034SKevin Hilman#include "meson-gxbb.dtsi"
11f40d437fSCarlo Caione#include <dt-bindings/gpio/gpio.h>
1285596034SKevin Hilman
1385596034SKevin Hilman/ {
1485596034SKevin Hilman	compatible = "hardkernel,odroid-c2", "amlogic,meson-gxbb";
1585596034SKevin Hilman	model = "Hardkernel ODROID-C2";
1685596034SKevin Hilman
1785596034SKevin Hilman	aliases {
1885596034SKevin Hilman		serial0 = &uart_AO;
19059a58fcSJorge Ramirez-Ortiz		ethernet0 = &ethmac;
2085596034SKevin Hilman	};
2185596034SKevin Hilman
2285596034SKevin Hilman	chosen {
2385596034SKevin Hilman		stdout-path = "serial0:115200n8";
2485596034SKevin Hilman	};
2585596034SKevin Hilman
2685596034SKevin Hilman	memory@0 {
2785596034SKevin Hilman		device_type = "memory";
2885596034SKevin Hilman		reg = <0x0 0x0 0x0 0x80000000>;
2985596034SKevin Hilman	};
30f40d437fSCarlo Caione
315a0803bdSBrian Kim	usb_otg_pwr: regulator-usb-pwrs {
325a0803bdSBrian Kim		compatible = "regulator-fixed";
335a0803bdSBrian Kim
345a0803bdSBrian Kim		regulator-name = "USB_OTG_PWR";
355a0803bdSBrian Kim
365a0803bdSBrian Kim		regulator-min-microvolt = <5000000>;
375a0803bdSBrian Kim		regulator-max-microvolt = <5000000>;
385a0803bdSBrian Kim
395a0803bdSBrian Kim		gpio = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
405a0803bdSBrian Kim		enable-active-high;
415a0803bdSBrian Kim	};
425a0803bdSBrian Kim
43f40d437fSCarlo Caione	leds {
44f40d437fSCarlo Caione		compatible = "gpio-leds";
45f40d437fSCarlo Caione		blue {
46f40d437fSCarlo Caione			label = "c2:blue:alive";
47f40d437fSCarlo Caione			gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_LOW>;
48f40d437fSCarlo Caione			linux,default-trigger = "heartbeat";
49f40d437fSCarlo Caione			default-state = "off";
50f40d437fSCarlo Caione		};
51f40d437fSCarlo Caione	};
52ef8d2ffeSKevin Hilman
53ef8d2ffeSKevin Hilman	tflash_vdd: regulator-tflash_vdd {
54ef8d2ffeSKevin Hilman		/*
55ef8d2ffeSKevin Hilman		 * signal name from schematics: TFLASH_VDD_EN
56ef8d2ffeSKevin Hilman		 */
57ef8d2ffeSKevin Hilman		compatible = "regulator-fixed";
58ef8d2ffeSKevin Hilman
59ef8d2ffeSKevin Hilman		regulator-name = "TFLASH_VDD";
60ef8d2ffeSKevin Hilman		regulator-min-microvolt = <3300000>;
61ef8d2ffeSKevin Hilman		regulator-max-microvolt = <3300000>;
62ef8d2ffeSKevin Hilman
63c34cd35eSNeil Armstrong		gpio = <&gpio GPIOY_12 GPIO_ACTIVE_HIGH>;
64ef8d2ffeSKevin Hilman		enable-active-high;
65ef8d2ffeSKevin Hilman	};
66ef8d2ffeSKevin Hilman
67ef8d2ffeSKevin Hilman	tf_io: gpio-regulator-tf_io {
68ef8d2ffeSKevin Hilman		compatible = "regulator-gpio";
69ef8d2ffeSKevin Hilman
70ef8d2ffeSKevin Hilman		regulator-name = "TF_IO";
71ef8d2ffeSKevin Hilman		regulator-min-microvolt = <1800000>;
72ef8d2ffeSKevin Hilman		regulator-max-microvolt = <3300000>;
73ef8d2ffeSKevin Hilman
74ef8d2ffeSKevin Hilman		/*
75ef8d2ffeSKevin Hilman		 * signal name from schematics: TF_3V3N_1V8_EN
76ef8d2ffeSKevin Hilman		 */
77ef8d2ffeSKevin Hilman		gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
78ef8d2ffeSKevin Hilman		gpios-states = <0>;
79ef8d2ffeSKevin Hilman
80ef8d2ffeSKevin Hilman		states = <3300000 0
81ef8d2ffeSKevin Hilman			  1800000 1>;
82ef8d2ffeSKevin Hilman	};
83ef8d2ffeSKevin Hilman
84ef8d2ffeSKevin Hilman	vcc1v8: regulator-vcc1v8 {
85ef8d2ffeSKevin Hilman		compatible = "regulator-fixed";
86ef8d2ffeSKevin Hilman		regulator-name = "VCC1V8";
87ef8d2ffeSKevin Hilman		regulator-min-microvolt = <1800000>;
88ef8d2ffeSKevin Hilman		regulator-max-microvolt = <1800000>;
89ef8d2ffeSKevin Hilman	};
90ef8d2ffeSKevin Hilman
91ef8d2ffeSKevin Hilman	vcc3v3: regulator-vcc3v3 {
92ef8d2ffeSKevin Hilman		compatible = "regulator-fixed";
93ef8d2ffeSKevin Hilman		regulator-name = "VCC3V3";
94ef8d2ffeSKevin Hilman		regulator-min-microvolt = <3300000>;
95ef8d2ffeSKevin Hilman		regulator-max-microvolt = <3300000>;
96ef8d2ffeSKevin Hilman	};
97ef8d2ffeSKevin Hilman
98ef8d2ffeSKevin Hilman	emmc_pwrseq: emmc-pwrseq {
99ef8d2ffeSKevin Hilman		compatible = "mmc-pwrseq-emmc";
100ef8d2ffeSKevin Hilman		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
101ef8d2ffeSKevin Hilman	};
102fc19afa1SNeil Armstrong
103fc19afa1SNeil Armstrong	hdmi-connector {
104fc19afa1SNeil Armstrong		compatible = "hdmi-connector";
105fc19afa1SNeil Armstrong		type = "a";
106fc19afa1SNeil Armstrong
107fc19afa1SNeil Armstrong		port {
108fc19afa1SNeil Armstrong			hdmi_connector_in: endpoint {
109fc19afa1SNeil Armstrong				remote-endpoint = <&hdmi_tx_tmds_out>;
110fc19afa1SNeil Armstrong			};
111fc19afa1SNeil Armstrong		};
112fc19afa1SNeil Armstrong	};
113fc19afa1SNeil Armstrong};
114fc19afa1SNeil Armstrong
115fc19afa1SNeil Armstrong&cec_AO {
116fc19afa1SNeil Armstrong	status = "okay";
117fc19afa1SNeil Armstrong	pinctrl-0 = <&ao_cec_pins>;
118fc19afa1SNeil Armstrong	pinctrl-names = "default";
119fc19afa1SNeil Armstrong	hdmi-phandle = <&hdmi_tx>;
12085596034SKevin Hilman};
12185596034SKevin Hilman
1228c5509f0SKevin Hilman&ethmac {
1238c5509f0SKevin Hilman	status = "okay";
1243be2d9cfSNeil Armstrong	pinctrl-0 = <&eth_rgmii_pins>;
1258c5509f0SKevin Hilman	pinctrl-names = "default";
126feb3cbeaSJerome Brunet	phy-handle = <&eth_phy0>;
127b6ff2721SMartin Blumenstingl	phy-mode = "rgmii";
128b6ff2721SMartin Blumenstingl
129093d23dbSMartin Blumenstingl	amlogic,tx-delay-ns = <2>;
130093d23dbSMartin Blumenstingl
131feb3cbeaSJerome Brunet	mdio {
132feb3cbeaSJerome Brunet		compatible = "snps,dwmac-mdio";
133feb3cbeaSJerome Brunet		#address-cells = <1>;
134feb3cbeaSJerome Brunet		#size-cells = <0>;
135feb3cbeaSJerome Brunet
136feb3cbeaSJerome Brunet		eth_phy0: ethernet-phy@0 {
13750290cfeSMartin Blumenstingl			/* Realtek RTL8211F (0x001cc916) */
138feb3cbeaSJerome Brunet			reg = <0>;
139f29cabf2SMartin Blumenstingl
140f29cabf2SMartin Blumenstingl			reset-assert-us = <10000>;
141f29cabf2SMartin Blumenstingl			reset-deassert-us = <30000>;
142f29cabf2SMartin Blumenstingl			reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
143f29cabf2SMartin Blumenstingl
144b94d22d9SJerome Brunet			interrupt-parent = <&gpio_intc>;
14550290cfeSMartin Blumenstingl			/* MAC_INTR on GPIOZ_15 */
146b94d22d9SJerome Brunet			interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
147feb3cbeaSJerome Brunet		};
148feb3cbeaSJerome Brunet	};
1498c5509f0SKevin Hilman};
1508c5509f0SKevin Hilman
1513b69bdbfSAndreas Färber&gpio_ao {
1523b69bdbfSAndreas Färber	/*
1533b69bdbfSAndreas Färber	 * WARNING: The USB Hub on the Odroid-C2 needs a reset signal
1543b69bdbfSAndreas Färber	 * to be turned high in order to be detected by the USB Controller
1553b69bdbfSAndreas Färber	 * This signal should be handled by a USB specific power sequence
1563b69bdbfSAndreas Färber	 * in order to reset the Hub when USB bus is powered down.
1573b69bdbfSAndreas Färber	 */
1583b69bdbfSAndreas Färber	usb-hub {
1593b69bdbfSAndreas Färber		gpio-hog;
1603b69bdbfSAndreas Färber		gpios = <GPIOAO_4 GPIO_ACTIVE_HIGH>;
1613b69bdbfSAndreas Färber		output-high;
1623b69bdbfSAndreas Färber		line-name = "usb-hub-reset";
1633b69bdbfSAndreas Färber	};
1643b69bdbfSAndreas Färber};
1653b69bdbfSAndreas Färber
166fc19afa1SNeil Armstrong&hdmi_tx {
167fc19afa1SNeil Armstrong	status = "okay";
168fc19afa1SNeil Armstrong	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
169fc19afa1SNeil Armstrong	pinctrl-names = "default";
170fc19afa1SNeil Armstrong};
171fc19afa1SNeil Armstrong
172fc19afa1SNeil Armstrong&hdmi_tx_tmds_port {
173fc19afa1SNeil Armstrong	hdmi_tx_tmds_out: endpoint {
174fc19afa1SNeil Armstrong		remote-endpoint = <&hdmi_connector_in>;
175fc19afa1SNeil Armstrong	};
176fc19afa1SNeil Armstrong};
177fc19afa1SNeil Armstrong
1783b69bdbfSAndreas Färber&i2c_A {
1793b69bdbfSAndreas Färber	status = "okay";
1803b69bdbfSAndreas Färber	pinctrl-0 = <&i2c_a_pins>;
1813b69bdbfSAndreas Färber	pinctrl-names = "default";
1823b69bdbfSAndreas Färber};
1833b69bdbfSAndreas Färber
1843b69bdbfSAndreas Färber&ir {
1853b69bdbfSAndreas Färber	status = "okay";
1863b69bdbfSAndreas Färber	pinctrl-0 = <&remote_input_ao_pins>;
1873b69bdbfSAndreas Färber	pinctrl-names = "default";
1883b69bdbfSAndreas Färber};
1893b69bdbfSAndreas Färber
1902165b006SNeil Armstrong&gpio_ao {
191b03c7d64SNeil Armstrong	gpio-line-names = "UART TX", "UART RX", "VCCK En", "TF 3V3/1V8 En",
192b03c7d64SNeil Armstrong			  "USB HUB nRESET", "USB OTG Power En",
193b03c7d64SNeil Armstrong			  "J7 Header Pin2", "IR In", "J7 Header Pin4",
194b03c7d64SNeil Armstrong			  "J7 Header Pin6", "J7 Header Pin5", "J7 Header Pin7",
195e43f20e8SJerome Brunet			  "HDMI CEC", "SYS LED",
196e43f20e8SJerome Brunet			  /* GPIO_TEST_N */
197e43f20e8SJerome Brunet			  "";
198b03c7d64SNeil Armstrong};
199b03c7d64SNeil Armstrong
2002165b006SNeil Armstrong&gpio {
201b03c7d64SNeil Armstrong	gpio-line-names = /* Bank GPIOZ */
202b03c7d64SNeil Armstrong			  "Eth MDIO", "Eth MDC", "Eth RGMII RX Clk",
203b03c7d64SNeil Armstrong			  "Eth RX DV", "Eth RX D0", "Eth RX D1", "Eth RX D2",
204b03c7d64SNeil Armstrong			  "Eth RX D3", "Eth RGMII TX Clk", "Eth TX En",
205b03c7d64SNeil Armstrong			  "Eth TX D0", "Eth TX D1", "Eth TX D2", "Eth TX D3",
206b03c7d64SNeil Armstrong			  "Eth PHY nRESET", "Eth PHY Intc",
207b03c7d64SNeil Armstrong			  /* Bank GPIOH */
208b03c7d64SNeil Armstrong			  "HDMI HPD", "HDMI DDC SDA", "HDMI DDC SCL", "",
209b03c7d64SNeil Armstrong			  /* Bank BOOT */
210b03c7d64SNeil Armstrong			  "eMMC D0", "eMMC D1", "eMMC D2", "eMMC D3", "eMMC D4",
211b03c7d64SNeil Armstrong			  "eMMC D5", "eMMC D6", "eMMC D7", "eMMC Clk",
212b03c7d64SNeil Armstrong			  "eMMC Reset", "eMMC CMD",
213b03c7d64SNeil Armstrong			  "", "", "", "", "", "", "",
214b03c7d64SNeil Armstrong			  /* Bank CARD */
215b03c7d64SNeil Armstrong			  "SDCard D1", "SDCard D0", "SDCard CLK", "SDCard CMD",
216b03c7d64SNeil Armstrong			  "SDCard D3", "SDCard D2", "SDCard Det",
217b03c7d64SNeil Armstrong			  /* Bank GPIODV */
218b03c7d64SNeil Armstrong			  "", "", "", "", "", "", "", "", "", "", "", "", "",
219b03c7d64SNeil Armstrong			  "", "", "", "", "", "", "", "", "", "", "",
220b03c7d64SNeil Armstrong			  "I2C A SDA", "I2C A SCK", "I2C B SDA", "I2C B SCK",
221b03c7d64SNeil Armstrong			  "PWM D", "PWM B",
222b03c7d64SNeil Armstrong			  /* Bank GPIOY */
223b03c7d64SNeil Armstrong			  "Revision Bit0", "Revision Bit1", "",
224b03c7d64SNeil Armstrong			  "J2 Header Pin35", "", "", "", "J2 Header Pin36",
225b03c7d64SNeil Armstrong			  "J2 Header Pin31", "", "", "", "TF VDD En",
226b03c7d64SNeil Armstrong			  "J2 Header Pin32", "J2 Header Pin26", "", "",
227b03c7d64SNeil Armstrong			  /* Bank GPIOX */
228b03c7d64SNeil Armstrong			  "J2 Header Pin29", "J2 Header Pin24",
229b03c7d64SNeil Armstrong			  "J2 Header Pin23", "J2 Header Pin22",
230b03c7d64SNeil Armstrong			  "J2 Header Pin21", "J2 Header Pin18",
231b03c7d64SNeil Armstrong			  "J2 Header Pin33", "J2 Header Pin19",
232b03c7d64SNeil Armstrong			  "J2 Header Pin16", "J2 Header Pin15",
233b03c7d64SNeil Armstrong			  "J2 Header Pin12", "J2 Header Pin13",
234b03c7d64SNeil Armstrong			  "J2 Header Pin8", "J2 Header Pin10",
235b03c7d64SNeil Armstrong			  "", "", "", "", "",
236e43f20e8SJerome Brunet			  "J2 Header Pin11", "", "J2 Header Pin7", "",
237b03c7d64SNeil Armstrong			  /* Bank GPIOCLK */
238e43f20e8SJerome Brunet			  "", "", "", "";
239b03c7d64SNeil Armstrong};
240b03c7d64SNeil Armstrong
24162158c6aSHeiner Kallweit&saradc {
24262158c6aSHeiner Kallweit	status = "okay";
24362158c6aSHeiner Kallweit	vref-supply = <&vcc1v8>;
24462158c6aSHeiner Kallweit};
24562158c6aSHeiner Kallweit
2463b69bdbfSAndreas Färber&scpi_clocks {
2473b69bdbfSAndreas Färber	status = "disabled";
2483b69bdbfSAndreas Färber};
2493b69bdbfSAndreas Färber
250ef8d2ffeSKevin Hilman/* SD */
251ef8d2ffeSKevin Hilman&sd_emmc_b {
252ef8d2ffeSKevin Hilman	status = "okay";
253ef8d2ffeSKevin Hilman	pinctrl-0 = <&sdcard_pins>;
25467e7607fSJerome Brunet	pinctrl-1 = <&sdcard_clk_gate_pins>;
25567e7607fSJerome Brunet	pinctrl-names = "default", "clk-gate";
256ef8d2ffeSKevin Hilman
257ef8d2ffeSKevin Hilman	bus-width = <4>;
258ef8d2ffeSKevin Hilman	cap-sd-highspeed;
2597e2b33ffSJerome Brunet	sd-uhs-sdr12;
2607e2b33ffSJerome Brunet	sd-uhs-sdr25;
2617e2b33ffSJerome Brunet	sd-uhs-sdr50;
2627e2b33ffSJerome Brunet	sd-uhs-ddr50;
263ef8d2ffeSKevin Hilman	max-frequency = <100000000>;
264ef8d2ffeSKevin Hilman	disable-wp;
265ef8d2ffeSKevin Hilman
266f29200c8SLoys Ollivier	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
267ef8d2ffeSKevin Hilman
268ef8d2ffeSKevin Hilman	vmmc-supply = <&tflash_vdd>;
269ef8d2ffeSKevin Hilman	vqmmc-supply = <&tf_io>;
270ef8d2ffeSKevin Hilman};
271ef8d2ffeSKevin Hilman
272ef8d2ffeSKevin Hilman/* eMMC */
273ef8d2ffeSKevin Hilman&sd_emmc_c {
274ef8d2ffeSKevin Hilman	status = "okay";
275ab36be66SNeil Armstrong	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
27667e7607fSJerome Brunet	pinctrl-1 = <&emmc_clk_gate_pins>;
27767e7607fSJerome Brunet	pinctrl-names = "default", "clk-gate";
278ef8d2ffeSKevin Hilman
279ef8d2ffeSKevin Hilman	bus-width = <8>;
2807e2b33ffSJerome Brunet	max-frequency = <200000000>;
281ef8d2ffeSKevin Hilman	non-removable;
282ef8d2ffeSKevin Hilman	disable-wp;
283ef8d2ffeSKevin Hilman	cap-mmc-highspeed;
284ef8d2ffeSKevin Hilman	mmc-ddr-1_8v;
285ef8d2ffeSKevin Hilman	mmc-hs200-1_8v;
286ef8d2ffeSKevin Hilman
287ef8d2ffeSKevin Hilman	mmc-pwrseq = <&emmc_pwrseq>;
288ef8d2ffeSKevin Hilman	vmmc-supply = <&vcc3v3>;
289ef8d2ffeSKevin Hilman	vqmmc-supply = <&vcc1v8>;
290ef8d2ffeSKevin Hilman};
2913b69bdbfSAndreas Färber
2923b69bdbfSAndreas Färber&uart_AO {
2933b69bdbfSAndreas Färber	status = "okay";
2943b69bdbfSAndreas Färber	pinctrl-0 = <&uart_ao_a_pins>;
2953b69bdbfSAndreas Färber	pinctrl-names = "default";
2963b69bdbfSAndreas Färber};
2973b69bdbfSAndreas Färber
2983b69bdbfSAndreas Färber&usb0_phy {
2993b69bdbfSAndreas Färber	status = "okay";
3003b69bdbfSAndreas Färber	phy-supply = <&usb_otg_pwr>;
3013b69bdbfSAndreas Färber};
3023b69bdbfSAndreas Färber
3033b69bdbfSAndreas Färber&usb1_phy {
3043b69bdbfSAndreas Färber	status = "okay";
305e841ec95SNeil Armstrong	phy-supply = <&usb_otg_pwr>;
3063b69bdbfSAndreas Färber};
3073b69bdbfSAndreas Färber
3083b69bdbfSAndreas Färber&usb0 {
3093b69bdbfSAndreas Färber	status = "okay";
3103b69bdbfSAndreas Färber};
3113b69bdbfSAndreas Färber
3123b69bdbfSAndreas Färber&usb1 {
3133b69bdbfSAndreas Färber	status = "okay";
3143b69bdbfSAndreas Färber};
315