1/*
2 * Copyright (C) 2013,2014 Russell King
3 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPL or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 *  a) This file is free software; you can redistribute it and/or
10 *     modify it under the terms of the GNU General Public License as
11 *     published by the Free Software Foundation; either version 2 of the
12 *     License.
13 *
14 *     This file is distributed in the hope that it will be useful
15 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 *     GNU General Public License for more details.
18 *
19 * Or, alternatively
20 *
21 *  b) Permission is hereby granted, free of charge, to any person
22 *     obtaining a copy of this software and associated documentation
23 *     files (the "Software"), to deal in the Software without
24 *     restriction, including without limitation the rights to use
25 *     copy, modify, merge, publish, distribute, sublicense, and/or
26 *     sell copies of the Software, and to permit persons to whom the
27 *     Software is furnished to do so, subject to the following
28 *     conditions:
29 *
30 *     The above copyright notice and this permission notice shall be
31 *     included in all copies or substantial portions of the Software.
32 *
33 *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
34 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
38 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 *     OTHER DEALINGS IN THE SOFTWARE.
41 */
42#include "imx6qdl-microsom.dtsi"
43#include "imx6qdl-microsom-ar8035.dtsi"
44#include <dt-bindings/gpio/gpio.h>
45
46/ {
47	chosen {
48		stdout-path = &uart1;
49	};
50
51	ir_recv: ir-receiver {
52		compatible = "gpio-ir-receiver";
53		gpios = <&gpio3 5 1>;
54		pinctrl-names = "default";
55		pinctrl-0 = <&pinctrl_hummingboard_gpio3_5>;
56	};
57
58	regulators {
59		compatible = "simple-bus";
60
61		reg_3p3v: 3p3v {
62			compatible = "regulator-fixed";
63			regulator-name = "3P3V";
64			regulator-min-microvolt = <3300000>;
65			regulator-max-microvolt = <3300000>;
66			regulator-always-on;
67		};
68
69		reg_usbh1_vbus: usb-h1-vbus {
70			compatible = "regulator-fixed";
71			enable-active-high;
72			gpio = <&gpio1 0 0>;
73			pinctrl-names = "default";
74			pinctrl-0 = <&pinctrl_hummingboard_usbh1_vbus>;
75			regulator-name = "usb_h1_vbus";
76			regulator-min-microvolt = <5000000>;
77			regulator-max-microvolt = <5000000>;
78		};
79
80		reg_usbotg_vbus: usb-otg-vbus {
81			compatible = "regulator-fixed";
82			enable-active-high;
83			gpio = <&gpio3 22 0>;
84			pinctrl-names = "default";
85			pinctrl-0 = <&pinctrl_hummingboard_usbotg_vbus>;
86			regulator-name = "usb_otg_vbus";
87			regulator-min-microvolt = <5000000>;
88			regulator-max-microvolt = <5000000>;
89		};
90	};
91
92	sound-sgtl5000 {
93		audio-codec = <&sgtl5000>;
94		audio-routing =
95			"MIC_IN", "Mic Jack",
96			"Mic Jack", "Mic Bias",
97			"Headphone Jack", "HP_OUT";
98		compatible = "fsl,imx-audio-sgtl5000";
99		model = "On-board Codec";
100		mux-ext-port = <5>;
101		mux-int-port = <1>;
102		ssi-controller = <&ssi1>;
103	};
104
105	sound-spdif {
106		compatible = "fsl,imx-audio-spdif";
107		model = "On-board SPDIF";
108		/* IMX6 doesn't implement this yet */
109		spdif-controller = <&spdif>;
110		spdif-out;
111	};
112};
113
114&audmux {
115	status = "okay";
116};
117
118&can1 {
119	pinctrl-names = "default";
120	pinctrl-0 = <&pinctrl_hummingboard_flexcan1>;
121	status = "okay";
122};
123
124&hdmi {
125	pinctrl-names = "default";
126	pinctrl-0 = <&pinctrl_hummingboard_hdmi>;
127	ddc-i2c-bus = <&i2c2>;
128	status = "okay";
129};
130
131&i2c1 {
132	pinctrl-names = "default";
133	pinctrl-0 = <&pinctrl_hummingboard_i2c1>;
134	status = "okay";
135
136	/* Pro baseboard model */
137	rtc: pcf8523@68 {
138		compatible = "nxp,pcf8523";
139		reg = <0x68>;
140	};
141
142	/* Pro baseboard model */
143	sgtl5000: sgtl5000@0a {
144		clocks = <&clks IMX6QDL_CLK_CKO>;
145		compatible = "fsl,sgtl5000";
146		pinctrl-names = "default";
147		pinctrl-0 = <&pinctrl_hummingboard_sgtl5000>;
148		reg = <0x0a>;
149		VDDA-supply = <&reg_3p3v>;
150		VDDIO-supply = <&reg_3p3v>;
151	};
152};
153
154&i2c2 {
155	clock-frequency = <100000>;
156	pinctrl-names = "default";
157	pinctrl-0 = <&pinctrl_hummingboard_i2c2>;
158	status = "okay";
159};
160
161&iomuxc {
162	hummingboard {
163		pinctrl_hummingboard_flexcan1: hummingboard-flexcan1 {
164			fsl,pins = <
165				MX6QDL_PAD_SD3_CLK__FLEXCAN1_RX 0x80000000
166				MX6QDL_PAD_SD3_CMD__FLEXCAN1_TX 0x80000000
167			>;
168		};
169
170		pinctrl_hummingboard_gpio3_5: hummingboard-gpio3_5 {
171			fsl,pins = <
172				MX6QDL_PAD_EIM_DA5__GPIO3_IO05 0x1b0b1
173			>;
174		};
175
176		pinctrl_hummingboard_hdmi: hummingboard-hdmi {
177			fsl,pins = <
178				MX6QDL_PAD_KEY_ROW2__HDMI_TX_CEC_LINE 0x1f8b0
179			>;
180		};
181
182		pinctrl_hummingboard_i2c1: hummingboard-i2c1 {
183			fsl,pins = <
184				MX6QDL_PAD_EIM_D21__I2C1_SCL 0x4001b8b1
185				MX6QDL_PAD_EIM_D28__I2C1_SDA 0x4001b8b1
186			>;
187		};
188
189		pinctrl_hummingboard_i2c2: hummingboard-i2c2 {
190			fsl,pins = <
191				MX6QDL_PAD_KEY_COL3__I2C2_SCL 0x4001b8b1
192				MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
193			>;
194		};
195
196		pinctrl_hummingboard_pwm1: pwm1grp {
197			fsl,pins = <MX6QDL_PAD_DISP0_DAT8__PWM1_OUT 0x1b0b1>;
198		};
199
200		pinctrl_hummingboard_sgtl5000: hummingboard-sgtl5000 {
201			fsl,pins = <
202				MX6QDL_PAD_DISP0_DAT19__AUD5_RXD 0x130b0
203				MX6QDL_PAD_KEY_COL0__AUD5_TXC 0x130b0
204				MX6QDL_PAD_KEY_ROW0__AUD5_TXD 0x110b0
205				MX6QDL_PAD_KEY_COL1__AUD5_TXFS 0x130b0
206				MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0
207			>;
208		};
209
210		pinctrl_hummingboard_spdif: hummingboard-spdif {
211			fsl,pins = <MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x13091>;
212		};
213
214		pinctrl_hummingboard_usbh1_vbus: hummingboard-usbh1-vbus {
215			fsl,pins = <MX6QDL_PAD_GPIO_0__GPIO1_IO00 0x1b0b0>;
216		};
217
218		pinctrl_hummingboard_usbotg_id: hummingboard-usbotg-id {
219			/*
220			 * Similar to pinctrl_usbotg_2, but we want it
221			 * pulled down for a fixed host connection.
222			 */
223			fsl,pins = <MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x13059>;
224		};
225
226		pinctrl_hummingboard_usbotg_vbus: hummingboard-usbotg-vbus {
227			fsl,pins = <MX6QDL_PAD_EIM_D22__GPIO3_IO22 0x1b0b0>;
228		};
229
230		pinctrl_hummingboard_usdhc2_aux: hummingboard-usdhc2-aux {
231			fsl,pins = <
232				MX6QDL_PAD_GPIO_4__GPIO1_IO04    0x1f071
233			>;
234		};
235
236		pinctrl_hummingboard_usdhc2: hummingboard-usdhc2 {
237			fsl,pins = <
238				MX6QDL_PAD_SD2_CMD__SD2_CMD    0x17059
239				MX6QDL_PAD_SD2_CLK__SD2_CLK    0x10059
240				MX6QDL_PAD_SD2_DAT0__SD2_DATA0 0x17059
241				MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x17059
242				MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x17059
243				MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x13059
244			>;
245		};
246	};
247};
248
249&pwm1 {
250	 pinctrl-names = "default";
251	 pinctrl-0 = <&pinctrl_hummingboard_pwm1>;
252	 status = "okay";
253};
254
255&pwm2 {
256	 pinctrl-names = "default";
257	 status = "okay";
258};
259
260&spdif {
261	pinctrl-names = "default";
262	pinctrl-0 = <&pinctrl_hummingboard_spdif>;
263	status = "okay";
264};
265
266&ssi1 {
267	fsl,mode = "i2s-slave";
268	status = "okay";
269};
270
271&usbh1 {
272	disable-over-current;
273	vbus-supply = <&reg_usbh1_vbus>;
274	status = "okay";
275};
276
277&usbotg {
278	disable-over-current;
279	pinctrl-names = "default";
280	pinctrl-0 = <&pinctrl_hummingboard_usbotg_id>;
281	vbus-supply = <&reg_usbotg_vbus>;
282	status = "okay";
283};
284
285&usdhc2 {
286	pinctrl-names = "default";
287	pinctrl-0 = <
288		&pinctrl_hummingboard_usdhc2_aux
289		&pinctrl_hummingboard_usdhc2
290	>;
291	vmmc-supply = <&reg_3p3v>;
292	cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
293	status = "okay";
294};
295