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.

Linux/PROCESSOR-SDK-AM437X: SPI communication issues

Part Number: PROCESSOR-SDK-AM437X
Other Parts Discussed in Thread: AM4372

Tool/software: Linux

Even with the following enables in config file, I still don't see spidev.

#
# SPI Master Controller Drivers
#
CONFIG_SPI=y
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y
# CONFIG_SPI_ALTERA is not set
# CONFIG_SPI_AXI_SPI_ENGINE is not set
CONFIG_SPI_BITBANG=m
# CONFIG_SPI_CADENCE is not set
# CONFIG_SPI_DESIGNWARE is not set
CONFIG_SPI_GPIO=m
# CONFIG_SPI_FSL_SPI is not set
# CONFIG_SPI_OC_TINY is not set
CONFIG_SPI_OMAP24XX=y
CONFIG_SPI_TI_QSPI=y
# CONFIG_SPI_PXA2XX is not set
# CONFIG_SPI_PXA2XX_PCI is not set
# CONFIG_SPI_ROCKCHIP is not set
# CONFIG_SPI_SC18IS602 is not set
# CONFIG_SPI_XCOMM is not set
# CONFIG_SPI_XILINX is not set
# CONFIG_SPI_ZYNQMP_GQSPI is not set

#
# SPI Protocol Masters
#
CONFIG_SPI_SPIDEV=y
CONFIG_SPI_LOOPBACK_TEST=y
# CONFIG_SPI_TLE62X0 is not set
CONFIG_SPMI=y
# CONFIG_HSI is not set

  • Hello Zhiwei,

    You have not entered the needed device tree changes or successfully replaced the old device tree with the new one.

    Best regards,
    Kemal
  • Part Number: PROCESSOR-SDK-AM437X

    Tool/software: Linux

    In which file to enable the SPI_SPIDEV for both SPI support and user mode support? 

  • Enable it by kernel's menuconfig which modifies the .config file.

  • For some reason, the manuconfig does not exist on our SDK. We have to modify the tisdk_am437x_evm_rt_defconfig file to enable the SPIDEV. Could you shine some light on why and possible solution?

    Thanks.
  • I mean when I try to run with menuconfig, it does not work.
  • Part Number: PROCESSOR-SDK-AM437X

    Tool/software: Linux

    Dear Sir/Madam,

    I am using AM437x Starter Kit EVM as reference design for our product. I have added spi2 as following:

    spi2_pins: pinmux_spi2_pins {
    pinctrl-single,pins = <
    AM4372_IOPAD(0xa60, PIN_INPUT | MUX_MODE3) /* spi2_clk */
    AM4372_IOPAD(0xa64, PIN_OUTPUT | MUX_MODE3) /* spi2_d0 */
    AM4372_IOPAD(0xa68, PIN_INPUT | MUX_MODE3) /* spi2_d1 */
    AM4372_IOPAD(0xa6c, PIN_OUTPUT | MUX_MODE3) /* spi2_cs0 */
    >;
    };

    &spi2 {
    pinctrl-0 = <&spi2_pins>;
    status = "okay";

    spidev@2 {
    compatible = "ti, tianma";
    spi-max-frequency = <24000000>;
    reg = <0>;
        };
    };

    when I try to use spidev_test to test the spi driver, I got 

    can't open device: No such file or directory
    Aborted (core dumped)

    What I did wrong. What would be the parameters for spidev_test if my device configuration tree is correct. (I have tried several options but got same results).

    Thanks

  • Hello Zhiwei,

    You need to use "rohm,dh2228fv" compatible string instead of "ti, tianma" to create a the spidev node on your board.

    Best regards,
    Kemal
  • Part Number: PROCESSOR-SDK-AM437X

    Tool/software: Linux

    OK, here is all my changes. But I still don't see spi device in /dev.

    aliases {
    i2c0 = &i2c0;
    i2c1 = &i2c1;
    i2c2 = &i2c2;
    serial0 = &uart0;
    serial1 = &uart1;
    serial2 = &uart2;
    serial3 = &uart3;
    serial4 = &uart4;
    serial5 = &uart5;
    ethernet0 = &cpsw_emac0;
    ethernet1 = &cpsw_emac1;
    spi0 = &qspi;
    spi2 = &spi2;
    };

    spi2_pins: pinmux_spi2_pins {
    pinctrl-single,pins = <
    AM4372_IOPAD(0xa60, PIN_INPUT | MUX_MODE3) /* spi2_clk */
    AM4372_IOPAD(0xa64, PIN_OUTPUT | MUX_MODE3) /* spi2_d0 */
    AM4372_IOPAD(0xa68, PIN_INPUT | MUX_MODE3) /* spi2_d1 */
    AM4372_IOPAD(0xa6c, PIN_OUTPUT | MUX_MODE3) /* spi2_cs0 */
    >;
    };

    &spi2 {
    pinctrl-0 = <&spi2_pins>;
    status = "okay";

    spidev@0 {
    compatible = "rohm, dh228fv";
    spi-max-frequency = <24000000>;
    reg = <0>;
    };
    };

    And tisdk_am437x_evm_defconfig changes:

    #
    # SPI Master Controller Drivers
    #
    CONFIG_SPI=y
    # CONFIG_SPI_DEBUG is not set
    CONFIG_SPI_MASTER=y
    # CONFIG_SPI_ALTERA is not set
    # CONFIG_SPI_AXI_SPI_ENGINE is not set
    CONFIG_SPI_BITBANG=m
    # CONFIG_SPI_CADENCE is not set
    # CONFIG_SPI_DESIGNWARE is not set
    CONFIG_SPI_GPIO=m
    # CONFIG_SPI_FSL_SPI is not set
    # CONFIG_SPI_OC_TINY is not set
    CONFIG_SPI_OMAP24XX=y
    CONFIG_SPI_TI_QSPI=y
    # CONFIG_SPI_PXA2XX is not set
    # CONFIG_SPI_PXA2XX_PCI is not set
    # CONFIG_SPI_ROCKCHIP is not set
    # CONFIG_SPI_SC18IS602 is not set
    # CONFIG_SPI_XCOMM is not set
    # CONFIG_SPI_XILINX is not set
    # CONFIG_SPI_ZYNQMP_GQSPI is not set

    #
    # SPI Protocol Masters
    #
    CONFIG_SPI_SPIDEV=y
    CONFIG_SPI_LOOPBACK_TEST=y
    # CONFIG_SPI_TLE62X0 is not set
    CONFIG_SPMI=y
    # CONFIG_HSI is not set

    Where did I do wrong or what I missed?

    Thanks.

  • You have added one extra space and skipped the one 2 digit in the driver compatible string.