[U-Boot] start address loading initrd in ram on arm

Tom Rini trini at ti.com
Thu Feb 27 18:08:00 CET 2014


On Thu, Feb 27, 2014 at 05:49:47PM +0100, Joren Bultheel wrote:
> Thank you!
> 
> So in my situation; after loading the kernel in ram, I know where to load
> my initrd image:
> 
> U-Boot > printenv boot_dev
> 
> boot_dev=mmc dev 2; ext2load mmc 2:1 0x10800000 /boot/uImage
> 
> 
> U-Boot > run boot_dev
> 
> mmc2(part 0) is current device
> 
> Loading file "/boot/uImage" from mmc device 2:1 (xxc1)
> 
> 4284096 bytes read
> 
> 
> U-Boot > bdi
> 
> arch_number = 0x00001194
> 
> env_t       = 0x00000000
> 
> boot_params = 0x10000100
> 
> DRAM bank   = 0x00000000
> 
> -> start    = 0x10000000
> 
> -> size     = 0x80000000
> 
> 
> This means that I can only use the address range between 0x10000000 and
> 0x80000000
> Since the kernel is loaded at address 0x10800000 with size 4284096 bytes
> (415ec0 in hex), I can start loading my initrd at address (0x10800000 +
> 415ec0 = ) 0x10c15ec0
> 
> The initrd size = 27237386 bytes but this does not matter here, I give this
> size as a kernel argument.
> 
> I tested this and it works fine on my ARM machine.

Please note that while this may work, it's cutting it relatively close.
The zImage when run will decompress the kernel to near 0x10000000 and
you've not given yourself all that much room for the BSS and so forth
and may run into problems with slightly larger kernels.  For saftey,
since you have so much DDR you may wish to place the initrd at more like
0x18800000 or simply 0x18000000 as the kernel should not be higher than
the first 128MB but the initrd can be.  Documentation/arm/Booting in the
kernel has more details about where things may and may not reside.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140227/e6215288/attachment.pgp>


More information about the U-Boot mailing list