AnsweredAssumed Answered

problem with sspi command in Uboot

Question asked by yongfeng zhang on Aug 28, 2017
Latest reply on Aug 30, 2017 by yongfeng zhang

Hi all,

 

I am recently working on spi driver for ECSPI1 in Uboot. I have brought up the command interface by adding a macro "CONFIG_CMD_SPI" in my config file "imx6qdl-sabreauto.dtsi". I looped back MISO and MOSI for ECSPI1. When I issued the command like "sspi 0:0.0 8 8" , I am always receiving "00". I added following in my board config file:

 

#ifdef CONFIG_MXC_SPI
iomux_v3_cfg_t const ecspi1_pads[] = {
MX6_PAD_EIM_D18__ECSPI1_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL),
MX6_PAD_EIM_D17__ECSPI1_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL),
MX6_PAD_EIM_D16__ECSPI1_SCLK | MUX_PAD_CTRL(SPI_PAD_CTRL),
MX6_PAD_EIM_EB2__GPIO2_IO30 | MUX_PAD_CTRL(NO_PAD_CTRL),
};

void setup_spi(void)
{
imx_iomux_v3_setup_multiple_pads(ecspi1_pads,
ARRAY_SIZE(ecspi1_pads));
gpio_direction_output(IMX_GPIO_NR(2, 30), 0);
}
#endif

 

and I called "setup_spi" in "board_early_init_f". What did I missed? Any help?

 

 

Thanks

yong

Outcomes