Hi Lionel,

Let me add one more thing.

On 09/04/14 10:35, Greg Ungerer wrote:
> On 08/04/14 21:16, Lionel Ains wrote:
>> It seems you got a working procedure for running a U-Boot RAM image sent via
>> JTAG. I could find your script in the oocd sources (under
>> http://sourceforge.net/p/openocd/code/ci/v0.8.0-rc1/tree/tcl/target/armada370.cfg).
>> But can you please also provide the other scripts and procedure to upload
>> U-Boot to RAM and start it using openocd?
> 
> Sure, but it is not pretty :-(
> 
> This method relies on using the u-boot code as supplied by Marvell (I am
> currently using the 2009.08-a370-2012_Q4.0 release from them). There is
> no mainline u-boot support for the Armada 370 family yet.
> 
> Here is the core of what I use:
> 
>   proc cpu_start_state {} {
>       # ARM state, supervisor mode, irq and fiq disable
>       reg cpsr 0x000000d3
>       # MMU off, cache off
>       arm mcr 15 0 1 0 0 0x78
>   }
> 
>   source [find tools/openocd/platforms/armada/armada370.tcl]
> 
>   proc meminit {} {
>       cpu_start_state
>       load_image 
> u-boot-2009.08-a370-2012_Q4.0/tools/bin_hdr_armada_370/bin_hdr.elf
>       reg pc 0x40004030
>       resume
>   }
> 
>   proc loaduboot {} {
>       # HACK, get mmu enabled again, to allow running load_image
>       halt
>       reg cpsr 0x200001f3
>       arm mcr 15 0 1 0 0 0x00c5307d
>       reg pc 0xffff77fe
>       step
>       cpu_start_state
>       # HACK - end
> 
>       load_image u-boot-2009.08-a370-2012_Q4.0/u-boot
>       reg pc 0x600000
>       #resume
>   }
> 
> 
> To load and run u-boot I will start up openocd and then run the following
> commands:
> 
>   halt
>   meminit
>   loaduboot
> 
> I doesn't really feel totally right to me. The mmu on and off states
> are a pain to deal with (thus the HACK section above which relies on
> running the CPU BOOTrom code again). But none the less this manages
> to load and run u-boot for me.
> 
> Note also that I have had to work around the issue I raised in
> https://www.mail-archive.com/[email protected]/msg04454.html
> I just locally hacked src/target/cortex_a.c to ignore this, until
> I can figure out a more correct fix.

Also I should point out that this is the process I use on boards with
completely empty flash. If the board already has a boot loader installed
then I generally don't do the "meminit" call, only the "loaduboot".
Re-running the meminit seems very problematic, and you don't need to
if it has already be run by flash installed boot code.

Regards
Greg



------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to