1/*
2 * am335x-cm-t335.dts - Device Tree file for Compulab CM-T335
3 *
4 * Copyright (C) 2014 - 2015 CompuLab Ltd. - http://www.compulab.co.il/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11/dts-v1/;
12
13#include "am33xx.dtsi"
14
15/ {
16	model = "CompuLab CM-T335";
17	compatible = "compulab,cm-t335", "ti,am33xx";
18
19	memory {
20		device_type = "memory";
21		reg = <0x80000000 0x8000000>;	/* 128 MB */
22	};
23
24	leds {
25		compatible = "gpio-leds";
26		pinctrl-names = "default";
27		pinctrl-0 = <&gpio_led_pins>;
28		led@0 {
29			label = "cm_t335:green";
30			gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;	/* gpio2_0 */
31			linux,default-trigger = "heartbeat";
32		};
33	};
34
35	/* regulator for mmc */
36	vmmc_fixed: fixedregulator@0 {
37		compatible = "regulator-fixed";
38		regulator-name = "vmmc_fixed";
39		regulator-min-microvolt = <3300000>;
40		regulator-max-microvolt = <3300000>;
41	};
42
43	backlight {
44		compatible = "pwm-backlight";
45		pwms = <&ecap0 0 50000 0>;
46		brightness-levels = <0 51 53 56 62 75 101 152 255>;
47		default-brightness-level = <8>;
48	};
49};
50
51&am33xx_pinmux {
52	pinctrl-names = "default";
53	pinctrl-0 = <&bluetooth_pins>;
54
55	i2c0_pins: pinmux_i2c0_pins {
56		pinctrl-single,pins = <
57			/* i2c0_sda.i2c0_sda */
58			AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0)
59			/* i2c0_scl.i2c0_scl */
60			AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0)
61		>;
62	};
63
64	i2c1_pins: pinmux_i2c1_pins {
65		pinctrl-single,pins = <
66			/* uart0_ctsn.i2c1_sda */
67			AM33XX_IOPAD(0x968, PIN_INPUT_PULLUP | MUX_MODE2)
68			/* uart0_rtsn.i2c1_scl */
69			AM33XX_IOPAD(0x96c, PIN_INPUT_PULLUP | MUX_MODE2)
70		>;
71	};
72
73	gpio_led_pins: pinmux_gpio_led_pins {
74		pinctrl-single,pins = <
75			/* gpmc_csn3.gpio2_0 */
76			AM33XX_IOPAD(0x888, PIN_OUTPUT | MUX_MODE7)
77		>;
78	};
79
80	nandflash_pins: pinmux_nandflash_pins {
81		pinctrl-single,pins = <
82			/* gpmc_ad0.gpmc_ad0 */
83			AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE0)
84			/* gpmc_ad1.gpmc_ad1 */
85			AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE0)
86			/* gpmc_ad2.gpmc_ad2 */
87			AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE0)
88			/* gpmc_ad3.gpmc_ad3 */
89			AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE0)
90			/* gpmc_ad4.gpmc_ad4 */
91			AM33XX_IOPAD(0x810, PIN_INPUT_PULLUP | MUX_MODE0)
92			/* gpmc_ad5.gpmc_ad5 */
93			AM33XX_IOPAD(0x814, PIN_INPUT_PULLUP | MUX_MODE0)
94			/* gpmc_ad6.gpmc_ad6 */
95			AM33XX_IOPAD(0x818, PIN_INPUT_PULLUP | MUX_MODE0)
96			/* gpmc_ad7.gpmc_ad7 */
97			AM33XX_IOPAD(0x81c, PIN_INPUT_PULLUP | MUX_MODE0)
98			/* gpmc_wait0.gpmc_wait0 */
99			AM33XX_IOPAD(0x870, PIN_INPUT_PULLUP | MUX_MODE0)
100			/* gpmc_wpn.gpio0_30 */
101			AM33XX_IOPAD(0x874, PIN_INPUT_PULLUP | MUX_MODE7)
102			/* gpmc_csn0.gpmc_csn0  */
103			AM33XX_IOPAD(0x87c, PIN_OUTPUT | MUX_MODE0)
104			/* gpmc_advn_ale.gpmc_advn_ale */
105			AM33XX_IOPAD(0x890, PIN_OUTPUT | MUX_MODE0)
106			/* gpmc_oen_ren.gpmc_oen_ren */
107			AM33XX_IOPAD(0x894, PIN_OUTPUT | MUX_MODE0)
108			/* gpmc_wen.gpmc_wen */
109			AM33XX_IOPAD(0x898, PIN_OUTPUT | MUX_MODE0)
110			/* gpmc_ben0_cle.gpmc_ben0_cle */
111			AM33XX_IOPAD(0x89c, PIN_OUTPUT | MUX_MODE0)
112		>;
113	};
114
115	uart0_pins: pinmux_uart0_pins {
116		pinctrl-single,pins = <
117			/* uart0_rxd.uart0_rxd */
118			AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0)
119			/* uart0_txd.uart0_txd */
120			AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0)
121		>;
122	};
123
124	uart1_pins: pinmux_uart1_pins {
125		pinctrl-single,pins = <
126			/* uart1_ctsn.uart1_ctsn */
127			AM33XX_IOPAD(0x978, PIN_INPUT | MUX_MODE0)
128			/* uart1_rtsn.uart1_rtsn */
129			AM33XX_IOPAD(0x97C, PIN_OUTPUT_PULLDOWN | MUX_MODE0)
130			/* uart1_rxd.uart1_rxd */
131			AM33XX_IOPAD(0x980, PIN_INPUT_PULLUP | MUX_MODE0)
132			/* uart1_txd.uart1_txd */
133			AM33XX_IOPAD(0x984, PIN_OUTPUT_PULLDOWN | MUX_MODE0)
134		>;
135	};
136
137	ecap0_pins: pinmux_ecap0_pins {
138		pinctrl-single,pins = <
139			/* eCAP0_in_PWM0_out.eCAP0_in_PWM0_out MODE0 */
140			AM33XX_IOPAD(0x964, 0x0)
141		>;
142	};
143
144	cpsw_default: cpsw_default {
145		pinctrl-single,pins = <
146			/* Slave 1 */
147			/* mii1_tx_en.rgmii1_tctl */
148			AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
149			/* mii1_rxdv.rgmii1_rctl */
150			AM33XX_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE2)
151			/* mii1_txd3.rgmii1_td3 */
152			AM33XX_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
153			/* mii1_txd2.rgmii1_td2 */
154			AM33XX_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
155			/* mii1_txd1.rgmii1_td1 */
156			AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
157			/* mii1_txd0.rgmii1_td0 */
158			AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
159			/* mii1_txclk.rgmii1_tclk */
160			AM33XX_IOPAD(0x92c, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
161			/* mii1_rxclk.rgmii1_rclk */
162			AM33XX_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE2)
163			/* mii1_rxd3.rgmii1_rd3 */
164			AM33XX_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE2)
165			/* mii1_rxd2.rgmii1_rd2 */
166			AM33XX_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE2)
167			/* mii1_rxd1.rgmii1_rd1 */
168			AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE2)
169			/* mii1_rxd0.rgmii1_rd0 */
170			AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE2)
171		>;
172	};
173
174	cpsw_sleep: cpsw_sleep {
175		pinctrl-single,pins = <
176			/* Slave 1 reset value */
177			AM33XX_IOPAD(0x914, PIN_INPUT_PULLDOWN | MUX_MODE7)
178			AM33XX_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE7)
179			AM33XX_IOPAD(0x91c, PIN_INPUT_PULLDOWN | MUX_MODE7)
180			AM33XX_IOPAD(0x920, PIN_INPUT_PULLDOWN | MUX_MODE7)
181			AM33XX_IOPAD(0x924, PIN_INPUT_PULLDOWN | MUX_MODE7)
182			AM33XX_IOPAD(0x928, PIN_INPUT_PULLDOWN | MUX_MODE7)
183			AM33XX_IOPAD(0x92c, PIN_INPUT_PULLDOWN | MUX_MODE7)
184			AM33XX_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE7)
185			AM33XX_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE7)
186			AM33XX_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE7)
187			AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE7)
188			AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE7)
189		>;
190	};
191
192	davinci_mdio_default: davinci_mdio_default {
193		pinctrl-single,pins = <
194			/* mdio_data.mdio_data */
195			AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)
196			/* mdio_clk.mdio_clk */
197			AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0)
198		>;
199	};
200
201	davinci_mdio_sleep: davinci_mdio_sleep {
202		pinctrl-single,pins = <
203			/* MDIO reset value */
204			AM33XX_IOPAD(0x948, PIN_INPUT_PULLDOWN | MUX_MODE7)
205			AM33XX_IOPAD(0x94c, PIN_INPUT_PULLDOWN | MUX_MODE7)
206		>;
207	};
208
209	mmc1_pins: pinmux_mmc1_pins {
210		pinctrl-single,pins = <
211			/* mmc0_dat3.mmc0_dat3 */
212			AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0)
213			/* mmc0_dat2.mmc0_dat2 */
214			AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0)
215			/* mmc0_dat1.mmc0_dat1 */
216			AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0)
217			/* mmc0_dat0.mmc0_dat0 */
218			AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0)
219			/* mmc0_clk.mmc0_clk */
220			AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0)
221			/* mmc0_cmd.mmc0_cmd */
222			AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0)
223		>;
224	};
225
226	/* wl1271 bluetooth */
227	bluetooth_pins: pinmux_bluetooth_pins {
228		pinctrl-single,pins = <
229			/* XDMA_EVENT_INTR0.gpio0_19 - bluetooth enable */
230			AM33XX_IOPAD(0x9b0, PIN_OUTPUT_PULLUP | MUX_MODE7)
231		>;
232	};
233};
234
235&uart0 {
236	pinctrl-names = "default";
237	pinctrl-0 = <&uart0_pins>;
238
239	status = "okay";
240};
241
242/* WLS1271 bluetooth */
243&uart1 {
244	pinctrl-names = "default";
245	pinctrl-0 = <&uart1_pins>;
246
247status = "okay";
248};
249
250&i2c0 {
251	pinctrl-names = "default";
252	pinctrl-0 = <&i2c0_pins>;
253
254	status = "okay";
255	clock-frequency = <400000>;
256	/* CM-T335 board EEPROM */
257	eeprom: 24c02@50 {
258		compatible = "atmel,24c02";
259		reg = <0x50>;
260		pagesize = <16>;
261	};
262	/* Real Time Clock */
263	ext_rtc: em3027@56 {
264		compatible = "emmicro,em3027";
265		reg = <0x56>;
266	};
267};
268
269&usb {
270	status = "okay";
271};
272
273&usb_ctrl_mod {
274	status = "okay";
275};
276
277&usb0_phy {
278	status = "okay";
279};
280
281&usb0 {
282	status = "okay";
283};
284
285&cppi41dma  {
286	status = "okay";
287};
288
289&epwmss0 {
290	status = "okay";
291
292	ecap0: ecap@48300100 {
293		status = "okay";
294		pinctrl-names = "default";
295		pinctrl-0 = <&ecap0_pins>;
296	};
297};
298
299&gpmc {
300	status = "okay";
301	pinctrl-names = "default";
302	pinctrl-0 = <&nandflash_pins>;
303	ranges = <0 0 0x08000000 0x10000000>;	/* CS0: NAND */
304	nand@0,0 {
305		reg = <0 0 0>; /* CS0, offset 0 */
306		ti,nand-ecc-opt = "bch8";
307		ti,elm-id = <&elm>;
308		nand-bus-width = <8>;
309		gpmc,device-width = <1>;
310		gpmc,sync-clk-ps = <0>;
311		gpmc,cs-on-ns = <0>;
312		gpmc,cs-rd-off-ns = <44>;
313		gpmc,cs-wr-off-ns = <44>;
314		gpmc,adv-on-ns = <6>;
315		gpmc,adv-rd-off-ns = <34>;
316		gpmc,adv-wr-off-ns = <44>;
317		gpmc,we-on-ns = <0>;
318		gpmc,we-off-ns = <40>;
319		gpmc,oe-on-ns = <0>;
320		gpmc,oe-off-ns = <54>;
321		gpmc,access-ns = <64>;
322		gpmc,rd-cycle-ns = <82>;
323		gpmc,wr-cycle-ns = <82>;
324		gpmc,wait-on-read = "true";
325		gpmc,wait-on-write = "true";
326		gpmc,bus-turnaround-ns = <0>;
327		gpmc,cycle2cycle-delay-ns = <0>;
328		gpmc,clk-activation-ns = <0>;
329		gpmc,wait-monitoring-ns = <0>;
330		gpmc,wr-access-ns = <40>;
331		gpmc,wr-data-mux-bus-ns = <0>;
332		/* MTD partition table */
333		#address-cells = <1>;
334		#size-cells = <1>;
335		partition@0 {
336			label = "spl";
337			reg = <0x00000000 0x00200000>;
338		};
339		partition@1 {
340			label = "uboot";
341			reg = <0x00200000 0x00100000>;
342		};
343		partition@2 {
344			label = "uboot environment";
345			reg = <0x00300000 0x00100000>;
346		};
347		partition@3 {
348			label = "dtb";
349			reg = <0x00400000 0x00100000>;
350		};
351		partition@4 {
352			label = "splash";
353			reg = <0x00500000 0x00400000>;
354		};
355		partition@5 {
356			label = "linux";
357			reg = <0x00900000 0x00600000>;
358		};
359		partition@6 {
360			label = "rootfs";
361			reg = <0x00F00000 0>;
362		};
363	};
364};
365
366&elm {
367	status = "okay";
368};
369
370&mac {
371	pinctrl-names = "default", "sleep";
372	pinctrl-0 = <&cpsw_default>;
373	pinctrl-1 = <&cpsw_sleep>;
374	slaves = <1>;
375	status = "okay";
376};
377
378&davinci_mdio {
379	pinctrl-names = "default", "sleep";
380	pinctrl-0 = <&davinci_mdio_default>;
381	pinctrl-1 = <&davinci_mdio_sleep>;
382	status = "okay";
383};
384
385&cpsw_emac0 {
386	phy_id = <&davinci_mdio>, <0>;
387	phy-mode = "rgmii-txid";
388};
389
390&mmc1 {
391	status = "okay";
392	vmmc-supply = <&vmmc_fixed>;
393	bus-width = <4>;
394	pinctrl-names = "default";
395	pinctrl-0 = <&mmc1_pins>;
396};
397