All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] start address loading initrd in ram on arm
@ 2014-02-27 10:50 Joren Bultheel
  2014-02-27 14:30 ` Tom Rini
  0 siblings, 1 reply; 5+ messages in thread
From: Joren Bultheel @ 2014-02-27 10:50 UTC (permalink / raw)
  To: u-boot

Which address should I give when loading an initrd into ram using U-boot on
an arm-based architecture?
How can I find out?

I have found many google hits where people are loading initrd files in ram
but they use always another target ram address.
It is never explained why they use 0x70000000 or 0x01200000 or ...

In my case 0x70000000 does work finally, but I can not figure out why
0x40000000 did not.

-- 
Joren Bultheel
Software Engineer

eSATURNUS
T. +32 16 40 12 82
www.esaturnus.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] start address loading initrd in ram on arm
  2014-02-27 10:50 [U-Boot] start address loading initrd in ram on arm Joren Bultheel
@ 2014-02-27 14:30 ` Tom Rini
  2014-02-27 16:49   ` Joren Bultheel
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Rini @ 2014-02-27 14:30 UTC (permalink / raw)
  To: u-boot

On Thu, Feb 27, 2014 at 11:50:33AM +0100, Joren Bultheel wrote:

> Which address should I give when loading an initrd into ram using U-boot on
> an arm-based architecture?
> How can I find out?
> 
> I have found many google hits where people are loading initrd files in ram
> but they use always another target ram address.
> It is never explained why they use 0x70000000 or 0x01200000 or ...
> 
> In my case 0x70000000 does work finally, but I can not figure out why
> 0x40000000 did not.

Well, it depends on your platform as system ram starts in different
locations on different platforms.  For example:
U-Boot# bdi
arch_number = 0x00000E05
boot_params = 0x80000100
DRAM bank   = 0x00000000
-> start    = 0x80000000
-> size     = 0x40000000
...

And you also need to keep in mind where you load your kernel into memory
and how big it is.

-- 
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/e112860a/attachment.pgp>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] start address loading initrd in ram on arm
  2014-02-27 14:30 ` Tom Rini
@ 2014-02-27 16:49   ` Joren Bultheel
  2014-02-27 17:08     ` Tom Rini
  0 siblings, 1 reply; 5+ messages in thread
From: Joren Bultheel @ 2014-02-27 16:49 UTC (permalink / raw)
  To: u-boot

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.


On Thu, Feb 27, 2014 at 3:30 PM, Tom Rini <trini@ti.com> wrote:

> On Thu, Feb 27, 2014 at 11:50:33AM +0100, Joren Bultheel wrote:
>
> > Which address should I give when loading an initrd into ram using U-boot
> on
> > an arm-based architecture?
> > How can I find out?
> >
> > I have found many google hits where people are loading initrd files in
> ram
> > but they use always another target ram address.
> > It is never explained why they use 0x70000000 or 0x01200000 or ...
> >
> > In my case 0x70000000 does work finally, but I can not figure out why
> > 0x40000000 did not.
>
> Well, it depends on your platform as system ram starts in different
> locations on different platforms.  For example:
> U-Boot# bdi
> arch_number = 0x00000E05
> boot_params = 0x80000100
> DRAM bank   = 0x00000000
> -> start    = 0x80000000
> -> size     = 0x40000000
> ...
>
> And you also need to keep in mind where you load your kernel into memory
> and how big it is.
>
> --
> Tom
>



-- 
Joren Bultheel
Software Engineer

eSATURNUS
T. +32 16 40 12 82
www.esaturnus.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] start address loading initrd in ram on arm
  2014-02-27 16:49   ` Joren Bultheel
@ 2014-02-27 17:08     ` Tom Rini
  2014-02-27 19:29       ` Joren Bultheel
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Rini @ 2014-02-27 17:08 UTC (permalink / raw)
  To: u-boot

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>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] start address loading initrd in ram on arm
  2014-02-27 17:08     ` Tom Rini
@ 2014-02-27 19:29       ` Joren Bultheel
  0 siblings, 0 replies; 5+ messages in thread
From: Joren Bultheel @ 2014-02-27 19:29 UTC (permalink / raw)
  To: u-boot

Great.

Exactly wat I needed to know. I'll read the documentation in the  specified
place.
Op 27 feb. 2014 18:08 schreef "Tom Rini" <trini@ti.com>:

> 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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-27 19:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-27 10:50 [U-Boot] start address loading initrd in ram on arm Joren Bultheel
2014-02-27 14:30 ` Tom Rini
2014-02-27 16:49   ` Joren Bultheel
2014-02-27 17:08     ` Tom Rini
2014-02-27 19:29       ` Joren Bultheel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.