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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
2,651 次查看
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

标签 (1)
标记 (3)
0 项奖励
回复
1 解答
2,152 次查看
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 项奖励
回复
6 回复数
2,153 次查看
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 项奖励
回复
2,152 次查看
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 项奖励
回复
2,152 次查看
addiyi
NXP Employee
NXP Employee

Uboot must be programmed starting with 0x5_8010_0000.

Adrian

2,152 次查看
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 项奖励
回复
2,152 次查看
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,152 次查看
mkiradzhiyski
Contributor II

Thank you, Adrian!

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

Best regards,

Miroslav

0 项奖励
回复