blob: 9f5b4c7c0c086df37aac599bbaa3df421ac561ec [file] [log] [blame]
Murali Karicherieed48552013-04-03 19:39:07 +05301Davinci SPI controller device bindings
2
Murali Karicheri365a7bb2014-09-16 14:25:05 +03003Links on DM:
4Keystone 2 - http://www.ti.com/lit/ug/sprugp2a/sprugp2a.pdf
5dm644x - http://www.ti.com/lit/ug/sprue32a/sprue32a.pdf
6OMAP-L138/da830 - http://www.ti.com/lit/ug/spruh77a/spruh77a.pdf
7
Murali Karicherieed48552013-04-03 19:39:07 +05308Required properties:
9- #address-cells: number of cells required to define a chip select
10 address on the SPI bus. Should be set to 1.
11- #size-cells: should be zero.
12- compatible:
13 - "ti,dm6441-spi" for SPI used similar to that on DM644x SoC family
14 - "ti,da830-spi" for SPI used similar to that on DA8xx SoC family
Franklin S Cooper Jrfa466c92015-07-22 07:32:22 -050015 - "ti,keystone-spi" for SPI used similar to that on Keystone2 SoC
16 family
Murali Karicherieed48552013-04-03 19:39:07 +053017- reg: Offset and length of SPI controller register space
Murali Karicheria88e34e2014-08-01 19:40:32 +030018- num-cs: Number of chip selects. This includes internal as well as
19 GPIO chip selects.
Murali Karicherieed48552013-04-03 19:39:07 +053020- ti,davinci-spi-intr-line: interrupt line used to connect the SPI
21 IP to the interrupt controller within the SoC. Possible values
22 are 0 and 1. Manual says one of the two possible interrupt
23 lines can be tied to the interrupt controller. Set this
Masanari Iida0fb76202016-06-29 04:33:33 +090024 based on a specific SoC configuration.
Murali Karicherieed48552013-04-03 19:39:07 +053025- interrupts: interrupt number mapped to CPU.
26- clocks: spi clk phandle
Franklin Cooper32c30f72017-09-08 15:46:36 -050027 For 66AK2G this property should be set per binding,
28 Documentation/devicetree/bindings/clock/ti,sci-clk.txt
29
30SoC-specific Required Properties:
31
32The following are mandatory properties for Keystone 2 66AK2G SoCs only:
33
34- power-domains: Should contain a phandle to a PM domain provider node
35 and an args specifier containing the SPI device id
36 value. This property is as per the binding,
Murali Karicherieed48552013-04-03 19:39:07 +053037
Murali Karicheria88e34e2014-08-01 19:40:32 +030038Optional:
39- cs-gpios: gpio chip selects
40 For example to have 3 internal CS and 2 GPIO CS, user could define
41 cs-gpios = <0>, <0>, <0>, <&gpio1 30 0>, <&gpio1 31 0>;
42 where first three are internal CS and last two are GPIO CS.
43
Murali Karicheri365a7bb2014-09-16 14:25:05 +030044Optional properties for slave devices:
45SPI slave nodes can contain the following properties.
46Not all SPI Peripherals from Texas Instruments support this.
47Please check SPI peripheral documentation for a device before using these.
48
49- ti,spi-wdelay : delay between transmission of words
50 (SPIFMTn.WDELAY, SPIDAT1.WDEL) must be specified in number of SPI module
51 clock periods.
52
53 delay = WDELAY * SPI_module_clock_period + 2 * SPI_module_clock_period
54
55Below is timing diagram which shows functional meaning of
56"ti,spi-wdelay" parameter.
57
58 +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+
59SPI_CLK | | | | | | | | | | | | | | | |
60 +----------+ +-+ +-+ +-+ +-+ +---------------------------+ +-+ +-+ +-
61
62SPI_SOMI/SIMO+-----------------+ +-----------
63 +----------+ word1 +---------------------------+word2
64 +-----------------+ +-----------
65 WDELAY
66 <-------------------------->
67
Murali Karicherieed48552013-04-03 19:39:07 +053068Example of a NOR flash slave device (n25q032) connected to DaVinci
69SPI controller device over the SPI bus.
70
Rob Herringafc3bca2017-12-21 12:29:17 -060071spi0:spi@20bf0000 {
Murali Karicherieed48552013-04-03 19:39:07 +053072 #address-cells = <1>;
73 #size-cells = <0>;
74 compatible = "ti,dm6446-spi";
75 reg = <0x20BF0000 0x1000>;
76 num-cs = <4>;
77 ti,davinci-spi-intr-line = <0>;
78 interrupts = <338>;
79 clocks = <&clkspi>;
80
81 flash: n25q032@0 {
82 #address-cells = <1>;
83 #size-cells = <1>;
84 compatible = "st,m25p32";
85 spi-max-frequency = <25000000>;
86 reg = <0>;
Murali Karicheri365a7bb2014-09-16 14:25:05 +030087 ti,spi-wdelay = <8>;
Murali Karicherieed48552013-04-03 19:39:07 +053088
89 partition@0 {
90 label = "u-boot-spl";
91 reg = <0x0 0x80000>;
92 read-only;
93 };
94
95 partition@1 {
96 label = "test";
97 reg = <0x80000 0x380000>;
98 };
99 };
100};