This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5728: Bit-banged SPI using GPIO pins

Part Number: AM5728

Can someone point me to TI documentation that explains how to make an DTS entry to configure GPIO as bitbanging SPI?

I would like to see explanation on keywords (gpio-mosi, cs-gpios, etc), and  their usage syntax.

I would also like pointers to working example (annotated/commented) for configuring multiple chip selects (MOSI, MISO, CLK, CS0, CS1).

It's hard to find authoritative and complete device tree documentation. 

  • Hello,

    Refer to below txt files:

    linux-kernel/Documentation/devicetree/bindings/spi/spi-gpio.txt

    linux-kernel/Documentation/devicetree/bindings/spi/spi-bus.txt

    linux-kernel/Documentation/devicetree/bindings/spi/omap-spi.txt


    MCSPI DTS example you might find in below file. In this file, McSPI3 CS0 is used.

    linux-kernel/arch/arm/boot/dts/am57xx-idk-common.dtsi


    AnotherEmbeddedGuy said:
    I would also like pointers to working example (annotated/commented) for configuring multiple chip selects (MOSI, MISO, CLK, CS0, CS1).

    You might refer to below DTS file, where McSPI0.CS0 is connected to NOR Flash, McSPI0.CS1 is connected to SN65HVS882 chip.

    linux-kernel/arch/arm/boot/dts/am335x-icev2-common.dtsi

    Regards,
    Pavel

  • Thank you Pavel.  That helps.

    A follow-up questions.

    For a line such as this, what is the meaning of the last zero within the angle bracket?

    cs-gpios = <&gpio1 0 0>

                         ^

                         |_ ?

    Where is this explained ?

  • Hello,

    The last 0 means GPIO_ACTIVE_HIGH. Check below DTS files for examples:

    linux-kernel/arch/arm/boot/dts/omap3-gta04.dtsi
    linux-kernel/arch/arm/boot/dts/da850-lego-ev3.dts

    linux-kernel/include/dt-bindings/gpio/gpio.h


    Regards,
    Pavel

  • Thanks Pavel for pointing me to examples and  #define source.

    I don't want to be critical but without inferring from examples, how is one supposed to figure out what expression goes inside the angle brackets ?

    Does TI publish a comprehensive device tree user manual that spells out such details?

    Thanks again. 

  • Pavel,

    I found the devicetree specification at http://devicetree.org

    -> devicetree-specification-v0.3-rc2.pdf

    You can close this issue.

    Thanks