spi-bus.txt 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. SPI slave nodes must be children of the SPI master node and can
  22. contain the following properties.
  23. - reg - (required) chip select address of device.
  24. - compatible - (required) name of SPI device following generic names
  25. recommended practice
  26. - spi-max-frequency - (required) Maximum SPI clocking speed of device in Hz
  27. - spi-cpol - (optional) Empty property indicating device requires
  28. inverse clock polarity (CPOL) mode
  29. - spi-cpha - (optional) Empty property indicating device requires
  30. shifted clock phase (CPHA) mode
  31. - spi-cs-high - (optional) Empty property indicating device requires
  32. chip select active high
  33. SPI example for an MPC5200 SPI bus:
  34. spi@f00 {
  35. #address-cells = <1>;
  36. #size-cells = <0>;
  37. compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi";
  38. reg = <0xf00 0x20>;
  39. interrupts = <2 13 0 2 14 0>;
  40. interrupt-parent = <&mpc5200_pic>;
  41. ethernet-switch@0 {
  42. compatible = "micrel,ks8995m";
  43. spi-max-frequency = <1000000>;
  44. reg = <0>;
  45. };
  46. codec@1 {
  47. compatible = "ti,tlv320aic26";
  48. spi-max-frequency = <100000>;
  49. reg = <1>;
  50. };
  51. };