spear_spics.txt 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. === ST Microelectronics SPEAr SPI CS Driver ===
  2. SPEAr platform provides a provision to control chipselects of ARM PL022 Prime
  3. Cell spi controller through its system registers, which otherwise remains under
  4. PL022 control. If chipselect remain under PL022 control then they would be
  5. released as soon as transfer is over and TxFIFO becomes empty. This is not
  6. desired by some of the device protocols above spi which expect (multiple)
  7. transfers without releasing their chipselects.
  8. Chipselects can be controlled by software by turning them as GPIOs. SPEAr
  9. provides another interface through system registers through which software can
  10. directly control each PL022 chipselect. Hence, it is natural for SPEAr to export
  11. the control of this interface as gpio.
  12. Required properties:
  13. * compatible: should be defined as "st,spear-spics-gpio"
  14. * reg: mentioning address range of spics controller
  15. * st-spics,peripcfg-reg: peripheral configuration register offset
  16. * st-spics,sw-enable-bit: bit offset to enable sw control
  17. * st-spics,cs-value-bit: bit offset to drive chipselect low or high
  18. * st-spics,cs-enable-mask: chip select number bit mask
  19. * st-spics,cs-enable-shift: chip select number program offset
  20. * gpio-controller: Marks the device node as gpio controller
  21. * #gpio-cells: should be 1 and will mention chip select number
  22. All the above bit offsets are within peripcfg register.
  23. Example:
  24. -------
  25. spics: spics@e0700000{
  26. compatible = "st,spear-spics-gpio";
  27. reg = <0xe0700000 0x1000>;
  28. st-spics,peripcfg-reg = <0x3b0>;
  29. st-spics,sw-enable-bit = <12>;
  30. st-spics,cs-value-bit = <11>;
  31. st-spics,cs-enable-mask = <3>;
  32. st-spics,cs-enable-shift = <8>;
  33. gpio-controller;
  34. #gpio-cells = <2>;
  35. };
  36. spi0: spi@e0100000 {
  37. status = "okay";
  38. num-cs = <3>;
  39. cs-gpios = <&gpio1 7 0>, <&spics 0>,
  40. <&spics 1>;
  41. ...
  42. }