AnsweredAssumed Answered

SPI FLASH BOOT

Question asked by James He on Jun 1, 2017
Latest reply on Oct 12, 2017 by Tasuku Watanabe

Dear all,

  I test the spi flash on ecspi1 in u-boot. i works with code below:

iomux_v3_cfg_t const ecspi1_pads[] = {
MX6_PAD_EIM_D16__ECSPI1_SCLK | MUX_PAD_CTRL(SPI_PAD_CTRL),
MX6_PAD_EIM_D17__ECSPI1_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL),
MX6_PAD_EIM_D18__ECSPI1_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL),
//MX6_PAD_EIM_D24__ECSPI1_SS2 | MUX_PAD_CTRL(SPI_PAD_CTRL),
MX6_PAD_EIM_D24__GPIO3_IO24 | MUX_PAD_CTRL(NO_PAD_CTRL),

}

it means SS2 is used as gpio but not as ss2.

if i use 

MX6_PAD_EIM_D24__ECSPI1_SS2 | MUX_PAD_CTRL(SPI_PAD_CTRL),
//MX6_PAD_EIM_D24__GPIO3_IO24 | MUX_PAD_CTRL(NO_PAD_CTRL),

sf probe always get manfuacture id as 0x00

Flashs require the ECSPI1_SS2 stays always 0 during the access period, the below if from the datasheet of m25p32:

"The READ IDENTIFICATION command is terminated by driving S# HIGH at any time
during data output. When S# is driven HIGH, the device is put in the STANDBY POWER
mode and waits to be selected so that it can receive, decode, and execute commands."

But when i use code MX6_PAD_EIM_D24__ECSPI1_SS2 | MUX_PAD_CTRL(SPI_PAD_CTRL),

ECSPI1_SS2 goes low 8 clocks to drive command and goes high about serveral clocks and goes low again to read data back. it's not fit for the timing requirement of FLASH.

 

After boot, we can change the code for SPI Flash to read/write. Now the questiong coming:

while boot from spi flash, the imx6qp chip should act as the default ecspi controller, it means it can not fetch right code to memory from spi flash. how can it boot from spi flash?  is there some special configuration on the ecspi port while booting? 

thanks.

Outcomes