SPI FLASH BOOT

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPI FLASH BOOT

1,244 Views
jameshe1
Contributor II

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.

Labels (2)
0 Kudos
Reply
4 Replies

1,026 Views
igorpadykov
NXP Employee
NXP Employee

Hi James

for ss2 usage without toggling it is necessary to configure ECSPIx_CONREG[BURST_LENGTH]

parameter according to spi-nor requirements. Usage gpio is more convenient as it does not require

this tweakung. One can look at spi nor uboot driver in uboot/drivers/mtd/spi folder and add

configuration in setup_spi() in uboot/board/freescale/mx6sabresd/mx6sabresd.c

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,026 Views
jameshe1
Contributor II

Hello igor,

  yes, it works well in uboot, but while booting from spi flash, nothing (all codes are located in spi flash) can be done before the cpu fetch the codes correctly from the spi flash. at this time, all registers of cpu are not configurated. is it(ecspi1_ss2)  work well also?

0 Kudos
Reply

1,026 Views
tasukuwatanabe
Contributor I

Hi James.


Currently I am having similar problem.

Could you tell me what happened after that?

Best regard,
Tasuku.

0 Kudos
Reply

1,026 Views
igorpadykov
NXP Employee
NXP Employee

Hello James

please configure ECSPIx_CONREG[BURST_LENGTH]

parameter according to spi-nor datasheet.

0 Kudos
Reply