AnsweredAssumed Answered

U-boot add spi problem

Question asked by jarvis jiang on Mar 1, 2017
Latest reply on Jan 23, 2018 by Anuradha Ranasinghe

I.MX6UL add spi device in u-boot use ECSPI3,

//#ifdef CONFIG_ST7789_SPI
static iomux_v3_cfg_t const spi3_st7789_init[] = {
    MX6_PAD_UART2_TX_DATA__ECSPI3_SS0 | MUX_PAD_CTRL

 

(SPI_PAD_CTRL),
    MX6_PAD_UART2_RX_DATA__ECSPI3_SCLK | MUX_PAD_CTRL

 

(SPI_PAD_CTRL),
    MX6_PAD_UART2_RTS_B__ECSPI3_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL),
    MX6_PAD_UART2_CTS_B__ECSPI3_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL),
};

 


void st7789_init_board(void)
{
    imx_iomux_v3_setup_multiple_pads(spi3_st7789_init, ARRAY_SIZE

 

(spi3_st7789_init));
    printf("imx_iomux_v3_setup_multiple_pads\r\n");

 

    enable_cspi_clock(1,2);

 

}

******************************************************************************************

and call the spi_xfer() int uboot/drivers/spi/mxs_spi.c
when I burn the image into target
the error is "spi_xchg_single: Timeout!"

 

I find this error in the spi_xchg_single,
so add some printf in the spi_xchg_single

 

printf("regs->rxdata =%x\n",(int)&regs->rxdata);
printf("regs->cfg =%x\n",(int)&regs->cfg);

 

 

burn it and the log is

 

regs->rxdata =2010000
regs->cfg =201000c

 

I check the processer pdf, find the resigter is right.

 

I detect the spi config pin by Oscilloscope, but do not have any wave form.

 

How can I solve the problem?

Outcomes