18c2ecf20Sopenharmony_ciQualcomm Universal Peripheral (QUP) Serial Peripheral Interface (SPI)
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThe QUP core is an AHB slave that provides a common data path (an output FIFO
48c2ecf20Sopenharmony_ciand an input FIFO) for serial peripheral interface (SPI) mini-core.
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ciSPI in master mode supports up to 50MHz, up to four chip selects, programmable
78c2ecf20Sopenharmony_cidata path from 4 bits to 32 bits and numerous protocol variants.
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciRequired properties:
108c2ecf20Sopenharmony_ci- compatible:     Should contain:
118c2ecf20Sopenharmony_ci		  "qcom,spi-qup-v1.1.1" for 8660, 8960 and 8064.
128c2ecf20Sopenharmony_ci		  "qcom,spi-qup-v2.1.1" for 8974 and later
138c2ecf20Sopenharmony_ci		  "qcom,spi-qup-v2.2.1" for 8974 v2 and later.
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci- reg:            Should contain base register location and length
168c2ecf20Sopenharmony_ci- interrupts:     Interrupt number used by this controller
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci- clocks:         Should contain the core clock and the AHB clock.
198c2ecf20Sopenharmony_ci- clock-names:    Should be "core" for the core clock and "iface" for the
208c2ecf20Sopenharmony_ci                  AHB clock.
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci- #address-cells: Number of cells required to define a chip select
238c2ecf20Sopenharmony_ci                  address on the SPI bus. Should be set to 1.
248c2ecf20Sopenharmony_ci- #size-cells:    Should be zero.
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciOptional properties:
278c2ecf20Sopenharmony_ci- spi-max-frequency: Specifies maximum SPI clock frequency,
288c2ecf20Sopenharmony_ci                     Units - Hz. Definition as per
298c2ecf20Sopenharmony_ci                     Documentation/devicetree/bindings/spi/spi-bus.txt
308c2ecf20Sopenharmony_ci- num-cs:	total number of chipselects
318c2ecf20Sopenharmony_ci- cs-gpios:	should specify GPIOs used for chipselects.
328c2ecf20Sopenharmony_ci		The gpios will be referred to as reg = <index> in the SPI child
338c2ecf20Sopenharmony_ci		nodes.  If unspecified, a single SPI device without a chip
348c2ecf20Sopenharmony_ci		select can be used.
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci- dmas:         Two DMA channel specifiers following the convention outlined
378c2ecf20Sopenharmony_ci                in bindings/dma/dma.txt
388c2ecf20Sopenharmony_ci- dma-names:    Names for the dma channels, if present. There must be at
398c2ecf20Sopenharmony_ci                least one channel named "tx" for transmit and named "rx" for
408c2ecf20Sopenharmony_ci                receive.
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ciSPI slave nodes must be children of the SPI master node and can contain
438c2ecf20Sopenharmony_ciproperties described in Documentation/devicetree/bindings/spi/spi-bus.txt
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ciExample:
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci	spi_8: spi@f9964000 { /* BLSP2 QUP2 */
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci		compatible = "qcom,spi-qup-v2";
508c2ecf20Sopenharmony_ci		#address-cells = <1>;
518c2ecf20Sopenharmony_ci		#size-cells = <0>;
528c2ecf20Sopenharmony_ci		reg = <0xf9964000 0x1000>;
538c2ecf20Sopenharmony_ci		interrupts = <0 102 0>;
548c2ecf20Sopenharmony_ci		spi-max-frequency = <19200000>;
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci		clocks = <&gcc GCC_BLSP2_QUP2_SPI_APPS_CLK>, <&gcc GCC_BLSP2_AHB_CLK>;
578c2ecf20Sopenharmony_ci		clock-names = "core", "iface";
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci		dmas = <&blsp1_bam 13>, <&blsp1_bam 12>;
608c2ecf20Sopenharmony_ci		dma-names = "rx", "tx";
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci		pinctrl-names = "default";
638c2ecf20Sopenharmony_ci		pinctrl-0 = <&spi8_default>;
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci		device@0 {
668c2ecf20Sopenharmony_ci			compatible = "arm,pl022-dummy";
678c2ecf20Sopenharmony_ci			#address-cells = <1>;
688c2ecf20Sopenharmony_ci			#size-cells = <1>;
698c2ecf20Sopenharmony_ci			reg = <0>; /* Chip select 0 */
708c2ecf20Sopenharmony_ci			spi-max-frequency = <19200000>;
718c2ecf20Sopenharmony_ci			spi-cpol;
728c2ecf20Sopenharmony_ci		};
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci		device@1 {
758c2ecf20Sopenharmony_ci			compatible = "arm,pl022-dummy";
768c2ecf20Sopenharmony_ci			#address-cells = <1>;
778c2ecf20Sopenharmony_ci			#size-cells = <1>;
788c2ecf20Sopenharmony_ci			reg = <1>; /* Chip select 1 */
798c2ecf20Sopenharmony_ci			spi-max-frequency = <9600000>;
808c2ecf20Sopenharmony_ci			spi-cpha;
818c2ecf20Sopenharmony_ci		};
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci		device@2 {
848c2ecf20Sopenharmony_ci			compatible = "arm,pl022-dummy";
858c2ecf20Sopenharmony_ci			#address-cells = <1>;
868c2ecf20Sopenharmony_ci			#size-cells = <1>;
878c2ecf20Sopenharmony_ci			reg = <2>; /* Chip select 2 */
888c2ecf20Sopenharmony_ci			spi-max-frequency = <19200000>;
898c2ecf20Sopenharmony_ci			spi-cpol;
908c2ecf20Sopenharmony_ci			spi-cpha;
918c2ecf20Sopenharmony_ci		};
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci		device@3 {
948c2ecf20Sopenharmony_ci			compatible = "arm,pl022-dummy";
958c2ecf20Sopenharmony_ci			#address-cells = <1>;
968c2ecf20Sopenharmony_ci			#size-cells = <1>;
978c2ecf20Sopenharmony_ci			reg = <3>; /* Chip select 3 */
988c2ecf20Sopenharmony_ci			spi-max-frequency = <19200000>;
998c2ecf20Sopenharmony_ci			spi-cpol;
1008c2ecf20Sopenharmony_ci			spi-cpha;
1018c2ecf20Sopenharmony_ci			spi-cs-high;
1028c2ecf20Sopenharmony_ci		};
1038c2ecf20Sopenharmony_ci	};
104