xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/spi/spi-davinci.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunDavinci SPI controller device bindings
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunLinks on DM:
4*4882a593SmuzhiyunKeystone 2 - https://www.ti.com/lit/ug/sprugp2a/sprugp2a.pdf
5*4882a593Smuzhiyundm644x - https://www.ti.com/lit/ug/sprue32a/sprue32a.pdf
6*4882a593SmuzhiyunOMAP-L138/da830 - http://www.ti.com/lit/ug/spruh77a/spruh77a.pdf
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunRequired properties:
9*4882a593Smuzhiyun- #address-cells: number of cells required to define a chip select
10*4882a593Smuzhiyun	address on the SPI bus. Should be set to 1.
11*4882a593Smuzhiyun- #size-cells: should be zero.
12*4882a593Smuzhiyun- compatible:
13*4882a593Smuzhiyun	- "ti,dm6441-spi" for SPI used similar to that on DM644x SoC family
14*4882a593Smuzhiyun	- "ti,da830-spi" for SPI used similar to that on DA8xx SoC family
15*4882a593Smuzhiyun	- "ti,keystone-spi" for SPI used similar to that on Keystone2 SoC
16*4882a593Smuzhiyun		family
17*4882a593Smuzhiyun- reg: Offset and length of SPI controller register space
18*4882a593Smuzhiyun- num-cs: Number of chip selects. This includes internal as well as
19*4882a593Smuzhiyun	GPIO chip selects.
20*4882a593Smuzhiyun- ti,davinci-spi-intr-line: interrupt line used to connect the SPI
21*4882a593Smuzhiyun	IP to the interrupt controller within the SoC. Possible values
22*4882a593Smuzhiyun	are 0 and 1. Manual says one of the two possible interrupt
23*4882a593Smuzhiyun	lines can be tied to the interrupt controller. Set this
24*4882a593Smuzhiyun	based on a specific SoC configuration.
25*4882a593Smuzhiyun- interrupts: interrupt number mapped to CPU.
26*4882a593Smuzhiyun- clocks: spi clk phandle
27*4882a593Smuzhiyun          For 66AK2G this property should be set per binding,
28*4882a593Smuzhiyun          Documentation/devicetree/bindings/clock/ti,sci-clk.txt
29*4882a593Smuzhiyun
30*4882a593SmuzhiyunSoC-specific Required Properties:
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunThe following are mandatory properties for Keystone 2 66AK2G SoCs only:
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun- power-domains:	Should contain a phandle to a PM domain provider node
35*4882a593Smuzhiyun			and an args specifier containing the SPI device id
36*4882a593Smuzhiyun			value. This property is as per the binding,
37*4882a593Smuzhiyun
38*4882a593SmuzhiyunOptional:
39*4882a593Smuzhiyun- cs-gpios: gpio chip selects
40*4882a593Smuzhiyun	For example to have 3 internal CS and 2 GPIO CS, user could define
41*4882a593Smuzhiyun	cs-gpios = <0>, <0>, <0>, <&gpio1 30 0>, <&gpio1 31 0>;
42*4882a593Smuzhiyun	where first three are internal CS and last two are GPIO CS.
43*4882a593Smuzhiyun
44*4882a593SmuzhiyunOptional properties for slave devices:
45*4882a593SmuzhiyunSPI slave nodes can contain the following properties.
46*4882a593SmuzhiyunNot all SPI Peripherals from Texas Instruments support this.
47*4882a593SmuzhiyunPlease check SPI peripheral documentation for a device before using these.
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun- ti,spi-wdelay : delay between transmission of words
50*4882a593Smuzhiyun	(SPIFMTn.WDELAY, SPIDAT1.WDEL) must be specified in number of SPI module
51*4882a593Smuzhiyun	clock periods.
52*4882a593Smuzhiyun
53*4882a593Smuzhiyun	delay = WDELAY * SPI_module_clock_period + 2 * SPI_module_clock_period
54*4882a593Smuzhiyun
55*4882a593SmuzhiyunBelow is timing diagram which shows functional meaning of
56*4882a593Smuzhiyun"ti,spi-wdelay" parameter.
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun             +-+ +-+ +-+ +-+ +-+                           +-+ +-+ +-+
59*4882a593SmuzhiyunSPI_CLK      | | | | | | | | | |                           | | | | | |
60*4882a593Smuzhiyun  +----------+ +-+ +-+ +-+ +-+ +---------------------------+ +-+ +-+ +-
61*4882a593Smuzhiyun
62*4882a593SmuzhiyunSPI_SOMI/SIMO+-----------------+                           +-----------
63*4882a593Smuzhiyun  +----------+ word1           +---------------------------+word2
64*4882a593Smuzhiyun             +-----------------+                           +-----------
65*4882a593Smuzhiyun                                          WDELAY
66*4882a593Smuzhiyun                                <-------------------------->
67*4882a593Smuzhiyun
68*4882a593SmuzhiyunExample of a NOR flash slave device (n25q032) connected to DaVinci
69*4882a593SmuzhiyunSPI controller device over the SPI bus.
70*4882a593Smuzhiyun
71*4882a593Smuzhiyunspi0:spi@20bf0000 {
72*4882a593Smuzhiyun	#address-cells			= <1>;
73*4882a593Smuzhiyun	#size-cells			= <0>;
74*4882a593Smuzhiyun	compatible			= "ti,dm6446-spi";
75*4882a593Smuzhiyun	reg				= <0x20BF0000 0x1000>;
76*4882a593Smuzhiyun	num-cs				= <4>;
77*4882a593Smuzhiyun	ti,davinci-spi-intr-line	= <0>;
78*4882a593Smuzhiyun	interrupts			= <338>;
79*4882a593Smuzhiyun	clocks				= <&clkspi>;
80*4882a593Smuzhiyun
81*4882a593Smuzhiyun	flash: n25q032@0 {
82*4882a593Smuzhiyun		#address-cells = <1>;
83*4882a593Smuzhiyun		#size-cells = <1>;
84*4882a593Smuzhiyun		compatible = "st,m25p32";
85*4882a593Smuzhiyun		spi-max-frequency = <25000000>;
86*4882a593Smuzhiyun		reg = <0>;
87*4882a593Smuzhiyun		ti,spi-wdelay = <8>;
88*4882a593Smuzhiyun
89*4882a593Smuzhiyun		partition@0 {
90*4882a593Smuzhiyun			label = "u-boot-spl";
91*4882a593Smuzhiyun			reg = <0x0 0x80000>;
92*4882a593Smuzhiyun			read-only;
93*4882a593Smuzhiyun		};
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun		partition@1 {
96*4882a593Smuzhiyun			label = "test";
97*4882a593Smuzhiyun			reg = <0x80000 0x380000>;
98*4882a593Smuzhiyun		};
99*4882a593Smuzhiyun	};
100*4882a593Smuzhiyun};
101