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: SPI hangs in reset in U-boot

Part Number: AM5728
Other Parts Discussed in Thread: SN65HVS882, SYSCONFIG, , TMDSEVM572X

I want to communicate with SPI devices in uboot, but SPI is dead-loop in spi_reset of the omap3_spi.c.
The MCSPI_SYSSTATUS register of SPI is always 0, indicating Internal module reset is ongoing.

My changes are as follows:

(1)dra7.dtsi:

    aliases {

                spi0 = &qspi;

++spi1 = &mcspi1;

++spi2 = &mcspi2;

++spi3 = &mcspi3;

++spi4 = &mcspi4;

    }

(2)am57xx-beagle-x15-common.dtsi add:

    &mcspi2 {

     status = "okay";

     ti,pindir-d0-out-d1-in;

     sn65hvs882: sn65hvs882@0 {

     compatible = "pisosr-gpio";

     gpio-controller;

     #gpio-cells = <2>;

     reg = <0>;

     spi-max-frequency = <1000000>;

     spi-cpol;

     };

    };

(3) u-boot-2018.01/board/ti/am57xx/mux_data.h

    const struct pad_conf_entry core_padconf_array_essential_x15[] = {

        {SPI2_SCLK, (M0 | PIN_INPUT_PULLDOWN)},

{SPI2_D1, (M0 | PIN_INPUT_PULLDOWN)},

{SPI2_D0, (M0 | PIN_INPUT_PULLDOWN)},

{SPI2_CS0, (M0 | PIN_OUTPUT_PULLUP)},

    }

After compiling, put the u-boot.img amd MLO into emmc and start it.

Execute the sspi 2:0 8 command under uboot.Will loop endlessly in spi_reset in omap3_spi.c.

The spi_reset function will reset the spi and query the state, but the state is always 0. In the manual, a state of 0 means that the reset is ongoing.

static void spi_reset(struct mcspi *regs)

{

unsigned int tmp;

writel(OMAP3_MCSPI_SYSCONFIG_SOFTRESET, &regs->sysconfig);

do {

tmp = readl(&regs->sysstatus);

} while (!(tmp & OMAP3_MCSPI_SYSSTATUS_RESETDONE));

writel(OMAP3_MCSPI_SYSCONFIG_AUTOIDLE |

       OMAP3_MCSPI_SYSCONFIG_ENAWAKEUP |

       OMAP3_MCSPI_SYSCONFIG_SMARTIDLE, &regs->sysconfig);

writel(OMAP3_MCSPI_WAKEUPENABLE_WKEN, &regs->wakeupenable);

}

I'd like to ask where the question might appear.

  • Hello,

    From what I understand, you are using AM572x custom board?

    Do you use AM57x PSDK Linux? If yes, which version?

    Do you make any changes in u-boot/drivers/spi/omap3_spi.c file?

    Can you provide full console log of u-boot loading and sspi command execution? You can put that log in txt file and attach this file here in this e2e thread.

    Regards,
    Pavel

  • Hello,

    I am using the am5728 development board.

    I didn't use AM57x PSDK Linux.

    I got ubot from  git://git.ti.com/ti-u-boot/ti-u-boot.git.

    I haven't made any changes to the omap3_spi.c .

    I also used a lower version of uboot,and it will have the same results.The spi hardware interface must be correct, because I can use it properly under the kernel.

    The log shows that there is no information output after executing the command, and I make sure it is looping in the function by printing.

    Regards,

    Feng.

    5125.log.txt
    Loading Environment from MMC... *** Warning - bad CRC, using default environment
    
    
    
    U-Boot 2019.10-rc2-00036-ga2ca54f-dirty (Aug 27 2019 - 17:01:45 +0800)
    
    CPU  : DRA752-GP ES2.0
    Model: TI AM5728 BeagleBoard-X15
    Board: UNKNOWN(BeagleBoard X15?) REV UNKNOWN
    DRAM:  2 GiB
    MMC:   omap_gpio_probe
    OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Loading Environment from FAT... omap_i2c_probe2
    *** Warning - bad CRC, using default environment
    
    Loading Environment from MMC... *** Warning - bad CRC, using default environment
    
    i2c_write: error waiting for data ACK (status=0x116)
    Warning: fastboot.board_rev: unknown board revision
    am57x_idk_lcd_detect: Failed to get I2C device 0/56 (ret 1)
    Net:   
    Warning: ethernet@48484000 using MAC address from ROM
    eth0: ethernet@48484000
    Hit any key to stop autoboot:  0 
    => 
    => 
    => sspi 2:0 8

  • user4669656 said:
    I am using the am5728 development board.

    Do you mean you are using AM572x TI EVM TMDSEVM572X ?

    user4669656 said:

    I didn't use AM57x PSDK Linux.

    I got ubot from  git://git.ti.com/ti-u-boot/ti-u-boot.git.

    Please use u-boot that comes with PSDK Linux or get this u-boot with below instructions:

    2.1.6.1. U-Boot

    The U-Boot git repository, branch and commit id can be found below:
    Based on verson: 2019.01
    URL: git.ti.com/processor-sdk/processor-sdk-u-boot.git
    Branch: processor-sdk-u-boot-2019.01
    Commit ID: 8b90adfb1630ed19959f89d39a5100573bca90fa
    Regards,
    Pavel