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