October 2017
Intermediate to advanced
586 pages
14h 8m
English
Like I2C devices, SPI devices belong to the non-memory mapped devices family in the DT, but are addressable too. Here, the address means the CS index among the list of CS (starting from 0) given to the controller (the master). As an example, we may have three different SPI devices sitting on the SPI bus, each with its CS line. The master will be given general purpose input/output (GPIO) set, each representing the CS to activate a device. If Device X uses the second GPIO line as the CS, we must set its address to 1 (as we always start from 0) in the reg property.
The following is a real DT listing for SPI devices:
ecspi1 { fsl,spi-num-chipselects = <3>; cs-gpios = <&gpio5 17 0>, <&gpio5 17 0>, <&gpio5 17 0>; pinctrl-0 = ...