xref: /freebsd-src/sys/contrib/device-tree/Bindings/gpio/spear_spics.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel Vadot=== ST Microelectronics SPEAr SPI CS Driver ===
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotSPEAr platform provides a provision to control chipselects of ARM PL022 Prime
4*c66ec88fSEmmanuel VadotCell spi controller through its system registers, which otherwise remains under
5*c66ec88fSEmmanuel VadotPL022 control. If chipselect remain under PL022 control then they would be
6*c66ec88fSEmmanuel Vadotreleased as soon as transfer is over and TxFIFO becomes empty. This is not
7*c66ec88fSEmmanuel Vadotdesired by some of the device protocols above spi which expect (multiple)
8*c66ec88fSEmmanuel Vadottransfers without releasing their chipselects.
9*c66ec88fSEmmanuel Vadot
10*c66ec88fSEmmanuel VadotChipselects can be controlled by software by turning them as GPIOs. SPEAr
11*c66ec88fSEmmanuel Vadotprovides another interface through system registers through which software can
12*c66ec88fSEmmanuel Vadotdirectly control each PL022 chipselect. Hence, it is natural for SPEAr to export
13*c66ec88fSEmmanuel Vadotthe control of this interface as gpio.
14*c66ec88fSEmmanuel Vadot
15*c66ec88fSEmmanuel VadotRequired properties:
16*c66ec88fSEmmanuel Vadot
17*c66ec88fSEmmanuel Vadot  * compatible: should be defined as "st,spear-spics-gpio"
18*c66ec88fSEmmanuel Vadot  * reg: mentioning address range of spics controller
19*c66ec88fSEmmanuel Vadot  * st-spics,peripcfg-reg: peripheral configuration register offset
20*c66ec88fSEmmanuel Vadot  * st-spics,sw-enable-bit: bit offset to enable sw control
21*c66ec88fSEmmanuel Vadot  * st-spics,cs-value-bit: bit offset to drive chipselect low or high
22*c66ec88fSEmmanuel Vadot  * st-spics,cs-enable-mask: chip select number bit mask
23*c66ec88fSEmmanuel Vadot  * st-spics,cs-enable-shift: chip select number program offset
24*c66ec88fSEmmanuel Vadot  * gpio-controller: Marks the device node as gpio controller
25*c66ec88fSEmmanuel Vadot  * #gpio-cells: should be 1 and will mention chip select number
26*c66ec88fSEmmanuel Vadot
27*c66ec88fSEmmanuel VadotAll the above bit offsets are within peripcfg register.
28*c66ec88fSEmmanuel Vadot
29*c66ec88fSEmmanuel VadotExample:
30*c66ec88fSEmmanuel Vadot-------
31*c66ec88fSEmmanuel Vadotspics: spics@e0700000{
32*c66ec88fSEmmanuel Vadot        compatible = "st,spear-spics-gpio";
33*c66ec88fSEmmanuel Vadot        reg = <0xe0700000 0x1000>;
34*c66ec88fSEmmanuel Vadot        st-spics,peripcfg-reg = <0x3b0>;
35*c66ec88fSEmmanuel Vadot        st-spics,sw-enable-bit = <12>;
36*c66ec88fSEmmanuel Vadot        st-spics,cs-value-bit = <11>;
37*c66ec88fSEmmanuel Vadot        st-spics,cs-enable-mask = <3>;
38*c66ec88fSEmmanuel Vadot        st-spics,cs-enable-shift = <8>;
39*c66ec88fSEmmanuel Vadot        gpio-controller;
40*c66ec88fSEmmanuel Vadot        #gpio-cells = <2>;
41*c66ec88fSEmmanuel Vadot};
42*c66ec88fSEmmanuel Vadot
43*c66ec88fSEmmanuel Vadot
44*c66ec88fSEmmanuel Vadotspi0: spi@e0100000 {
45*c66ec88fSEmmanuel Vadot        num-cs = <3>;
46*c66ec88fSEmmanuel Vadot        cs-gpios = <&gpio1 7 0>, <&spics 0>,
47*c66ec88fSEmmanuel Vadot                   <&spics 1>;
48*c66ec88fSEmmanuel Vadot	...
49*c66ec88fSEmmanuel Vadot}
50