On Thu, Jul 21, 2011 at 6:23 AM, Marc Jones <marcj303(a)gmail.com> wrote:
>
> Why would you exclude romstage? What will setup the RAM? bootblock? i
> suspect that the stuff you are doing in bootblock should be done in
> romstage.
Yes. I setup the RAM in the bootblock.
1. It is much easier setting up RAM than that on X86. We can do it in
the bootblock.
2. We don't have romcc for ARM, so if we want to run the code written
in C and compiled by GCC, we should have a stack. I use the RAM as a
temp stack just as cache_as_ram.
3. If we boot from NAND Flash, most CPUs do like this:
It copies the first sector of Nand Flash to its internal SRAM and
passes control to it.
The internal SRAM is too small to hold the whole romfile, even the
bootblock+romstage. So we need to set up the RAM ASAP. U-boot does
like this,too.