How to program the NOR flash of the LS2085 from U-Boot?

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

How to program the NOR flash of the LS2085 from U-Boot?

Jump to solution
2,653 Views
mkiradzhiyski
Contributor II

Hello everybody,

I am looking for a way to reprogram the NOR flash of the LS2085A-RDB from U-Boot. I'm particularly interested in updating the Management Complex firmware version from 7.0.3 to 8.0.2, because we are getting a version inconsistency error while booting the Linux kernel:

[0.280076] fsl_mc_bus 80c000000.fsl-mc: Freescale Management Complex Firmware version: 7.0.3
[0.280082] fsl_mc_bus 80c000000.fsl-mc: ERROR: MC firmware version not supported by driver (driver version: 8.0)

I'm assuming this causes the /dev/mc-restool device to not be created.

I found a suggestion for using CodeWarrior Flash Programmer to reprogram the NOR flash, but I'm wondering if this can be done from U-Boot.

Thanks!

Best regards,

Miroslav

Labels (1)
0 Kudos
Reply
1 Solution
2,154 Views
addiyi
NXP Employee
NXP Employee

Hi Miroslav,

Both CodeWarrior Flash Programmer and uboot can be used for programming MC firmware.

From uboot, you have to load the MC firmware into RAM (from a tftp server) and program it to NOR flash (bank 0) from address 0x5_8030_0000.

An example is provided below:

tftp a0000000 /path_from_tftp_server/mc_firmware.bin

erase 580300000 +$filesize

cp.b a0000000 580300000 $filesize

From Flash Programmer, take a look on Targeting Manual (CW_ARMv8\ARMv8\Help\PDF\), Chapter 7. Note that in Flash Programmer offset is used instead of full address.

Adrian

View solution in original post

0 Kudos
Reply
6 Replies
2,155 Views
addiyi
NXP Employee
NXP Employee

Hi Miroslav,

Both CodeWarrior Flash Programmer and uboot can be used for programming MC firmware.

From uboot, you have to load the MC firmware into RAM (from a tftp server) and program it to NOR flash (bank 0) from address 0x5_8030_0000.

An example is provided below:

tftp a0000000 /path_from_tftp_server/mc_firmware.bin

erase 580300000 +$filesize

cp.b a0000000 580300000 $filesize

From Flash Programmer, take a look on Targeting Manual (CW_ARMv8\ARMv8\Help\PDF\), Chapter 7. Note that in Flash Programmer offset is used instead of full address.

Adrian

0 Kudos
Reply
2,154 Views
mkiradzhiyski
Contributor II

Thank you, Adrian,

We managed to flash the firmware binary (it should be a FIT image)and also the DPL and DPC binaries, but we are currently facing another problem:

ERROR: Firmware major version mismatch (found: 8, expected: 7)

The U-Boot now complains about firmware version mismatch, which I guess is because everything else is up-to-date, except for the U-Boot.

We have the u-boot-nor-2015.07+fslgit-r0.bin binary. My question is where in the NOR flash should this be placed?

Thank you once again!

Best regards,
Miroslav

0 Kudos
Reply
2,154 Views
addiyi
NXP Employee
NXP Employee

Uboot must be programmed starting with 0x5_8010_0000.

Adrian

2,154 Views
mkiradzhiyski
Contributor II

Thank you, Adrian.

Now we are facing another problem. When trying to program the NOR with U-Boot, an error about writing to protected sectors appears. The size of the U-Boot we use is 570941 bytes.

Can you give us any hints on why this is happening or what we are doing wrong?
Thank you!

Best regards,

Miroslav

0 Kudos
Reply
2,154 Views
addiyi
NXP Employee
NXP Employee

Before programming new u-boot into the NOR, you have to unprotect the sectors where uboot is placed, using protect command, something like below:

=> protect off 0x580100000 <end_addr>

Adrian

2,154 Views
mkiradzhiyski
Contributor II

Thank you, Adrian!

We managed to reflash everything needed and boot the board. :smileyhappy:

Best regards,

Miroslav

0 Kudos
Reply