How to un-protect complete NOR flash in P2041RDB U-Boot

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

How to un-protect complete NOR flash in P2041RDB U-Boot

Jump to solution
1,229 Views
veerendranathj
Contributor III

Hi,

After booting with u-boot I want replace U-boot binary in NOR flash(EFF80000-EFFFFFFF) with my boot loader and reset the board to boot with my binary but I couldn't do due to NOR flash protection mechanism.

my requirement is like below...

1) boot the board using u-boot

2) replace u-boot with my binary in NOR flash

3) enter "reset" in u-boot console

4) Now when the board boots my binary will be mapped to bootspace...so board should boot with my binary.

Regards,

Veerendranath

0 Kudos
1 Solution
1,033 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Veerendranath,

You could use the following command to write your binary onto NOR Flash under u-boot.

=>tftp 1000000 <your_image>

=>protect off  0xeff80000 +$filesize

=>erase 0xeff80000 +$filesize

=>cp.b 1000000 0xeff80000 $filesize

=>protect on 0xeff80000 +$filesize

In addition, in PowerPC architecture, when each core comes out of reset, its MMU has one 4 KB default page defined at 0xFFFF_Fnnn. Each core begins execution with the instruction at effective address 0xFFFF_FFFC. When boot from NOR Flash, this 4K boot page is mapped at the end of NOR Flash through hardware. So, in your binary file, please make sure that reset vector address is allocated at offset 0x7ff_fffc of the NOR Flash.


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
1,034 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Veerendranath,

You could use the following command to write your binary onto NOR Flash under u-boot.

=>tftp 1000000 <your_image>

=>protect off  0xeff80000 +$filesize

=>erase 0xeff80000 +$filesize

=>cp.b 1000000 0xeff80000 $filesize

=>protect on 0xeff80000 +$filesize

In addition, in PowerPC architecture, when each core comes out of reset, its MMU has one 4 KB default page defined at 0xFFFF_Fnnn. Each core begins execution with the instruction at effective address 0xFFFF_FFFC. When boot from NOR Flash, this 4K boot page is mapped at the end of NOR Flash through hardware. So, in your binary file, please make sure that reset vector address is allocated at offset 0x7ff_fffc of the NOR Flash.


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,033 Views
veerendranathj
Contributor III

Thank you very much working perfectly... :smileyhappy:

Here I am replacing u-boot(from u-boot console) with my binary and rebooting the board... so If I want u-boot again I have to use debugger/flash programmer again...

Instead of that if I put my binary somewhere in RAM or NOR flash(Not touching u-boot related memory) and used "go" command to give control to my binary but It's giving "machine recheck" exception while I am redefining LAWs...how to resolve the issue?

Thanks,

Veerendranath

0 Kudos
1,033 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Veerendranath,

If you just want to test your bootloader, I suggest you program your binary at the alternate bank of the NOR Flash, and keep u-boot in the current bank.

The address map under u-boot

0xebf40000 0xebffffff U-Boot (alternate bank)

0xec000000 0xec01ffff Rcw (alternate bank)

After flashing image to the alternate bank under u-boot, please use the following command to reset and change to the alternate bank.

=>cpld reset altbank


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos