i.MX6 NAND boot

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

i.MX6 NAND boot

5,097 Views
VinodChaudhary
Contributor I

Hi,

We are using L3.0.15 BSP of i.MX6 and our goal is to boot u-boot from NAND flash in our custom board.

As per data sheet we need to write FCB in first block of nand to boot from NAND.

I have checked the u-boot code and not sure how to create u-boot image with FCB data. Also how to generate the FCB data for i.MX6. 

Please suggest.

Regards,

Vinod

0 Kudos
6 Replies

1,548 Views
ThiloJeremias
Contributor I

My working approach was:

Boot the board using the mfg tool via USB.

This requires a working linux kernel, so you would need to make the kernel recognizing your nand.

This kernel is then able to run the kobs-ng. This tools reads the bad sector table from the nand and patches "u-boot.bin" (the one with the standard sd-card headers) with the correct nand headers. 

It also immediatly writes the u-boot to a proper nand-location.

The tool also has a help page for the options.

Currently I have not come across a working tool that creates this header (except the binary kobs-ng). The imximage in u-boot was (at least in 2011.12) broken.

The other issue I see, is that the bad-block information needs to come from the nand itself, so the first boot cannot come from the nand but only from other sources.

One catch: there is/was a kobs-ng that does not support 8k pages nand flash.

0 Kudos

1,548 Views
rp123
Contributor II

If I dont have a working kernel but am able to start uboot by means of the MFG tool, is there a way to have the card boot from NAND without the kobs-ng tool?

0 Kudos

1,548 Views
jamesulrich
Contributor I

I am looking at the mx28 mxsboot.c and have modified it to produce the structures for the imx6. It is not documented in the mx6 manual whether the 32-bit quantities in the FCB and DBBT data are supposed to be little or big endian. Are the "FCB " and "DBBT" supposed to be string (no-endian)? The imx6 manual says the FCB should be "0x4E434220", if using little endian native then the signature in the NAND would be " BCF". The mxsboot.c also has confusion about the version number for FCB, 0x01000000 in the source file, yet the manual says that the 32-bit data should be 0x00000001?. Does anyone have a dump of the first 512 bytes of data from properly configured NAND that I could look at (this would answer questions very quickly)?

0 Kudos

1,548 Views
DirkBehme
Contributor III

What I understood is that the kobs-ng tool will create/write the correct FCB and DBBT information.

You have to write the (empty) NAND with the kobs-ng tool. I.e. you have to boot Linux to use the tool. If your NAND is empty, boot the system with the manufacturing tool and then write the NAND with the manufacturing tool.

0 Kudos

1,548 Views
VinodChaudhary
Contributor I

Hi Dirk,

 

Thanks for your reply, future question i will post on i.MX 6 Series Processors group. Just for your information i am replying here.

 

As per i.MX6 datasheet section 7.5.2.2 "NAND Flash Boot Flow and Boot Control Blocks (BCB)", ROM bootloader read the FCB and DBBT information from NAND.

The link you provided is u-boot implementation as described section 7.6 "Program Image" of datasheet.

Also the BSP provide the tool call kobs-ng which can be used from running linux on board, But im my case i want to first bring up u-boot from NAND then linux kernel.

I am not sure how to generate the FCB and DBBT information to meet the requirement of section 7.5.2.2 and append to u-boot.

 

Please suggest whether my understandig from datasheet is correct or not.

 

Regards,

Vinod


 
Dirk Behme said:

First of all, we now have a i.MX 6 Series Processors group. Maybe you like to join it for i.MX6 related questions.

Regarding your question: I'm not sure if the i.MX6 NAND FCB is different to the one used for NOR or SD boot (besides the offset). At least for NOR or SD, the U-Boot from Freescale's BSP creates the necessary header by default in front of the U-Boot image. Have a look to

http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/board/...

http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/includ...

So I would check the manual if the NAND uses an other format than the NOR or SD, adapt the CONFIG_FLASH_HEADER_OFFSET if necessary and try to write the resulting image to the NAND.

People might correct me if this is wrong ;)

0 Kudos

1,548 Views
DirkBehme
Contributor III

First of all, we now have a i.MX 6 Series Processors group. Maybe you like to join it for i.MX6 related questions.

Regarding your question: I'm not sure if the i.MX6 NAND FCB is different to the one used for NOR or SD boot (besides the offset). At least for NOR or SD, the U-Boot from Freescale's BSP creates the necessary header by default in front of the U-Boot image. Have a look to

http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/board/...

http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/includ...

So I would check the manual if the NAND uses an other format than the NOR or SD, adapt the CONFIG_FLASH_HEADER_OFFSET if necessary and try to write the resulting image to the NAND.

People might correct me if this is wrong ;)

0 Kudos