spi-bus.txt 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. SPI (Serial Peripheral Interface) busses
  2. SPI busses can be described with a node for the SPI master device
  3. and a set of child nodes for each SPI slave on the bus. For this
  4. discussion, it is assumed that the system's SPI controller is in
  5. SPI master mode. This binding does not describe SPI controllers
  6. in slave mode.
  7. The SPI master node requires the following properties:
  8. - #address-cells - number of cells required to define a chip select
  9. address on the SPI bus.
  10. - #size-cells - should be zero.
  11. - compatible - name of SPI bus controller following generic names
  12. recommended practice.
  13. No other properties are required in the SPI bus node. It is assumed
  14. that a driver for an SPI bus device will understand that it is an SPI bus.
  15. However, the binding does not attempt to define the specific method for
  16. assigning chip select numbers. Since SPI chip select configuration is
  17. flexible and non-standardized, it is left out of this binding with the
  18. assumption that board specific platform code will be used to manage
  19. chip selects. Individual drivers can define additional properties to
  20. support describing the chip select layout.
  21. Optional property:
  22. - num-cs : total number of chipselects
  23. SPI slave nodes must be children of the SPI master node and can
  24. contain the following properties.
  25. - reg - (required) chip select address of device.
  26. - compatible - (required) name of SPI device following generic names
  27. recommended practice
  28. - spi-max-frequency - (required) Maximum SPI clocking speed of device in Hz
  29. - spi-cpol - (optional) Empty property indicating device requires
  30. inverse clock polarity (CPOL) mode
  31. - spi-cpha - (optional) Empty property indicating device requires
  32. shifted clock phase (CPHA) mode
  33. - spi-cs-high - (optional) Empty property indicating device requires
  34. chip select active high
  35. SPI example for an MPC5200 SPI bus:
  36. spi@f00 {
  37. #address-cells = <1>;
  38. #size-cells = <0>;
  39. compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi";
  40. reg = <0xf00 0x20>;
  41. interrupts = <2 13 0 2 14 0>;
  42. interrupt-parent = <&mpc5200_pic>;
  43. ethernet-switch@0 {
  44. compatible = "micrel,ks8995m";
  45. spi-max-frequency = <1000000>;
  46. reg = <0>;
  47. };
  48. codec@1 {
  49. compatible = "ti,tlv320aic26";
  50. spi-max-frequency = <100000>;
  51. reg = <1>;
  52. };
  53. };