xref: /openbmc/u-boot/doc/device-tree-bindings/spi/soft-spi.txt (revision 1d12a7c8cd4e58d5c3989bc239d5fa9577079dfd)
1623b6386SSimon GlassSoft SPI
2623b6386SSimon Glass
3623b6386SSimon GlassThe soft SPI bus implementation allows the use of GPIO pins to simulate a
4623b6386SSimon GlassSPI bus. No SPI host is required for this to work. The down-side is that the
5623b6386SSimon Glassperformance will typically be much lower than a real SPI bus.
6623b6386SSimon Glass
7623b6386SSimon GlassThe soft SPI node requires the following properties:
8623b6386SSimon Glass
9*32466c44SMiquel RaynalMandatory properties:
10*32466c44SMiquel Raynalcompatible: "spi-gpio"
11*32466c44SMiquel Raynalcs-gpios: GPIOs to use for SPI chip select (output)
12*32466c44SMiquel Raynalgpio-sck: GPIO to use for SPI clock (output)
13*32466c44SMiquel RaynalAnd at least one of:
14*32466c44SMiquel Raynalgpio-mosi: GPIO to use for SPI MOSI line (output)
15*32466c44SMiquel Raynalgpio-miso: GPIO to use for SPI MISO line (input)
16*32466c44SMiquel Raynal
17*32466c44SMiquel RaynalOptional propertie:
18623b6386SSimon Glassspi-delay-us: Number of microseconds of delay between each CS transition
19623b6386SSimon Glass
20623b6386SSimon GlassThe GPIOs should be specified as required by the GPIO controller referenced.
21623b6386SSimon GlassThe first cell holds the phandle of the controller and the second cell
22623b6386SSimon Glasstypically holds the GPIO number.
23623b6386SSimon Glass
24623b6386SSimon Glass
25623b6386SSimon GlassExample:
26623b6386SSimon Glass
27623b6386SSimon Glass	soft-spi {
28*32466c44SMiquel Raynal		compatible = "spi-gpio";
29*32466c44SMiquel Raynal		cs-gpios = <&gpio 235 0>;	/* Y43 */
30*32466c44SMiquel Raynal		gpio-sck = <&gpio 225 0>;	/* Y31 */
31*32466c44SMiquel Raynal		gpio-mosi = <&gpio 227 0>;	/* Y33 */
32*32466c44SMiquel Raynal		gpio-miso = <&gpio 224 0>;	/* Y30 */
33623b6386SSimon Glass		spi-delay-us = <1>;
34623b6386SSimon Glass		#address-cells = <1>;
35623b6386SSimon Glass		#size-cells = <0>;
36623b6386SSimon Glass		cs@0 {
37623b6386SSimon Glass		};
38623b6386SSimon Glass	};
39