4aa5357b3a8437f07653edda9f565af4c9603c6a
[cascardo/linux.git] / arch / arm / boot / dts / am437x-cm-t43.dts
1 /*
2  * Copyright (C) 2015 CompuLab, Ltd. - http://www.compulab.co.il/
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  */
8
9 /dts-v1/;
10
11 #include <dt-bindings/pinctrl/am43xx.h>
12 #include <dt-bindings/gpio/gpio.h>
13 #include <dt-bindings/interrupt-controller/irq.h>
14 #include "am4372.dtsi"
15
16 / {
17         model = "CompuLab CM-T43";
18         compatible = "compulab,am437x-cm-t43", "ti,am4372", "ti,am43";
19
20         leds {
21                 compatible = "gpio-leds";
22
23                 ledb {
24                         label = "cm-t43:green";
25                         gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>;
26                         linux,default-trigger = "heartbeat";
27                 };
28         };
29
30         vmmc_3v3: fixedregulator-v3_3 {
31                 compatible = "regulator-fixed";
32                 regulator-name = "vmmc_3v3";
33                 regulator-min-microvolt = <3300000>;
34                 regulator-max-microvolt = <3300000>;
35                 regulator-always-on;
36                 enable-active-high;
37         };
38 };
39
40 &am43xx_pinmux {
41         pinctrl-names = "default";
42         pinctrl-0 = <&cm_t43_led_pins>;
43
44         cm_t43_led_pins: cm_t43_led_pins {
45                 pinctrl-single,pins = <
46                         AM4372_IOPAD(0xa78, MUX_MODE7)
47                 >;
48         };
49
50         i2c0_pins: i2c0_pins {
51                 pinctrl-single,pins = <
52                         AM4372_IOPAD(0x988, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)  /* i2c0_sda.i2c0_sda */
53                         AM4372_IOPAD(0x98c, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)  /* i2c0_scl.i2c0_scl */
54                 >;
55         };
56
57         emmc_pins: emmc_pins {
58                 pinctrl-single,pins = <
59                         AM4372_IOPAD(0x820, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad8.mmc1_dat0 */
60                         AM4372_IOPAD(0x824, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad9.mmc1_dat1 */
61                         AM4372_IOPAD(0x828, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad10.mmc1_dat2 */
62                         AM4372_IOPAD(0x82c, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad11.mmc1_dat3 */
63                         AM4372_IOPAD(0x830, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad12.mmc1_dat4 */
64                         AM4372_IOPAD(0x834, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad13.mmc1_dat5 */
65                         AM4372_IOPAD(0x838, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad14.mmc1_dat6 */
66                         AM4372_IOPAD(0x83c, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad15.mmc1_dat7 */
67                         AM4372_IOPAD(0x880, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */
68                         AM4372_IOPAD(0x884, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */
69                 >;
70         };
71
72         spi0_pins: pinmux_spi0_pins {
73                 pinctrl-single,pins = <
74                         AM4372_IOPAD(0x950, PIN_INPUT | MUX_MODE0) /* spi0_sclk.spi0_sclk */
75                         AM4372_IOPAD(0x954, PIN_INPUT | MUX_MODE0) /* spi0_d0.spi0_d0 */
76                         AM4372_IOPAD(0x958, PIN_OUTPUT | MUX_MODE0) /* spi0_d1.spi0_d1 */
77                         AM4372_IOPAD(0x95C, PIN_OUTPUT | MUX_MODE0) /* spi0_cs0.spi0_cs0 */
78                 >;
79         };
80
81         nand_flash_x8: nand_flash_x8 {
82                 pinctrl-single,pins = <
83                         AM4372_IOPAD(0x800, PIN_INPUT | PULL_DISABLE | MUX_MODE0)
84                         AM4372_IOPAD(0x804, PIN_INPUT | PULL_DISABLE | MUX_MODE0)
85                         AM4372_IOPAD(0x808, PIN_INPUT | PULL_DISABLE | MUX_MODE0)
86                         AM4372_IOPAD(0x80c, PIN_INPUT | PULL_DISABLE | MUX_MODE0)
87                         AM4372_IOPAD(0x810, PIN_INPUT | PULL_DISABLE | MUX_MODE0)
88                         AM4372_IOPAD(0x814, PIN_INPUT | PULL_DISABLE | MUX_MODE0)
89                         AM4372_IOPAD(0x818, PIN_INPUT | PULL_DISABLE | MUX_MODE0)
90                         AM4372_IOPAD(0x81c, PIN_INPUT | PULL_DISABLE | MUX_MODE0)
91                         AM4372_IOPAD(0x870, PIN_INPUT_PULLUP  | MUX_MODE0)
92                         AM4372_IOPAD(0x874, PIN_OUTPUT_PULLUP | MUX_MODE0)
93                         AM4372_IOPAD(0x87c, PIN_OUTPUT_PULLUP | MUX_MODE0)
94                         AM4372_IOPAD(0x898, PIN_OUTPUT_PULLDOWN | MUX_MODE0)
95                         AM4372_IOPAD(0x894, PIN_OUTPUT_PULLDOWN | MUX_MODE0)
96                         AM4372_IOPAD(0x890, PIN_OUTPUT_PULLDOWN | MUX_MODE0)
97                         AM4372_IOPAD(0x89c, PIN_OUTPUT_PULLDOWN | MUX_MODE0)
98                 >;
99         };
100
101         cpsw_default: cpsw_default {
102                 pinctrl-single,pins = <
103                         /* Slave 1 */
104                         AM4372_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txen.rgmii1_txen */
105                         AM4372_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxdv.rgmii1_rxctl */
106                         AM4372_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txd1.rgmii1_txd3 */
107                         AM4372_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txd0.rgmii1_txd2 */
108                         AM4372_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txd1.rgmii1_txd1 */
109                         AM4372_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txd0.rgmii1_txd0 */
110                         AM4372_IOPAD(0x92c, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txclk.rmii1_tclk */
111                         AM4372_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxclk.rmii1_rclk */
112                         AM4372_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxd1.rgmii1_rxd3 */
113                         AM4372_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxd0.rgmii1_rxd2 */
114                         AM4372_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxd1.rgmii1_rxd1 */
115                         AM4372_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxd0.rgmii1_rxd0 */
116                         AM4372_IOPAD(0xa74, MUX_MODE3)
117                         /* Slave 2 */
118                         AM4372_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* gpmc_a0.txen */
119                         AM4372_IOPAD(0x844, PIN_INPUT_PULLDOWN  | MUX_MODE2)    /* gpmc_a1.rxctl */
120                         AM4372_IOPAD(0x848, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* gpmc_a2.txd3 */
121                         AM4372_IOPAD(0x84c, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* gpmc_a3.txd2 */
122                         AM4372_IOPAD(0x850, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* gpmc_a4.txd1 */
123                         AM4372_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* gpmc_a5.txd0 */
124                         AM4372_IOPAD(0x858, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* gpmc_a6.tclk */
125                         AM4372_IOPAD(0x85c, PIN_INPUT_PULLDOWN  | MUX_MODE2)    /* gpmc_a7.rclk */
126                         AM4372_IOPAD(0x860, PIN_INPUT_PULLDOWN  | MUX_MODE2)    /* gpmc_a8.rxd3 */
127                         AM4372_IOPAD(0x864, PIN_INPUT_PULLDOWN  | MUX_MODE2)    /* gpmc_a9.rxd2 */
128                         AM4372_IOPAD(0x868, PIN_INPUT_PULLDOWN  | MUX_MODE2)    /* gpmc_a10.rxd1 */
129                         AM4372_IOPAD(0x86c, PIN_INPUT_PULLDOWN  | MUX_MODE2)    /* gpmc_a11.rxd0 */
130                         AM4372_IOPAD(0xa38, MUX_MODE7)
131                 >;
132         };
133
134         davinci_mdio_default: davinci_mdio_default {
135                 pinctrl-single,pins = <
136                         /* MDIO */
137                         AM4372_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)       /* mdio_data.mdio_data */
138                         AM4372_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0)                      /* mdio_clk.mdio_clk */
139                 >;
140         };
141 };
142
143 &gpmc {
144         status = "okay";
145         pinctrl-names = "default";
146         pinctrl-0 = <&nand_flash_x8>;
147         ranges = <0 0 0x08000000 0x1000000>;
148         nand@0,0 {
149                 compatible = "ti,omap2-nand";
150                 reg = <0 0 4>;          /* CS0, offset 0, IO size 4 */
151                 interrupt-parent = <&gpmc>;
152                 interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
153                              <1 IRQ_TYPE_NONE>; /* termcount */
154                 ti,nand-ecc-opt = "bch8";
155                 ti,elm-id = <&elm>;
156
157                 nand-bus-width = <8>;
158                 gpmc,device-width = <1>;
159                 gpmc,sync-clk-ps = <0>;
160                 gpmc,cs-on-ns = <0>;
161                 gpmc,cs-rd-off-ns = <44>;
162                 gpmc,cs-wr-off-ns = <44>;
163                 gpmc,adv-on-ns = <6>;
164                 gpmc,adv-rd-off-ns = <34>;
165                 gpmc,adv-wr-off-ns = <44>;
166                 gpmc,we-on-ns = <0>;
167                 gpmc,we-off-ns = <40>;
168                 gpmc,oe-on-ns = <0>;
169                 gpmc,oe-off-ns = <54>;
170                 gpmc,access-ns = <64>;
171                 gpmc,rd-cycle-ns = <82>;
172                 gpmc,wr-cycle-ns = <82>;
173                 gpmc,wait-on-read = "true";
174                 gpmc,wait-on-write = "true";
175                 gpmc,bus-turnaround-ns = <0>;
176                 gpmc,cycle2cycle-delay-ns = <0>;
177                 gpmc,clk-activation-ns = <0>;
178                 gpmc,wait-monitoring-ns = <0>;
179                 gpmc,wr-access-ns = <40>;
180                 gpmc,wr-data-mux-bus-ns = <0>;
181
182                 gpmc,wait-pin = <0>;
183
184                 #address-cells = <1>;
185                 #size-cells = <1>;
186                 /* MTD partition table */
187                 partition@0 {
188                         label = "kernel";
189                         reg = <0x0 0x00980000>;
190                 };
191                 partition@980000 {
192                         label = "dtb";
193                         reg = <0x00980000 0x00080000>;
194                 };
195                 partition@a00000 {
196                         label = "rootfs";
197                         reg = <0x00a00000 0x0>;
198                 };
199         };
200 };
201
202 &i2c0 {
203         status = "okay";
204         pinctrl-names = "default";
205         pinctrl-0 = <&i2c0_pins>;
206         clock-frequency = <100000>;
207
208         tps65218: tps65218@24 {
209                 compatible = "ti,tps65218";
210                 reg = <0x24>;
211                 interrupts = <GIC_SPI 7 IRQ_TYPE_NONE>; /* NMIn */
212                 interrupt-parent = <&gic>;
213                 interrupt-controller;
214                 #interrupt-cells = <2>;
215
216                 dcdc1: regulator-dcdc1 {
217                         compatible = "ti,tps65218-dcdc1";
218                         regulator-name = "vdd_core";
219                         regulator-min-microvolt = <912000>;
220                         regulator-max-microvolt = <1144000>;
221                         regulator-boot-on;
222                         regulator-always-on;
223                 };
224
225                 dcdc2: regulator-dcdc2 {
226                         compatible = "ti,tps65218-dcdc2";
227                         regulator-name = "vdd_mpu";
228                         regulator-min-microvolt = <912000>;
229                         regulator-max-microvolt = <1378000>;
230                         regulator-boot-on;
231                         regulator-always-on;
232                 };
233
234                 dcdc3: regulator-dcdc3 {
235                         compatible = "ti,tps65218-dcdc3";
236                         regulator-name = "vdcdc3";
237                         regulator-suspend-enable;
238                         regulator-min-microvolt = <1500000>;
239                         regulator-max-microvolt = <1500000>;
240                         regulator-boot-on;
241                         regulator-always-on;
242                 };
243
244                 dcdc5: regulator-dcdc5 {
245                         compatible = "ti,tps65218-dcdc5";
246                         regulator-name = "v1_0bat";
247                         regulator-min-microvolt = <1000000>;
248                         regulator-max-microvolt = <1000000>;
249                         regulator-boot-on;
250                         regulator-always-on;
251                 };
252
253                 dcdc6: regulator-dcdc6 {
254                         compatible = "ti,tps65218-dcdc6";
255                         regulator-name = "v1_8bat";
256                         regulator-min-microvolt = <1800000>;
257                         regulator-max-microvolt = <1800000>;
258                         regulator-boot-on;
259                         regulator-always-on;
260                 };
261
262                 ldo1: regulator-ldo1 {
263                         compatible = "ti,tps65218-ldo1";
264                         regulator-min-microvolt = <1800000>;
265                         regulator-max-microvolt = <1800000>;
266                         regulator-boot-on;
267                         regulator-always-on;
268                 };
269         };
270
271         eeprom_module: at24@50 {
272                 compatible = "atmel,24c02";
273                 reg = <0x50>;
274                 pagesize = <16>;
275         };
276 };
277
278 &gpio0 {
279         status = "okay";
280 };
281
282 &gpio1 {
283         status = "okay";
284 };
285
286 &gpio2 {
287         status = "okay";
288 };
289
290 &gpio3 {
291         status = "okay";
292 };
293
294 &gpio4 {
295         status = "okay";
296 };
297
298 &gpio5 {
299         status = "okay";
300 };
301
302 &mmc2 {
303         status = "okay";
304         pinctrl-names = "default";
305         pinctrl-0 = <&emmc_pins>;
306         vmmc-supply = <&vmmc_3v3>;
307         bus-width = <8>;
308         ti,non-removable;
309 };
310
311 &spi0 {
312         status = "okay";
313         pinctrl-names = "default";
314         pinctrl-0 = <&spi0_pins>;
315         dmas = <&edma 16
316                 &edma 17>;
317         dma-names = "tx0", "rx0";
318
319         flash: w25q64cvzpig@0 {
320                 #address-cells = <1>;
321                 #size-cells = <1>;
322                 compatible = "jedec,spi-nor";
323                 reg = <0>;
324                 spi-max-frequency = <20000000>;
325                 partition@0 {
326                         label = "uboot";
327                         reg = <0x0 0xc0000>;
328                 };
329
330                 partition@c0000 {
331                         label = "uboot environment";
332                         reg = <0xc0000 0x40000>;
333                 };
334
335                 partition@100000 {
336                         label = "reserved";
337                         reg = <0x100000 0x100000>;
338                 };
339         };
340 };
341
342 &mac {
343         pinctrl-names = "default";
344         pinctrl-0 = <&cpsw_default>;
345         dual_emac = <1>;
346         status = "okay";
347 };
348
349 &davinci_mdio {
350         pinctrl-names = "default";
351         pinctrl-0 = <&davinci_mdio_default>;
352         status = "okay";
353 };
354
355 &cpsw_emac0 {
356         phy_id = <&davinci_mdio>, <0>;
357         phy-mode = "rgmii-txid";
358         dual_emac_res_vlan = <1>;
359 };
360
361 &cpsw_emac1 {
362         phy_id = <&davinci_mdio>, <1>;
363         phy-mode = "rgmii-txid";
364         dual_emac_res_vlan = <2>;
365 };
366
367 &dwc3_1 {
368         status = "okay";
369 };
370
371 &usb2_phy1 {
372         status = "okay";
373 };
374
375 &usb1 {
376         dr_mode = "host";
377         status = "okay";
378 };
379
380 &dwc3_2 {
381         status = "okay";
382 };
383
384 &usb2_phy2 {
385         status = "okay";
386 };
387
388 &usb2 {
389         dr_mode = "host";
390         status = "okay";
391         interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>,
392                      <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>,
393                      <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH>;
394         interrupt-names = "peripheral", "host", "otg";
395 };
396
397 &elm {
398         status = "okay";
399 };
400
401 &uart0 {
402         status = "okay";
403 };
404
405 &tscadc {
406         status = "okay";
407         tsc {
408                 ti,wires = <4>;
409                 ti,x-plate-resistance = <200>;
410                 ti,coordiante-readouts = <5>;
411                 ti,wire-config = <0x00 0x11 0x22 0x33>;
412         };
413
414         adc {
415                 ti,adc-channels = <4 5 6 7>;
416         };
417 };
418
419 &cpu {
420         cpu0-supply = <&dcdc2>;
421         operating-points = <1000000 1330000>,
422                            <800000 1260000>,
423                            <720000 1200000>,
424                            <600000 1100000>,
425                            <300000 950000>;
426 };