1279377Simp/*
2279377Simp * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
3279377Simp *
4279377Simp * This program is free software; you can redistribute it and/or modify
5279377Simp * it under the terms of the GNU General Public License version 2 as
6279377Simp * published by the Free Software Foundation.
7279377Simp */
8279377Simp
9279377Simp/dts-v1/;
10279377Simp
11279377Simp#include "am4372.dtsi"
12279377Simp#include <dt-bindings/pinctrl/am43xx.h>
13279377Simp#include <dt-bindings/pwm/pwm.h>
14279377Simp#include <dt-bindings/gpio/gpio.h>
15279377Simp#include <dt-bindings/input/input.h>
16279377Simp
17279377Simp/ {
18279377Simp	model = "TI AM437x Industrial Development Kit";
19279377Simp	compatible = "ti,am437x-idk-evm","ti,am4372","ti,am43";
20279377Simp
21279377Simp	v24_0d: fixed-regulator-v24_0d {
22279377Simp		compatible = "regulator-fixed";
23279377Simp		regulator-name = "V24_0D";
24279377Simp		regulator-min-microvolt = <24000000>;
25279377Simp		regulator-max-microvolt = <24000000>;
26279377Simp		regulator-always-on;
27279377Simp		regulator-boot-on;
28279377Simp	};
29279377Simp
30279377Simp	v3_3d: fixed-regulator-v3_3d {
31279377Simp		compatible = "regulator-fixed";
32279377Simp		regulator-name = "V3_3D";
33279377Simp		regulator-min-microvolt = <3300000>;
34279377Simp		regulator-max-microvolt = <3300000>;
35279377Simp		regulator-always-on;
36279377Simp		regulator-boot-on;
37279377Simp		vin-supply = <&v24_0d>;
38279377Simp	};
39279377Simp
40279377Simp	vdd_corereg: fixed-regulator-vdd_corereg {
41279377Simp		compatible = "regulator-fixed";
42279377Simp		regulator-name = "VDD_COREREG";
43279377Simp		regulator-min-microvolt = <1100000>;
44279377Simp		regulator-max-microvolt = <1100000>;
45279377Simp		regulator-always-on;
46279377Simp		regulator-boot-on;
47279377Simp		vin-supply = <&v24_0d>;
48279377Simp	};
49279377Simp
50279377Simp	vdd_core: fixed-regulator-vdd_core {
51279377Simp		compatible = "regulator-fixed";
52279377Simp		regulator-name = "VDD_CORE";
53279377Simp		regulator-min-microvolt = <1100000>;
54279377Simp		regulator-max-microvolt = <1100000>;
55279377Simp		regulator-always-on;
56279377Simp		regulator-boot-on;
57279377Simp		vin-supply = <&vdd_corereg>;
58279377Simp	};
59279377Simp
60279377Simp	v1_8dreg: fixed-regulator-v1_8dreg{
61279377Simp		compatible = "regulator-fixed";
62279377Simp		regulator-name = "V1_8DREG";
63279377Simp		regulator-min-microvolt = <1800000>;
64279377Simp		regulator-max-microvolt = <1800000>;
65279377Simp		regulator-always-on;
66279377Simp		regulator-boot-on;
67279377Simp		vin-supply = <&v24_0d>;
68279377Simp	};
69279377Simp
70279377Simp	v1_8d: fixed-regulator-v1_8d{
71279377Simp		compatible = "regulator-fixed";
72279377Simp		regulator-name = "V1_8D";
73279377Simp		regulator-min-microvolt = <1800000>;
74279377Simp		regulator-max-microvolt = <1800000>;
75279377Simp		regulator-always-on;
76279377Simp		regulator-boot-on;
77279377Simp		vin-supply = <&v1_8dreg>;
78279377Simp	};
79279377Simp
80279377Simp	v1_5dreg: fixed-regulator-v1_5dreg{
81279377Simp		compatible = "regulator-fixed";
82279377Simp		regulator-name = "V1_5DREG";
83279377Simp		regulator-min-microvolt = <1500000>;
84279377Simp		regulator-max-microvolt = <1500000>;
85279377Simp		regulator-always-on;
86279377Simp		regulator-boot-on;
87279377Simp		vin-supply = <&v24_0d>;
88279377Simp	};
89279377Simp
90279377Simp	v1_5d: fixed-regulator-v1_5d{
91279377Simp		compatible = "regulator-fixed";
92279377Simp		regulator-name = "V1_5D";
93279377Simp		regulator-min-microvolt = <1500000>;
94279377Simp		regulator-max-microvolt = <1500000>;
95279377Simp		regulator-always-on;
96279377Simp		regulator-boot-on;
97279377Simp		vin-supply = <&v1_5dreg>;
98279377Simp	};
99279377Simp
100279377Simp	gpio_keys: gpio_keys {
101279377Simp		compatible = "gpio-keys";
102279377Simp		pinctrl-names = "default";
103279377Simp		pinctrl-0 = <&gpio_keys_pins_default>;
104279377Simp		#address-cells = <1>;
105279377Simp		#size-cells = <0>;
106279377Simp
107279377Simp		switch@0 {
108279377Simp			label = "power-button";
109279377Simp			linux,code = <KEY_POWER>;
110279377Simp			gpios = <&gpio4 2 GPIO_ACTIVE_LOW>;
111279377Simp		};
112279377Simp	};
113295436Sandrew
114295436Sandrew	/* fixed 32k external oscillator clock */
115295436Sandrew	clk_32k_rtc: clk_32k_rtc {
116295436Sandrew		#clock-cells = <0>;
117295436Sandrew		compatible = "fixed-clock";
118295436Sandrew		clock-frequency = <32768>;
119295436Sandrew	};
120279377Simp};
121279377Simp
122279377Simp&am43xx_pinmux {
123279377Simp	gpio_keys_pins_default: gpio_keys_pins_default {
124279377Simp		pinctrl-single,pins = <
125295436Sandrew			AM4372_IOPAD(0x9b8, PIN_INPUT | MUX_MODE7)	/* cam0_field.gpio4_2 */
126279377Simp		>;
127279377Simp	};
128279377Simp
129279377Simp	i2c0_pins_default: i2c0_pins_default {
130279377Simp		pinctrl-single,pins = <
131295436Sandrew			AM4372_IOPAD(0x988, PIN_INPUT | SLEWCTRL_FAST | MUX_MODE0) /* i2c0_sda.i2c0_sda */
132295436Sandrew			AM4372_IOPAD(0x98c, PIN_INPUT | SLEWCTRL_FAST | MUX_MODE0) /* i2c0_scl.i2c0_scl */
133279377Simp		>;
134279377Simp	};
135279377Simp
136279377Simp	i2c0_pins_sleep: i2c0_pins_sleep {
137279377Simp		pinctrl-single,pins = <
138295436Sandrew			AM4372_IOPAD(0x988, PIN_INPUT_PULLDOWN | MUX_MODE7)
139295436Sandrew			AM4372_IOPAD(0x98c, PIN_INPUT_PULLDOWN | MUX_MODE7)
140279377Simp		>;
141279377Simp	};
142279377Simp
143295436Sandrew	i2c2_pins_default: i2c2_pins_default {
144279377Simp		pinctrl-single,pins = <
145295436Sandrew			AM4372_IOPAD(0x9e8, PIN_INPUT | SLEWCTRL_FAST | MUX_MODE3) /* cam1_data1.i2c2_scl */
146295436Sandrew			AM4372_IOPAD(0x9ec, PIN_INPUT | SLEWCTRL_FAST | MUX_MODE3) /* cam1_data0.i2c2_sda */
147279377Simp		>;
148279377Simp	};
149279377Simp
150295436Sandrew	i2c2_pins_sleep: i2c2_pins_sleep {
151279377Simp		pinctrl-single,pins = <
152295436Sandrew			AM4372_IOPAD(0x9e8, PIN_INPUT_PULLDOWN | MUX_MODE7)
153295436Sandrew			AM4372_IOPAD(0x9ec, PIN_INPUT_PULLDOWN | MUX_MODE7)
154279377Simp		>;
155279377Simp	};
156279377Simp
157279377Simp	mmc1_pins_default: pinmux_mmc1_pins_default {
158279377Simp		pinctrl-single,pins = <
159295436Sandrew			AM4372_IOPAD(0x900, PIN_INPUT | MUX_MODE0) /* mmc0_clk.mmc0_clk */
160295436Sandrew			AM4372_IOPAD(0x904, PIN_INPUT | MUX_MODE0) /* mmc0_cmd.mmc0_cmd */
161295436Sandrew			AM4372_IOPAD(0x9f0, PIN_INPUT | MUX_MODE0) /* mmc0_dat3.mmc0_dat3 */
162295436Sandrew			AM4372_IOPAD(0x9f4, PIN_INPUT | MUX_MODE0) /* mmc0_dat2.mmc0_dat2 */
163295436Sandrew			AM4372_IOPAD(0x9f8, PIN_INPUT | MUX_MODE0) /* mmc0_dat1.mmc0_dat1 */
164295436Sandrew			AM4372_IOPAD(0x9fc, PIN_INPUT | MUX_MODE0) /* mmc0_dat0.mmc0_dat0 */
165295436Sandrew			AM4372_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */
166279377Simp		>;
167279377Simp	};
168279377Simp
169279377Simp	mmc1_pins_sleep: pinmux_mmc1_pins_sleep {
170279377Simp		pinctrl-single,pins = <
171295436Sandrew			AM4372_IOPAD(0x900, PIN_INPUT_PULLDOWN | MUX_MODE7)
172295436Sandrew			AM4372_IOPAD(0x904, PIN_INPUT_PULLDOWN | MUX_MODE7)
173295436Sandrew			AM4372_IOPAD(0x9f0, PIN_INPUT_PULLDOWN | MUX_MODE7)
174295436Sandrew			AM4372_IOPAD(0x9f4, PIN_INPUT_PULLDOWN | MUX_MODE7)
175295436Sandrew			AM4372_IOPAD(0x9f8, PIN_INPUT_PULLDOWN | MUX_MODE7)
176295436Sandrew			AM4372_IOPAD(0x9fc, PIN_INPUT_PULLDOWN | MUX_MODE7)
177295436Sandrew			AM4372_IOPAD(0x960, PIN_INPUT_PULLDOWN | MUX_MODE7)
178279377Simp		>;
179279377Simp	};
180279377Simp
181279377Simp	ecap0_pins_default: backlight_pins_default {
182279377Simp		pinctrl-single,pins = <
183295436Sandrew			AM4372_IOPAD(0x964, PIN_OUTPUT | MUX_MODE0) /* ecap0_in_pwm0_out.ecap0_in_pwm0_out */
184279377Simp		>;
185279377Simp	};
186279377Simp
187279377Simp	cpsw_default: cpsw_default {
188279377Simp		pinctrl-single,pins = <
189295436Sandrew			AM4372_IOPAD(0x92c, PIN_OUTPUT_PULLDOWN | MUX_MODE2)	/* mii1_txclk.rgmii1_tclk */
190295436Sandrew			AM4372_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE2)	/* mii1_txen.rgmii1_tctl */
191295436Sandrew			AM4372_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE2)	/* mii1_txd0.rgmii1_td0 */
192295436Sandrew			AM4372_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE2)	/* mii1_txd1.rgmii1_td1 */
193295436Sandrew			AM4372_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE2)	/* mii1_txd0.rgmii1_td2 */
194295436Sandrew			AM4372_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE2)	/* mii1_txd1.rgmii1_td3 */
195295436Sandrew			AM4372_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE2)	/* mii1_rxclk.rmii1_rclk */
196295436Sandrew			AM4372_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE2)	/* mii1_rxdv.rgmii1_rctl */
197295436Sandrew			AM4372_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE2)	/* mii1_rxd0.rgmii1_rd0 */
198295436Sandrew			AM4372_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE2)	/* mii1_rxd1.rgmii1_rd1 */
199295436Sandrew			AM4372_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE2)	/* mii1_rxd0.rgmii1_rd2 */
200295436Sandrew			AM4372_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE2)	/* mii1_rxd1.rgmii1_rd3 */
201279377Simp		>;
202279377Simp	};
203279377Simp
204279377Simp	cpsw_sleep: cpsw_sleep {
205279377Simp		pinctrl-single,pins = <
206295436Sandrew			AM4372_IOPAD(0x92c, PIN_INPUT_PULLDOWN | MUX_MODE7)
207295436Sandrew			AM4372_IOPAD(0x914, PIN_INPUT_PULLDOWN | MUX_MODE7)
208295436Sandrew			AM4372_IOPAD(0x928, PIN_INPUT_PULLDOWN | MUX_MODE7)
209295436Sandrew			AM4372_IOPAD(0x924, PIN_INPUT_PULLDOWN | MUX_MODE7)
210295436Sandrew			AM4372_IOPAD(0x920, PIN_INPUT_PULLDOWN | MUX_MODE7)
211295436Sandrew			AM4372_IOPAD(0x91c, PIN_INPUT_PULLDOWN | MUX_MODE7)
212295436Sandrew			AM4372_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE7)
213295436Sandrew			AM4372_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE7)
214295436Sandrew			AM4372_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE7)
215295436Sandrew			AM4372_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE7)
216295436Sandrew			AM4372_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE7)
217295436Sandrew			AM4372_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE7)
218279377Simp		>;
219279377Simp	};
220279377Simp
221279377Simp	davinci_mdio_default: davinci_mdio_default {
222279377Simp		pinctrl-single,pins = <
223279377Simp			/* MDIO */
224295436Sandrew			AM4372_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)	/* mdio_data.mdio_data */
225295436Sandrew			AM4372_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0)			/* mdio_clk.mdio_clk */
226279377Simp		>;
227279377Simp	};
228279377Simp
229279377Simp	davinci_mdio_sleep: davinci_mdio_sleep {
230279377Simp		pinctrl-single,pins = <
231279377Simp			/* MDIO reset value */
232295436Sandrew			AM4372_IOPAD(0x948, PIN_INPUT_PULLDOWN | MUX_MODE7)
233295436Sandrew			AM4372_IOPAD(0x94c, PIN_INPUT_PULLDOWN | MUX_MODE7)
234279377Simp		>;
235279377Simp	};
236279377Simp
237279377Simp	qspi_pins_default: qspi_pins_default {
238279377Simp		pinctrl-single,pins = <
239295436Sandrew			AM4372_IOPAD(0x87c, PIN_OUTPUT_PULLUP | MUX_MODE3)	/* gpmc_csn0.qspi_csn */
240295436Sandrew			AM4372_IOPAD(0x888, PIN_OUTPUT | MUX_MODE2)		/* gpmc_csn3.qspi_clk */
241295436Sandrew			AM4372_IOPAD(0x890, PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_advn_ale.qspi_d0 */
242295436Sandrew			AM4372_IOPAD(0x894, PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_oen_ren.qspi_d1 */
243295436Sandrew			AM4372_IOPAD(0x898, PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_wen.qspi_d2 */
244295436Sandrew			AM4372_IOPAD(0x89c, PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_be0n_cle.qspi_d3 */
245279377Simp		>;
246279377Simp	};
247279377Simp
248279377Simp	qspi_pins_sleep: qspi_pins_sleep{
249279377Simp		pinctrl-single,pins = <
250295436Sandrew			AM4372_IOPAD(0x87c, PIN_INPUT_PULLDOWN | MUX_MODE7)
251295436Sandrew			AM4372_IOPAD(0x888, PIN_INPUT_PULLDOWN | MUX_MODE7)
252295436Sandrew			AM4372_IOPAD(0x890, PIN_INPUT_PULLDOWN | MUX_MODE7)
253295436Sandrew			AM4372_IOPAD(0x894, PIN_INPUT_PULLDOWN | MUX_MODE7)
254295436Sandrew			AM4372_IOPAD(0x898, PIN_INPUT_PULLDOWN | MUX_MODE7)
255295436Sandrew			AM4372_IOPAD(0x89c, PIN_INPUT_PULLDOWN | MUX_MODE7)
256279377Simp		>;
257279377Simp	};
258279377Simp};
259279377Simp
260279377Simp&i2c0 {
261279377Simp	status = "okay";
262279377Simp	pinctrl-names = "default", "sleep";
263279377Simp	pinctrl-0 = <&i2c0_pins_default>;
264295436Sandrew	pinctrl-1 = <&i2c0_pins_sleep>;
265279377Simp	clock-frequency = <400000>;
266279377Simp
267279377Simp	at24@50 {
268279377Simp		compatible = "at24,24c256";
269279377Simp		pagesize = <64>;
270279377Simp		reg = <0x50>;
271279377Simp	};
272279377Simp
273279377Simp	tps: tps62362@60 {
274279377Simp		compatible = "ti,tps62362";
275295436Sandrew		reg = <0x60>;
276279377Simp		regulator-name = "VDD_MPU";
277279377Simp		regulator-min-microvolt = <950000>;
278279377Simp		regulator-max-microvolt = <1330000>;
279279377Simp		regulator-boot-on;
280279377Simp		regulator-always-on;
281279377Simp		ti,vsel0-state-high;
282279377Simp		ti,vsel1-state-high;
283279377Simp		vin-supply = <&v3_3d>;
284279377Simp	};
285279377Simp};
286279377Simp
287295436Sandrew&i2c2 {
288295436Sandrew	status = "okay";
289295436Sandrew	pinctrl-names = "default", "sleep";
290295436Sandrew	pinctrl-0 = <&i2c2_pins_default>;
291295436Sandrew	pinctrl-1 = <&i2c2_pins_sleep>;
292295436Sandrew	clock-frequency = <100000>;
293295436Sandrew};
294295436Sandrew
295279377Simp&epwmss0 {
296279377Simp	status = "okay";
297279377Simp};
298279377Simp
299279377Simp&ecap0 {
300279377Simp	status = "okay";
301279377Simp	pinctrl-names = "default";
302279377Simp	pinctrl-0 = <&ecap0_pins_default>;
303279377Simp};
304279377Simp
305279377Simp&gpio0 {
306279377Simp	status = "okay";
307279377Simp};
308279377Simp
309279377Simp&gpio1 {
310279377Simp	status = "okay";
311279377Simp};
312279377Simp
313279377Simp&gpio4 {
314279377Simp	status = "okay";
315279377Simp};
316279377Simp
317279377Simp&gpio5 {
318279377Simp	status = "okay";
319279377Simp};
320279377Simp
321279377Simp&mmc1 {
322279377Simp	status = "okay";
323279377Simp	pinctrl-names = "default", "sleep";
324279377Simp	pinctrl-0 = <&mmc1_pins_default>;
325279377Simp	pinctrl-1 = <&mmc1_pins_sleep>;
326279377Simp	vmmc-supply = <&v3_3d>;
327279377Simp	bus-width = <4>;
328295436Sandrew	cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
329279377Simp};
330279377Simp
331279377Simp&qspi {
332279377Simp	status = "okay";
333279377Simp	pinctrl-names = "default", "sleep";
334279377Simp	pinctrl-0 = <&qspi_pins_default>;
335279377Simp	pinctrl-1 = <&qspi_pins_sleep>;
336279377Simp
337279377Simp	spi-max-frequency = <48000000>;
338279377Simp	m25p80@0 {
339279377Simp		compatible = "mx66l51235l";
340279377Simp		spi-max-frequency = <48000000>;
341279377Simp		reg = <0>;
342279377Simp		spi-cpol;
343279377Simp		spi-cpha;
344279377Simp		spi-tx-bus-width = <1>;
345279377Simp		spi-rx-bus-width = <4>;
346279377Simp		#address-cells = <1>;
347279377Simp		#size-cells = <1>;
348279377Simp
349279377Simp		/*
350279377Simp		 * MTD partition table.  The ROM checks the first 512KiB for a
351279377Simp		 * valid file to boot(XIP).
352279377Simp		 */
353279377Simp		partition@0 {
354279377Simp			label = "QSPI.U_BOOT";
355279377Simp			reg = <0x00000000 0x000080000>;
356279377Simp		};
357279377Simp		partition@1 {
358279377Simp			label = "QSPI.U_BOOT.backup";
359279377Simp			reg = <0x00080000 0x00080000>;
360279377Simp		};
361279377Simp		partition@2 {
362279377Simp			label = "QSPI.U-BOOT-SPL_OS";
363279377Simp			reg = <0x00100000 0x00010000>;
364279377Simp		};
365279377Simp		partition@3 {
366279377Simp			label = "QSPI.U_BOOT_ENV";
367279377Simp			reg = <0x00110000 0x00010000>;
368279377Simp		};
369279377Simp		partition@4 {
370279377Simp			label = "QSPI.U-BOOT-ENV.backup";
371279377Simp			reg = <0x00120000 0x00010000>;
372279377Simp		};
373279377Simp		partition@5 {
374279377Simp			label = "QSPI.KERNEL";
375279377Simp			reg = <0x00130000 0x0800000>;
376279377Simp		};
377279377Simp		partition@6 {
378279377Simp			label = "QSPI.FILESYSTEM";
379279377Simp			reg = <0x00930000 0x36D0000>;
380279377Simp		};
381279377Simp	};
382279377Simp};
383279377Simp
384279377Simp&mac {
385279377Simp	pinctrl-names = "default", "sleep";
386279377Simp	pinctrl-0 = <&cpsw_default>;
387279377Simp	pinctrl-1 = <&cpsw_sleep>;
388279377Simp	status = "okay";
389279377Simp};
390279377Simp
391279377Simp&davinci_mdio {
392279377Simp	pinctrl-names = "default", "sleep";
393279377Simp	pinctrl-0 = <&davinci_mdio_default>;
394279377Simp	pinctrl-1 = <&davinci_mdio_sleep>;
395279377Simp	status = "okay";
396279377Simp};
397279377Simp
398279377Simp&cpsw_emac0 {
399279377Simp	phy_id = <&davinci_mdio>, <0>;
400279377Simp	phy-mode = "rgmii";
401279377Simp};
402279377Simp
403279377Simp&rtc {
404295436Sandrew	clocks = <&clk_32k_rtc>, <&clk_32768_ck>;
405295436Sandrew	clock-names = "ext-clk", "int-clk";
406279377Simp	status = "okay";
407279377Simp};
408279377Simp
409279377Simp&wdt {
410279377Simp	status = "okay";
411279377Simp};
412279377Simp
413279377Simp&cpu {
414279377Simp	cpu0-supply = <&tps>;
415279377Simp};
416