AT91Bootstrap flashing from u-boot

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

jcarrillo
Posts: 11
Joined: Thu Jun 19, 2014 9:37 am

AT91Bootstrap flashing from u-boot

Thu Oct 09, 2014 7:04 pm

Hi all,

Does anyone know how to write in NAND Flash the at91bootstrap image from u-boot?

In SAM-BA, the TCL command used for the most of the images is

Code: Select all

send_file {NandFlash} <FILE> <ADDRESS> 0 
which flashes the file "as is".

On the other hand, the comand used for at91bootstrap is

Code: Select all

NANDFLASH::SendBootFilePmeccCmd <BOOTSTRAP_FILE>
I don't know the specific processing this comand performs (I guess adds redundancy and so on).

Thank you for your time.
blue_z
Location: USA
Posts: 1704
Joined: Thu Apr 19, 2007 10:15 pm

Re: AT91Bootstrap flashing from u-boot

Fri Oct 10, 2014 1:10 am

jcarrillo wrote:Does anyone know how to write in NAND Flash the at91bootstrap image from u-boot?
Well I've done it. Does that count?
jcarrillo wrote:On the other hand, the comand used for at91bootstrap is

Code: Select all

NANDFLASH::SendBootFilePmeccCmd <BOOTSTRAP_FILE>
I don't know the specific processing this comand performs (I guess adds redundancy and so on).
IIRC there's no "redundancy" as you speculate, but simply a hack to ensure that the byte length of the image is installed in word 6 of the ARM exception vector.
Some versions of AT91Bootstrap correctly build with the length in the image, whereas there are also versions that leave a branch instruction in word 6.
Refer to the "Boot Strategies" section of your SoC datasheet for details.

Regards
blue_z
Location: USA
Posts: 1704
Joined: Thu Apr 19, 2007 10:15 pm

Re: AT91Bootstrap flashing from u-boot

Mon Feb 08, 2016 9:52 pm

If your SoC has a NAND Flash Controller and PMECC, then the recommended setup for NAND booting is to provide the NAND Flash parameters and ECC requirements by a specific header written at the beginning of the first page of the NAND Flash.
The AT91Bootstrap image would immediately follow this header (at offset +0xD0).

This header of NAND and PMECC parameters is simply 208 (0xD0) bytes consisting of a 32-bit word repeated 52 times.
Refer to the SoC datasheet for the encoding of the parameters.
For the following Atmel boards the word values are:

Code: Select all

AT91SAM9x5-EK      0xC0C00405
AT91SAM9N12-EK     0xC0C00405
SAMA5D2-XULT       0xC???????
SAMA5D3x-EK        0xC0902405
SAMA5D3-XPLD       0xC0902405
SAMA5D4-EK         0xC1E04E07
SAMA5D4-XULT       0xC1E04E07
These values are board specific (i.e. the pairing of SoC and NAND), rather than SoC specific.
If your board uses a different NAND chip than the Atmel board, then the NAND header value may well be different.

The following U-Boot commands would build/install the NAND header and AT91Bootstrap image in the NAND flash of a SAMA5D4-XULT:

Code: Select all

U-Boot> mw.b 20000000 ff 40000
U-Boot> mw.l 20000000 c1e04e07 34
U-Boot> tftpboot 200000d0 boot.bin
U-Boot> nand erase 0 40000
U-Boot> nand write 20000000 0 40000
Regards
klavrov
Posts: 1
Joined: Tue Jun 07, 2016 1:15 pm

Re: AT91Bootstrap flashing from u-boot

Tue Aug 09, 2016 3:36 pm

blue_z wrote:
For the following Atmel boards the word values are:

Code: Select all

AT91SAM9x5-EK      0xC0C00405
AT91SAM9N12-EK     0xC0C00405
SAMA5D2-XULT       0xC???????
SAMA5D3x-EK        0xC0902405
SAMA5D3-XPLD       0xC0902405
SAMA5D4-EK         0xC1E04E07
SAMA5D4-XULT       0xC1E04E07
To fill Q-marks:

Code: Select all

SAMA5D2-XULT     0xC0098DA5

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 2 guests