Commit a8830cb1 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Mark Brown

spi: Document DT bindings for SPI controllers in slave mode

Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2ea659a9
SPI (Serial Peripheral Interface) busses SPI (Serial Peripheral Interface) busses
SPI busses can be described with a node for the SPI master device SPI busses can be described with a node for the SPI controller device
and a set of child nodes for each SPI slave on the bus. For this and a set of child nodes for each SPI slave on the bus. The system's SPI
discussion, it is assumed that the system's SPI controller is in controller may be described for use in SPI master mode or in SPI slave mode,
SPI master mode. This binding does not describe SPI controllers but not for both at the same time.
in slave mode.
The SPI master node requires the following properties: The SPI controller node requires the following properties:
- compatible - Name of SPI bus controller following generic names
recommended practice.
In master mode, the SPI controller node requires the following additional
properties:
- #address-cells - number of cells required to define a chip select - #address-cells - number of cells required to define a chip select
address on the SPI bus. address on the SPI bus.
- #size-cells - should be zero. - #size-cells - should be zero.
- compatible - name of SPI bus controller following generic names
recommended practice. In slave mode, the SPI controller node requires one additional property:
- spi-slave - Empty property.
No other properties are required in the SPI bus node. It is assumed No other properties are required in the SPI bus node. It is assumed
that a driver for an SPI bus device will understand that it is an SPI bus. that a driver for an SPI bus device will understand that it is an SPI bus.
However, the binding does not attempt to define the specific method for However, the binding does not attempt to define the specific method for
...@@ -21,7 +27,7 @@ assumption that board specific platform code will be used to manage ...@@ -21,7 +27,7 @@ assumption that board specific platform code will be used to manage
chip selects. Individual drivers can define additional properties to chip selects. Individual drivers can define additional properties to
support describing the chip select layout. support describing the chip select layout.
Optional properties: Optional properties (master mode only):
- cs-gpios - gpios chip select. - cs-gpios - gpios chip select.
- num-cs - total number of chipselects. - num-cs - total number of chipselects.
...@@ -41,28 +47,36 @@ cs1 : native ...@@ -41,28 +47,36 @@ cs1 : native
cs2 : &gpio1 1 0 cs2 : &gpio1 1 0
cs3 : &gpio1 2 0 cs3 : &gpio1 2 0
SPI slave nodes must be children of the SPI master node and can
contain the following properties. SPI slave nodes must be children of the SPI controller node.
- reg - (required) chip select address of device.
- compatible - (required) name of SPI device following generic names In master mode, one or more slave nodes (up to the number of chip selects) can
recommended practice. be present. Required properties are:
- spi-max-frequency - (required) Maximum SPI clocking speed of device in Hz. - compatible - Name of SPI device following generic names recommended
- spi-cpol - (optional) Empty property indicating device requires practice.
inverse clock polarity (CPOL) mode. - reg - Chip select address of device.
- spi-cpha - (optional) Empty property indicating device requires - spi-max-frequency - Maximum SPI clocking speed of device in Hz.
shifted clock phase (CPHA) mode.
- spi-cs-high - (optional) Empty property indicating device requires In slave mode, the (single) slave node is optional.
chip select active high. If present, it must be called "slave". Required properties are:
- spi-3wire - (optional) Empty property indicating device requires - compatible - Name of SPI device following generic names recommended
3-wire mode. practice.
- spi-lsb-first - (optional) Empty property indicating device requires
LSB first mode. All slave nodes can contain the following optional properties:
- spi-tx-bus-width - (optional) The bus width (number of data wires) that is - spi-cpol - Empty property indicating device requires inverse clock
used for MOSI. Defaults to 1 if not present. polarity (CPOL) mode.
- spi-rx-bus-width - (optional) The bus width (number of data wires) that is - spi-cpha - Empty property indicating device requires shifted clock
used for MISO. Defaults to 1 if not present. phase (CPHA) mode.
- spi-rx-delay-us - (optional) Microsecond delay after a read transfer. - spi-cs-high - Empty property indicating device requires chip select
- spi-tx-delay-us - (optional) Microsecond delay after a write transfer. active high.
- spi-3wire - Empty property indicating device requires 3-wire mode.
- spi-lsb-first - Empty property indicating device requires LSB first mode.
- spi-tx-bus-width - The bus width (number of data wires) that is used for MOSI.
Defaults to 1 if not present.
- spi-rx-bus-width - The bus width (number of data wires) that is used for MISO.
Defaults to 1 if not present.
- spi-rx-delay-us - Microsecond delay after a read transfer.
- spi-tx-delay-us - Microsecond delay after a write transfer.
Some SPI controllers and devices support Dual and Quad SPI transfer mode. Some SPI controllers and devices support Dual and Quad SPI transfer mode.
It allows data in the SPI system to be transferred using 2 wires (DUAL) or 4 It allows data in the SPI system to be transferred using 2 wires (DUAL) or 4
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment