1ac40004dSKevin Hilman/*
2ac40004dSKevin Hilman * Copyright (c) 2016 Andreas Färber
3ac40004dSKevin Hilman * Copyright (c) 2016 BayLibre, Inc.
4ac40004dSKevin Hilman * Author: Kevin Hilman <khilman@kernel.org>
5ac40004dSKevin Hilman *
6ac40004dSKevin Hilman * This file is dual-licensed: you can use it either under the terms
7ac40004dSKevin Hilman * of the GPL or the X11 license, at your option. Note that this dual
8ac40004dSKevin Hilman * licensing only applies to this file, and not this project as a
9ac40004dSKevin Hilman * whole.
10ac40004dSKevin Hilman *
11ac40004dSKevin Hilman *  a) This library is free software; you can redistribute it and/or
12ac40004dSKevin Hilman *     modify it under the terms of the GNU General Public License as
13ac40004dSKevin Hilman *     published by the Free Software Foundation; either version 2 of the
14ac40004dSKevin Hilman *     License, or (at your option) any later version.
15ac40004dSKevin Hilman *
16ac40004dSKevin Hilman *     This library is distributed in the hope that it will be useful,
17ac40004dSKevin Hilman *     but WITHOUT ANY WARRANTY; without even the implied warranty of
18ac40004dSKevin Hilman *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19ac40004dSKevin Hilman *     GNU General Public License for more details.
20ac40004dSKevin Hilman *
21ac40004dSKevin Hilman * Or, alternatively,
22ac40004dSKevin Hilman *
23ac40004dSKevin Hilman *  b) Permission is hereby granted, free of charge, to any person
24ac40004dSKevin Hilman *     obtaining a copy of this software and associated documentation
25ac40004dSKevin Hilman *     files (the "Software"), to deal in the Software without
26ac40004dSKevin Hilman *     restriction, including without limitation the rights to use,
27ac40004dSKevin Hilman *     copy, modify, merge, publish, distribute, sublicense, and/or
28ac40004dSKevin Hilman *     sell copies of the Software, and to permit persons to whom the
29ac40004dSKevin Hilman *     Software is furnished to do so, subject to the following
30ac40004dSKevin Hilman *     conditions:
31ac40004dSKevin Hilman *
32ac40004dSKevin Hilman *     The above copyright notice and this permission notice shall be
33ac40004dSKevin Hilman *     included in all copies or substantial portions of the Software.
34ac40004dSKevin Hilman *
35ac40004dSKevin Hilman *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36ac40004dSKevin Hilman *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
37ac40004dSKevin Hilman *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38ac40004dSKevin Hilman *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
39ac40004dSKevin Hilman *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
40ac40004dSKevin Hilman *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41ac40004dSKevin Hilman *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42ac40004dSKevin Hilman *     OTHER DEALINGS IN THE SOFTWARE.
43ac40004dSKevin Hilman */
44ac40004dSKevin Hilman
45ac40004dSKevin Hilman#include "meson-gxbb.dtsi"
46ac40004dSKevin Hilman
47ac40004dSKevin Hilman/ {
48ac40004dSKevin Hilman	aliases {
49ac40004dSKevin Hilman		serial0 = &uart_AO;
50ac40004dSKevin Hilman	};
51ac40004dSKevin Hilman
52ac40004dSKevin Hilman	chosen {
53ac40004dSKevin Hilman		stdout-path = "serial0:115200n8";
54ac40004dSKevin Hilman	};
55ac40004dSKevin Hilman
56ac40004dSKevin Hilman	memory@0 {
57ac40004dSKevin Hilman		device_type = "memory";
58ac40004dSKevin Hilman		reg = <0x0 0x0 0x0 0x40000000>;
59ac40004dSKevin Hilman	};
608735053dSJerome Brunet
618735053dSJerome Brunet	usb_pwr: regulator-usb-pwrs {
628735053dSJerome Brunet		compatible = "regulator-fixed";
638735053dSJerome Brunet
648735053dSJerome Brunet		regulator-name = "USB_PWR";
658735053dSJerome Brunet
668735053dSJerome Brunet		regulator-min-microvolt = <5000000>;
678735053dSJerome Brunet		regulator-max-microvolt = <5000000>;
688735053dSJerome Brunet
698735053dSJerome Brunet		/* signal name in schematic: USB_PWR_EN */
708735053dSJerome Brunet		gpio = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
718735053dSJerome Brunet		enable-active-high;
728735053dSJerome Brunet	};
73ef8d2ffeSKevin Hilman
74ef8d2ffeSKevin Hilman	vddio_card: gpio-regulator {
75ef8d2ffeSKevin Hilman		compatible = "regulator-gpio";
76ef8d2ffeSKevin Hilman
77ef8d2ffeSKevin Hilman		regulator-name = "VDDIO_CARD";
78ef8d2ffeSKevin Hilman		regulator-min-microvolt = <1800000>;
79ef8d2ffeSKevin Hilman		regulator-max-microvolt = <3300000>;
80ef8d2ffeSKevin Hilman
81ef8d2ffeSKevin Hilman		gpios = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
82ef8d2ffeSKevin Hilman		gpios-states = <1>;
83ef8d2ffeSKevin Hilman
84ef8d2ffeSKevin Hilman		/* Based on P200 schematics, signal CARD_1.8V/3.3V_CTR */
85ef8d2ffeSKevin Hilman		states = <1800000 0
86ef8d2ffeSKevin Hilman			  3300000 1>;
87ef8d2ffeSKevin Hilman	};
88ef8d2ffeSKevin Hilman
89ef8d2ffeSKevin Hilman	vddio_boot: regulator-vddio_boot {
90ef8d2ffeSKevin Hilman		compatible = "regulator-fixed";
91ef8d2ffeSKevin Hilman		regulator-name = "VDDIO_BOOT";
92ef8d2ffeSKevin Hilman		regulator-min-microvolt = <1800000>;
93ef8d2ffeSKevin Hilman		regulator-max-microvolt = <1800000>;
94ef8d2ffeSKevin Hilman	};
95ef8d2ffeSKevin Hilman
96ef8d2ffeSKevin Hilman	vddao_3v3: regulator-vddao_3v3 {
97ef8d2ffeSKevin Hilman		compatible = "regulator-fixed";
98ef8d2ffeSKevin Hilman		regulator-name = "VDDAO_3V3";
99ef8d2ffeSKevin Hilman		regulator-min-microvolt = <3300000>;
100ef8d2ffeSKevin Hilman		regulator-max-microvolt = <3300000>;
101ef8d2ffeSKevin Hilman	};
102ef8d2ffeSKevin Hilman
103ef8d2ffeSKevin Hilman	vcc_3v3: regulator-vcc_3v3 {
104ef8d2ffeSKevin Hilman		compatible = "regulator-fixed";
105ef8d2ffeSKevin Hilman		regulator-name = "VCC_3V3";
106ef8d2ffeSKevin Hilman		regulator-min-microvolt = <3300000>;
107ef8d2ffeSKevin Hilman		regulator-max-microvolt = <3300000>;
108ef8d2ffeSKevin Hilman	};
109ef8d2ffeSKevin Hilman
110ef8d2ffeSKevin Hilman	emmc_pwrseq: emmc-pwrseq {
111ef8d2ffeSKevin Hilman		compatible = "mmc-pwrseq-emmc";
112ef8d2ffeSKevin Hilman		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
113ef8d2ffeSKevin Hilman	};
114caafa69dSNeil Armstrong
115caafa69dSNeil Armstrong	wifi32k: wifi32k {
116caafa69dSNeil Armstrong		compatible = "pwm-clock";
117caafa69dSNeil Armstrong		#clock-cells = <0>;
118caafa69dSNeil Armstrong		clock-frequency = <32768>;
119caafa69dSNeil Armstrong		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
120caafa69dSNeil Armstrong	};
121ab3943feSNeil Armstrong
122ab3943feSNeil Armstrong	sdio_pwrseq: sdio-pwrseq {
123ab3943feSNeil Armstrong		compatible = "mmc-pwrseq-simple";
124ab3943feSNeil Armstrong		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
125ab3943feSNeil Armstrong		clocks = <&wifi32k>;
126ab3943feSNeil Armstrong		clock-names = "ext_clock";
127ab3943feSNeil Armstrong	};
128fafdbdf7SNeil Armstrong
129748a421dSAndreas Färber	cvbs_connector: cvbs-connector {
130fafdbdf7SNeil Armstrong		compatible = "composite-video-connector";
131fafdbdf7SNeil Armstrong
132fafdbdf7SNeil Armstrong		port {
133fafdbdf7SNeil Armstrong			cvbs_connector_in: endpoint {
134fafdbdf7SNeil Armstrong				remote-endpoint = <&cvbs_vdac_out>;
135fafdbdf7SNeil Armstrong			};
136fafdbdf7SNeil Armstrong		};
137fafdbdf7SNeil Armstrong	};
1386939db7eSNeil Armstrong
1396939db7eSNeil Armstrong	hdmi-connector {
1406939db7eSNeil Armstrong		compatible = "hdmi-connector";
1416939db7eSNeil Armstrong		type = "a";
1426939db7eSNeil Armstrong
1436939db7eSNeil Armstrong		port {
1446939db7eSNeil Armstrong			hdmi_connector_in: endpoint {
1456939db7eSNeil Armstrong				remote-endpoint = <&hdmi_tx_tmds_out>;
1466939db7eSNeil Armstrong			};
1476939db7eSNeil Armstrong		};
1486939db7eSNeil Armstrong	};
149ac40004dSKevin Hilman};
150ac40004dSKevin Hilman
15167fe352fSAndreas Färber&cvbs_vdac_port {
15267fe352fSAndreas Färber	cvbs_vdac_out: endpoint {
15367fe352fSAndreas Färber		remote-endpoint = <&cvbs_connector_in>;
15467fe352fSAndreas Färber	};
15567fe352fSAndreas Färber};
15667fe352fSAndreas Färber
15767fe352fSAndreas Färber&hdmi_tx {
158ac40004dSKevin Hilman	status = "okay";
15967fe352fSAndreas Färber	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
160f40d437fSCarlo Caione	pinctrl-names = "default";
161ac40004dSKevin Hilman};
1628c5509f0SKevin Hilman
16367fe352fSAndreas Färber&hdmi_tx_tmds_port {
16467fe352fSAndreas Färber	hdmi_tx_tmds_out: endpoint {
16567fe352fSAndreas Färber		remote-endpoint = <&hdmi_connector_in>;
16667fe352fSAndreas Färber	};
16767fe352fSAndreas Färber};
16867fe352fSAndreas Färber
169ae89ed79SMartin Blumenstingl&ir {
170ae89ed79SMartin Blumenstingl	status = "okay";
171ae89ed79SMartin Blumenstingl	pinctrl-0 = <&remote_input_ao_pins>;
172ae89ed79SMartin Blumenstingl	pinctrl-names = "default";
173ae89ed79SMartin Blumenstingl};
1748735053dSJerome Brunet
17567fe352fSAndreas Färber&pwm_ef {
1768735053dSJerome Brunet	status = "okay";
17767fe352fSAndreas Färber	pinctrl-0 = <&pwm_e_pins>;
17867fe352fSAndreas Färber	pinctrl-names = "default";
17967fe352fSAndreas Färber	clocks = <&clkc CLKID_FCLK_DIV4>;
18067fe352fSAndreas Färber	clock-names = "clkin0";
1818735053dSJerome Brunet};
182ef8d2ffeSKevin Hilman
183ef8d2ffeSKevin Hilman/* Wireless SDIO Module */
184ef8d2ffeSKevin Hilman&sd_emmc_a {
185ef8d2ffeSKevin Hilman	status = "okay";
186ef8d2ffeSKevin Hilman	pinctrl-0 = <&sdio_pins>;
187ef8d2ffeSKevin Hilman	pinctrl-names = "default";
188ef8d2ffeSKevin Hilman	#address-cells = <1>;
189ef8d2ffeSKevin Hilman	#size-cells = <0>;
190ef8d2ffeSKevin Hilman
191ef8d2ffeSKevin Hilman	bus-width = <4>;
192ef8d2ffeSKevin Hilman	cap-sd-highspeed;
193ef8d2ffeSKevin Hilman	max-frequency = <100000000>;
194ef8d2ffeSKevin Hilman
195ef8d2ffeSKevin Hilman	non-removable;
196ef8d2ffeSKevin Hilman	disable-wp;
197ef8d2ffeSKevin Hilman
198ab3943feSNeil Armstrong	mmc-pwrseq = <&sdio_pwrseq>;
199ab3943feSNeil Armstrong
200ef8d2ffeSKevin Hilman	vmmc-supply = <&vddao_3v3>;
201ef8d2ffeSKevin Hilman	vqmmc-supply = <&vddio_boot>;
202ab3943feSNeil Armstrong
203e0e216ebSAndreas Färber	brcmf: wifi@1 {
204ab3943feSNeil Armstrong		reg = <1>;
205ab3943feSNeil Armstrong		compatible = "brcm,bcm4329-fmac";
206ab3943feSNeil Armstrong	};
207ef8d2ffeSKevin Hilman};
208ef8d2ffeSKevin Hilman
209ef8d2ffeSKevin Hilman/* SD card */
210ef8d2ffeSKevin Hilman&sd_emmc_b {
211ef8d2ffeSKevin Hilman	status = "okay";
212ef8d2ffeSKevin Hilman	pinctrl-0 = <&sdcard_pins>;
213ef8d2ffeSKevin Hilman	pinctrl-names = "default";
214ef8d2ffeSKevin Hilman
215ef8d2ffeSKevin Hilman	bus-width = <4>;
216ef8d2ffeSKevin Hilman	cap-sd-highspeed;
217ef8d2ffeSKevin Hilman	max-frequency = <100000000>;
218ef8d2ffeSKevin Hilman	disable-wp;
219ef8d2ffeSKevin Hilman
220ef8d2ffeSKevin Hilman	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
221ef8d2ffeSKevin Hilman	cd-inverted;
222ef8d2ffeSKevin Hilman
223ef8d2ffeSKevin Hilman	vmmc-supply = <&vddao_3v3>;
224ef8d2ffeSKevin Hilman	vqmmc-supply = <&vddio_card>;
225ef8d2ffeSKevin Hilman};
226ef8d2ffeSKevin Hilman
227ef8d2ffeSKevin Hilman/* eMMC */
228ef8d2ffeSKevin Hilman&sd_emmc_c {
229ef8d2ffeSKevin Hilman	status = "okay";
230ef8d2ffeSKevin Hilman	pinctrl-0 = <&emmc_pins>;
231ef8d2ffeSKevin Hilman	pinctrl-names = "default";
232ef8d2ffeSKevin Hilman
233ef8d2ffeSKevin Hilman	bus-width = <8>;
234ef8d2ffeSKevin Hilman	cap-sd-highspeed;
235ef8d2ffeSKevin Hilman	cap-mmc-highspeed;
236ef8d2ffeSKevin Hilman	max-frequency = <200000000>;
237ef8d2ffeSKevin Hilman	non-removable;
238ef8d2ffeSKevin Hilman	disable-wp;
239ef8d2ffeSKevin Hilman	mmc-ddr-1_8v;
240ef8d2ffeSKevin Hilman	mmc-hs200-1_8v;
241ef8d2ffeSKevin Hilman
242ef8d2ffeSKevin Hilman	mmc-pwrseq = <&emmc_pwrseq>;
243ef8d2ffeSKevin Hilman	vmmc-supply = <&vcc_3v3>;
244ef8d2ffeSKevin Hilman	vqmmc-supply = <&vddio_boot>;
245ef8d2ffeSKevin Hilman};
246caafa69dSNeil Armstrong
24767fe352fSAndreas Färber/* This UART is brought out to the DB9 connector */
24867fe352fSAndreas Färber&uart_AO {
249caafa69dSNeil Armstrong	status = "okay";
25067fe352fSAndreas Färber	pinctrl-0 = <&uart_ao_a_pins>;
2516939db7eSNeil Armstrong	pinctrl-names = "default";
2526939db7eSNeil Armstrong};
2536939db7eSNeil Armstrong
25467fe352fSAndreas Färber&usb0_phy {
25567fe352fSAndreas Färber	status = "okay";
25667fe352fSAndreas Färber	phy-supply = <&usb_pwr>;
2576939db7eSNeil Armstrong};
25867fe352fSAndreas Färber
25967fe352fSAndreas Färber&usb1_phy {
26067fe352fSAndreas Färber	status = "okay";
26167fe352fSAndreas Färber};
26267fe352fSAndreas Färber
26367fe352fSAndreas Färber&usb0 {
26467fe352fSAndreas Färber	status = "okay";
26567fe352fSAndreas Färber};
26667fe352fSAndreas Färber
26767fe352fSAndreas Färber&usb1 {
26867fe352fSAndreas Färber	status = "okay";
2696939db7eSNeil Armstrong};
270