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