imx6q-sdb boot from SPI-flash

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

imx6q-sdb boot from SPI-flash

3,387 Views
carmilili
Contributor III

I want to set imx6q-sdb board boot from spi flash.

I weld a chip on another board and connect it to SPI3(imx6q's pin:DISP0_DAT0, DISP0_DAT1,DISP0_DAT2,DISP0_DAT3(spi:ss0)) .

And then modify linux kernel driver.When CPU boot up form eMMC,SPI-flash work well.I also can burn u-boot image to SPI-flash successfully.

But now CPU can not boot from SPI-flash.

BT_CFG1=8'b0011_0000  (SW6=8'b0011_0000)

BT_CFG4=8'b0000_1010

I do not modify the board anything.

I find four pin(EIM_LBA:BT_CFG4_2  EIM_EB0:BT_CFG4_3  EIM_EB1:BT_CFG4_4  EIM_RW:BT_CFG4_5) hold on high level when power up and CPU do not boot up.Does it normal?

What do I need to do for booting form SPI3.

Thank you.

Labels (2)
0 Kudos
12 Replies

1,691 Views
Yuri
NXP Employee
NXP Employee

According to  Table 7 (Known Issues and Workarounds) of "i.MX_6Dual6Quad_Sabre-SD_Linux_Release_Notes.pdf" :

"SPI NOR boot is not supported by Smart Device Board.Current SD board uses KEY relative PINs as SPI interface.

However, this set of PINs are not supported by ROM. Therefore, SPI NOR boot is not supported by Smart Device Board."

In general one can test it on Sabre-AI, where it is supported.

Please use the AI documentation for more details.

Also please take a look at the next discussion.

https://community.freescale.com/message/347573#347573

0 Kudos

1,691 Views
carmilili
Contributor III

Thank you for your reply.

Please look carefully what I have said.

I know Smart Device Board do not have spi-flash.And I also understand why KEY PINS are not for booting.

I weld a spi-flash chip on another board and connect it to SPI3(imx6q's pin:DISP0_DAT0, DISP0_DAT1,DISP0_DAT2,DISP0_DAT3(spi:ss0)).

I think you do not need to care which board be used.

0 Kudos

1,691 Views
EdSutter
Senior Contributor II

Looks to me like you have it hooked up properly (especially since you said you can access it from linux).

The one gotcha that I had in my case (using ECSPI5) was that I had to remove a connection to the accelerometer because it was using the pin in a different muxed mode.  After doing that my boot-off-spi on the SabreSDB board worked just fine.  It is true that the default board does not support this; however, as you have stated, you hooked up your own device.

Anyway, it appears that there are no conflicting devices on these pins, so you're good-to-go there (assuming you don't have an LCD plugged in of course).

So, the only thing I can think of is that your data is not formatted correctly on the SPI-NOR device.

What image are you putting on there and how are you doing it?

Two possibilities come to mind...

1. Does your image have the 1024-byte offset at the base?

2. If you're burning the image with linux are you sure it is a "raw" burn?

For #1, try this...

1.create a 1024-byte file of zeroes called "prefix" (or whatever)

2. prepend that file to the u-boot.imx file... cat prefix u-boot.imx > u-boot_with_prefix.imx

3. burn that to your SPI flash.

4. try to boot.

For #2, try this...

Use uboot's 'sf' command to read the data out of SPI flash to memory, then use the 'tftpput'

command (you may have to run menuconfig in uboot to pull this in) to upload it to your host.

Then compare it to your original file.  If these files don't match, the use uboot's 'sf' command

to burn the image into spi.

Hope this helps,

Ed

1,691 Views
carmilili
Contributor III

Thank you for your reply.

I will have a try now.

I think you reply will be useful.

0 Kudos

1,691 Views
EdSutter
Senior Contributor II

Just a bit more information...

If it would help, I could send you an image I've used.

At u-boot, you would do something similar to this...

# First download the image to your board:

U-Boot > tftpboot uboot.spi

# Note the size of the transfer and figure out the next higher mod 0x1000 value (this will be used as the SIZE in the sf command later)

# Now set up the spi flash device you want to connect to (4:0x1100 is for my ECSPI5-based connection, so you'll have to change

# it to match your interface)

U-Boot > sf probe 4:0x1100

# Then just run sf update...

U-Boot > sf update ${loadaddr} SIZE

1,691 Views
carmilili
Contributor III

When boot up from SPI-NOR flash,I use the command of "sf".

MX6Q SABRESD U-Boot > sf probe 2:0

Error: re-tried 100 times without response. Give up

Failed to initialize SPI flash at 2:0

I have modified two function spi_get_cfg() and spi_io_init().

But it does not work well.The u-boot version is uboot-2009.08.

0 Kudos

1,691 Views
EdSutter
Senior Contributor II

First, what version of uboot are you using?

I'm working with u-boot-2013.10.

Double check your "2:0" setting in your sf probe command.

You may need a few other bits to be set there.  Try 2:0x1100.

At the moment I don't remember what these were in detail, but I do recall they

were important to be set correctly.

0 Kudos

1,691 Views
carmilili
Contributor III

The u-boot version is uboot-2009.08

I think the reasion may be the bad SPI driver.

There is no clk on the SPI pin when I use the "sf" command.

I will try again tomorrow.

0 Kudos

1,691 Views
caoping
Contributor II

hi, i meet the same problem like you ,have you fixed the problem?,now accordding to the "i.MX_6Dual6Quad_BSP_Porting_Guide.pdf",it can recognize SPI in linux as mtdblock0,mtdblock1,but can recognize it in uboot,could you give me some advice?thank you!

0 Kudos

1,691 Views
EdSutter
Senior Contributor II

Not sure what problem you're referring to..

I wanted to boot uboot from SPI, so I populated the "other" SPI device footprint on the iMX6SDB and raised the conflicting pins on the accelerometer.

I had/have no need to access the SPI from linux, so I haven't tried that.

0 Kudos

1,690 Views
EdSutter
Senior Contributor II

Hmmmm...

Keep in mind that my comments are based on the newer version of u-boot;

and IIRC, the spi-flash code changed quite a bit between versions.

One snag that I ran into was that I had configured (PINMUX) the SPI controller

to use the ECSPI to control the SS line; but the code was written based on the SS line

being a GPIO pin.

Don't know how you initialized your pinmux, but be aware of that.

0 Kudos

1,691 Views
carmilili
Contributor III

Thank you for your idea.

I find have some problem with my linux kernel.When I modify it,and now it can boot up from SPI-NOR flash.

But there are also have some problem with u-boot.Accoring to the UART,it tell me MMC init failed.

So CPU can not load kernel and mount file system.

You can get some information from below detail.

Board: i.MX6Q-SABRESD: unknown-board Board: 0x63012 [POR ]

Boot Device: SPI NOR

I2C:   ready

DRAM:   1 GB

MMC:   FSL_USDHC: 0,FSL_USDHC: 1,FSL_USDHC: 2,FSL_USDHC: 3

Card did not respond to voltage select!

MMC init failed

In:    serial

Out:   serial

Err:   serial

Found PFUZE100! deviceid=10,revid=11

Net:   got MAC address from IIM: 00:04:9f:02:b1:af

FEC0

MX6Q SABRESD U-Boot > print

stdin=serial

stdout=serial

stderr=serial

ethact=FEC0

Environment size: 53/8188 bytes

I think I need to modify u-boot code.

Can you give some suggest for modifying the code of u-boot?

Thank you for your time.

0 Kudos