162306a36Sopenharmony_ciDavinci SPI controller device bindings
262306a36Sopenharmony_ci
362306a36Sopenharmony_ciLinks on DM:
462306a36Sopenharmony_ciKeystone 2 - https://www.ti.com/lit/ug/sprugp2a/sprugp2a.pdf
562306a36Sopenharmony_cidm644x - https://www.ti.com/lit/ug/sprue32a/sprue32a.pdf
662306a36Sopenharmony_ciOMAP-L138/da830 - http://www.ti.com/lit/ug/spruh77a/spruh77a.pdf
762306a36Sopenharmony_ci
862306a36Sopenharmony_ciRequired properties:
962306a36Sopenharmony_ci- #address-cells: number of cells required to define a chip select
1062306a36Sopenharmony_ci	address on the SPI bus. Should be set to 1.
1162306a36Sopenharmony_ci- #size-cells: should be zero.
1262306a36Sopenharmony_ci- compatible:
1362306a36Sopenharmony_ci	- "ti,dm6441-spi" for SPI used similar to that on DM644x SoC family
1462306a36Sopenharmony_ci	- "ti,da830-spi" for SPI used similar to that on DA8xx SoC family
1562306a36Sopenharmony_ci	- "ti,keystone-spi" for SPI used similar to that on Keystone2 SoC
1662306a36Sopenharmony_ci		family
1762306a36Sopenharmony_ci- reg: Offset and length of SPI controller register space
1862306a36Sopenharmony_ci- num-cs: Number of chip selects. This includes internal as well as
1962306a36Sopenharmony_ci	GPIO chip selects.
2062306a36Sopenharmony_ci- ti,davinci-spi-intr-line: interrupt line used to connect the SPI
2162306a36Sopenharmony_ci	IP to the interrupt controller within the SoC. Possible values
2262306a36Sopenharmony_ci	are 0 and 1. Manual says one of the two possible interrupt
2362306a36Sopenharmony_ci	lines can be tied to the interrupt controller. Set this
2462306a36Sopenharmony_ci	based on a specific SoC configuration.
2562306a36Sopenharmony_ci- interrupts: interrupt number mapped to CPU.
2662306a36Sopenharmony_ci- clocks: spi clk phandle
2762306a36Sopenharmony_ci          For 66AK2G this property should be set per binding,
2862306a36Sopenharmony_ci          Documentation/devicetree/bindings/clock/ti,sci-clk.yaml
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ciSoC-specific Required Properties:
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ciThe following are mandatory properties for Keystone 2 66AK2G SoCs only:
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci- power-domains:	Should contain a phandle to a PM domain provider node
3562306a36Sopenharmony_ci			and an args specifier containing the SPI device id
3662306a36Sopenharmony_ci			value. This property is as per the binding,
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ciOptional:
3962306a36Sopenharmony_ci- cs-gpios: gpio chip selects
4062306a36Sopenharmony_ci	For example to have 3 internal CS and 2 GPIO CS, user could define
4162306a36Sopenharmony_ci	cs-gpios = <0>, <0>, <0>, <&gpio1 30 0>, <&gpio1 31 0>;
4262306a36Sopenharmony_ci	where first three are internal CS and last two are GPIO CS.
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ciOptional properties for slave devices:
4562306a36Sopenharmony_ciSPI slave nodes can contain the following properties.
4662306a36Sopenharmony_ciNot all SPI Peripherals from Texas Instruments support this.
4762306a36Sopenharmony_ciPlease check SPI peripheral documentation for a device before using these.
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci- ti,spi-wdelay : delay between transmission of words
5062306a36Sopenharmony_ci	(SPIFMTn.WDELAY, SPIDAT1.WDEL) must be specified in number of SPI module
5162306a36Sopenharmony_ci	clock periods.
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci	delay = WDELAY * SPI_module_clock_period + 2 * SPI_module_clock_period
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ciBelow is timing diagram which shows functional meaning of
5662306a36Sopenharmony_ci"ti,spi-wdelay" parameter.
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci             +-+ +-+ +-+ +-+ +-+                           +-+ +-+ +-+
5962306a36Sopenharmony_ciSPI_CLK      | | | | | | | | | |                           | | | | | |
6062306a36Sopenharmony_ci  +----------+ +-+ +-+ +-+ +-+ +---------------------------+ +-+ +-+ +-
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ciSPI_SOMI/SIMO+-----------------+                           +-----------
6362306a36Sopenharmony_ci  +----------+ word1           +---------------------------+word2
6462306a36Sopenharmony_ci             +-----------------+                           +-----------
6562306a36Sopenharmony_ci                                          WDELAY
6662306a36Sopenharmony_ci                                <-------------------------->
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ciExample of a NOR flash slave device (n25q032) connected to DaVinci
6962306a36Sopenharmony_ciSPI controller device over the SPI bus.
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_cispi0:spi@20bf0000 {
7262306a36Sopenharmony_ci	#address-cells			= <1>;
7362306a36Sopenharmony_ci	#size-cells			= <0>;
7462306a36Sopenharmony_ci	compatible			= "ti,dm6446-spi";
7562306a36Sopenharmony_ci	reg				= <0x20BF0000 0x1000>;
7662306a36Sopenharmony_ci	num-cs				= <4>;
7762306a36Sopenharmony_ci	ti,davinci-spi-intr-line	= <0>;
7862306a36Sopenharmony_ci	interrupts			= <338>;
7962306a36Sopenharmony_ci	clocks				= <&clkspi>;
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci	flash: flash@0 {
8262306a36Sopenharmony_ci		#address-cells = <1>;
8362306a36Sopenharmony_ci		#size-cells = <1>;
8462306a36Sopenharmony_ci		compatible = "st,m25p32";
8562306a36Sopenharmony_ci		spi-max-frequency = <25000000>;
8662306a36Sopenharmony_ci		reg = <0>;
8762306a36Sopenharmony_ci		ti,spi-wdelay = <8>;
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_ci		partition@0 {
9062306a36Sopenharmony_ci			label = "u-boot-spl";
9162306a36Sopenharmony_ci			reg = <0x0 0x80000>;
9262306a36Sopenharmony_ci			read-only;
9362306a36Sopenharmony_ci		};
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ci		partition@1 {
9662306a36Sopenharmony_ci			label = "test";
9762306a36Sopenharmony_ci			reg = <0x80000 0x380000>;
9862306a36Sopenharmony_ci		};
9962306a36Sopenharmony_ci	};
10062306a36Sopenharmony_ci};
101