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.

DRA821U: SPI drive in uboot

Part Number: DRA821U
Other Parts Discussed in Thread: DRA821, TDA4VM

Champs,

Customer needs to configure and operate mcu_spi0 and main_spi0 interfaces from uboot. Looking through the codebase it appears that while the driver exists there are no example DT entries. Are there any relevant examples that could be used as a reference? 

Your guidance will be greatly appreciated

Thank you

Michael

  • after some search I found the following mcspi entries:

    main_spi0 in k3-am64-main.dtsi

    mcu_spi1 in k3-am64-mcu.dtsi

    To my understanding these should apply to DRA821, but I will appreciate your confirmation

    best regards,

    Michael

  • HI. Keerthy

    tda4vm  ti-processor-sdk-linux-j7-evm-07_ 03_ 00_ 05

    Does the linux driver support McSPI4 as slave mode?

  • Hi,

    Yes it does. I have it functional on the 8.1 SDK. Few DT nodes to be added and couple of configs to be enabled.

    spi-slave-j721e.zip

    I have got this functional on the latest 8.1 SDK. 2 patches need to be applied on Linux directory.

    Two configs need to be enabled in arch/arm64/configs/tisdk_j7-evm_defconfig

    Change #CONFIG_SPI_SPIDEV is not set ---> CONFIG_SPI_SPIDEV=y

    Change #CONFIG_SPI_SLAVE is not set ---> CONFIG_SPI_SLAVE=y

    With the above we have MCU_MCSPI2 as master & MAIN_MCSPI4 as slave.

    The Linux kernel provides spidev_test tool. We need just build & use that. Follow the instructions here:

    cd ti-processor-sdk-linux-automotive-j7-evm-*/board-support/linux-*/tools/spi
    make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu-
    cp spidev_test /media/$user/rootfs/home/root


    Testing example:

    root@j7-evm:~# echo spidev > /sys/class/spi_slave/spi3/slave
    root@j7-evm:~# /spidev_test -v -D /dev/spidev3.0 -p slave-hello-to-master &
    [1] 1565
    spi mode: 0x0
    bits per word: 8
    max speed: 500000 Hz (500 kHz)
    root@j7-evm:~# /spidev_test -v -D /dev/spidev0.0 -p master-hello-to-slave
    spi mode: 0x0
    bits per word: 8
    max speed: 500000 Hz (500 kHz)
    TX | 6D 61 73 74 65 72 2D 68 65 6C 6C 6F 2D 74 6F 2D 73 6C 61 76 65 __ __ __ __ __ __ __ __ __ __ __ |master-hello-to-slave|
    TX | 73 6C 61 76 65 2D 68 65 6C 6C 6F 2D 74 6F 2D 6D 61 73 74 65 72 __ __ __ __ __ __ __ __ __ __ __ |slave-hello-to-master|
    RX | 73 6C 61 76 65 2D 68 65 6C 6C 6F 2D 74 6F 2D 6D 61 73 74 65 72 __ __ __ __ __ __ __ __ __ __ __ |slave-hello-to-master|
    RX | 6D 61 73 74 65 72 2D 68 65 6C 6C 6F 2D 74 6F 2D 73 6C 61 76 65 __ __ __ __ __ __ __ __ __ __ __ |master-hello-to-slave|
    [1]+ Done /spidev_test -v -D /dev/spidev3.0 -p slave-hello-to-master

    Closing this thread.

    Best Regards,
    Keerthy