Devicetree
 help / color / mirror / Atom feed
* Passing an initrd to a Linux kernel with Device Tree
@ 2011-09-20 17:46 Olivier Martin
  0 siblings, 0 replies; 5+ messages in thread
From: Olivier Martin @ 2011-09-20 17:46 UTC (permalink / raw)
  To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

Hello,

I tried recently to add support in UEFI to pass an initrd with FDT to a
Linux kernel. I have searched the Internet but I did not find any
information to do that.

FYI, this is the way it is done in ATAG:
typedef struct {
  UINT32  start;
  UINT32  size;
} LINUX_ATAG_INITRD2;

The boot loader loads the initrd in system memory and passes the memory
region information through ATAG.


Sorry, if it is the wrong mailing-list. In this case, can someone point me
on the right forum for any Linux FDT oriented questions.

Thanks,
Olivier

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

* Re: Passing an initrd to a Linux kernel with Device Tree
       [not found] ` <4e78d3aa.21b0ec0a.63e9.1591SMTPIN_ADDED-ATjtLOhZ0NVl57MIdRCFDg@public.gmane.org>
@ 2011-09-20 20:10   ` Grant Likely
       [not found]     ` <20110920201058.GM7781-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Grant Likely @ 2011-09-20 20:10 UTC (permalink / raw)
  To: Olivier Martin; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Tue, Sep 20, 2011 at 06:46:22PM +0100, Olivier Martin wrote:
> Hello,
> 
> I tried recently to add support in UEFI to pass an initrd with FDT to a
> Linux kernel. I have searched the Internet but I did not find any
> information to do that.
> 
> FYI, this is the way it is done in ATAG:
> typedef struct {
>   UINT32  start;
>   UINT32  size;
> } LINUX_ATAG_INITRD2;
> 
> The boot loader loads the initrd in system memory and passes the memory
> region information through ATAG.
> 
> 
> Sorry, if it is the wrong mailing-list. In this case, can someone point me
> on the right forum for any Linux FDT oriented questions.

Hmmm, it may not be documented (the binding was implemented a long
time ago before we got strict about documenting bindings).  The magic
is two properties in the /chosen node; "linux,initrd-start" and
"linux,initrd-end".  Each contains the physical start and end
addresses of the initrd.

g.

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

* RE: Passing an initrd to a Linux kernel with Device Tree
       [not found]     ` <20110920201058.GM7781-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
@ 2011-09-21  9:35       ` Dave P Martin
       [not found]         ` <3A52818B08EC2744B4FE79467451246180DF6E9E12-x8AJ9SVuP1o/DnoT/0QEu0EOCMrvLtNR@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Dave P Martin @ 2011-09-21  9:35 UTC (permalink / raw)
  To: Grant Likely, Olivier Martin
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org



> -----Original Message-----
> From:
> devicetree-discuss-bounces+dave.martin=arm.com-uLR06cmDAlY8sQ00jmICUQ@public.gmane.org
g [mailto:devicetree-discuss-> bounces+dave.martin=arm.com-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org] On Behalf Of
> Grant Likely
> Sent: 20 September 2011 21:11
> To: Olivier Martin
> Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
> Subject: Re: Passing an initrd to a Linux kernel with Device Tree
>
> On Tue, Sep 20, 2011 at 06:46:22PM +0100, Olivier Martin wrote:
> > Hello,
> >
> > I tried recently to add support in UEFI to pass an initrd
> with FDT to
> > a Linux kernel. I have searched the Internet but I did not find any
> > information to do that.
> >
> > FYI, this is the way it is done in ATAG:
> > typedef struct {
> >   UINT32  start;
> >   UINT32  size;
> > } LINUX_ATAG_INITRD2;
> >
> > The boot loader loads the initrd in system memory and passes the
> > memory region information through ATAG.
> >
> >
> > Sorry, if it is the wrong mailing-list. In this case, can someone
> > point me on the right forum for any Linux FDT oriented questions.
>
> Hmmm, it may not be documented (the binding was implemented a
> long time ago before we got strict about documenting
> bindings).  The magic is two properties in the /chosen node;
> "linux,initrd-start" and "linux,initrd-end".  Each contains
> the physical start and end addresses of the initrd.

What does "end address" mean here?

It could be read as meaning either:

a) address of the the final byte of the image
b) address of the first byte following the image (0 if the image ends at 4G)

Cheers
---Dave

-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.

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

* RE: Passing an initrd to a Linux kernel with Device Tree
       [not found]         ` <3A52818B08EC2744B4FE79467451246180DF6E9E12-x8AJ9SVuP1o/DnoT/0QEu0EOCMrvLtNR@public.gmane.org>
@ 2011-09-21 14:25           ` Nicolas Pitre
       [not found]             ` <alpine.LFD.2.00.1109210957050.12663-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Pitre @ 2011-09-21 14:25 UTC (permalink / raw)
  To: Dave P Martin
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Olivier Martin

On Wed, 21 Sep 2011, Dave P Martin wrote:

> 
> 
> > -----Original Message-----
> > From:
> > devicetree-discuss-bounces+dave.martin=arm.com-uLR06cmDAlY8sQ00jmICUQ@public.gmane.org
> g [mailto:devicetree-discuss-> bounces+dave.martin=arm.com-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org] On Behalf Of
> > Grant Likely
> > Sent: 20 September 2011 21:11
> > To: Olivier Martin
> > Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
> > Subject: Re: Passing an initrd to a Linux kernel with Device Tree
> >
> > On Tue, Sep 20, 2011 at 06:46:22PM +0100, Olivier Martin wrote:
> > > Hello,
> > >
> > > I tried recently to add support in UEFI to pass an initrd
> > with FDT to
> > > a Linux kernel. I have searched the Internet but I did not find any
> > > information to do that.
> > >
> > > FYI, this is the way it is done in ATAG:
> > > typedef struct {
> > >   UINT32  start;
> > >   UINT32  size;
> > > } LINUX_ATAG_INITRD2;
> > >
> > > The boot loader loads the initrd in system memory and passes the
> > > memory region information through ATAG.
> > >
> > >
> > > Sorry, if it is the wrong mailing-list. In this case, can someone
> > > point me on the right forum for any Linux FDT oriented questions.
> >
> > Hmmm, it may not be documented (the binding was implemented a
> > long time ago before we got strict about documenting
> > bindings).  The magic is two properties in the /chosen node;
> > "linux,initrd-start" and "linux,initrd-end".  Each contains
> > the physical start and end addresses of the initrd.
> 
> What does "end address" mean here?
> 
> It could be read as meaning either:
> 
> a) address of the the final byte of the image
> b) address of the first byte following the image (0 if the image ends at 4G)

Looking at the code (remember this is always the ultimate 
documentation), end_address = start_address + size.  So (b) would be the 
right answer.

Obviously, it is adviseable not to locate your ramdisk so close to the 
end of memory so that its end precisely matches the end of the address 
space, and that is if your RAM is located at the top too.


Nicolas

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

* Re: Passing an initrd to a Linux kernel with Device Tree
       [not found]             ` <alpine.LFD.2.00.1109210957050.12663-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>
@ 2011-09-21 14:38               ` Grant Likely
  0 siblings, 0 replies; 5+ messages in thread
From: Grant Likely @ 2011-09-21 14:38 UTC (permalink / raw)
  To: Nicolas Pitre
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Olivier Martin

On Wed, Sep 21, 2011 at 8:25 AM, Nicolas Pitre <nico-vtqb6HGKxmzR7s880joybQ@public.gmane.org> wrote:
> On Wed, 21 Sep 2011, Dave P Martin wrote:
>
>>
>>
>> > -----Original Message-----
>> > From:
>> > devicetree-discuss-bounces+dave.martin=arm.com-uLR06cmDAlY8sQ00jmICUQ@public.gmane.org
>> g [mailto:devicetree-discuss-> bounces+dave.martin=arm.com-uLR06cmDAlZ4lb6lR7t5LA@public.gmane.orgs.org] On Behalf Of
>> > Grant Likely
>> > Sent: 20 September 2011 21:11
>> > To: Olivier Martin
>> > Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
>> > Subject: Re: Passing an initrd to a Linux kernel with Device Tree
>> >
>> > On Tue, Sep 20, 2011 at 06:46:22PM +0100, Olivier Martin wrote:
>> > > Hello,
>> > >
>> > > I tried recently to add support in UEFI to pass an initrd
>> > with FDT to
>> > > a Linux kernel. I have searched the Internet but I did not find any
>> > > information to do that.
>> > >
>> > > FYI, this is the way it is done in ATAG:
>> > > typedef struct {
>> > >   UINT32  start;
>> > >   UINT32  size;
>> > > } LINUX_ATAG_INITRD2;
>> > >
>> > > The boot loader loads the initrd in system memory and passes the
>> > > memory region information through ATAG.
>> > >
>> > >
>> > > Sorry, if it is the wrong mailing-list. In this case, can someone
>> > > point me on the right forum for any Linux FDT oriented questions.
>> >
>> > Hmmm, it may not be documented (the binding was implemented a
>> > long time ago before we got strict about documenting
>> > bindings).  The magic is two properties in the /chosen node;
>> > "linux,initrd-start" and "linux,initrd-end".  Each contains
>> > the physical start and end addresses of the initrd.
>>
>> What does "end address" mean here?
>>
>> It could be read as meaning either:
>>
>> a) address of the the final byte of the image
>> b) address of the first byte following the image (0 if the image ends at 4G)
>
> Looking at the code (remember this is always the ultimate
> documentation), end_address = start_address + size.  So (b) would be the
> right answer.

Yes, (b) is correct.  I lost 2 days of my life tracking down a bug
last year that turned out to be that I incorrectly assumed (a).

g.

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

end of thread, other threads:[~2011-09-21 14:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <4e78d3aa.21b0ec0a.63e9.1591SMTPIN_ADDED@mx.google.com>
     [not found] ` <4e78d3aa.21b0ec0a.63e9.1591SMTPIN_ADDED-ATjtLOhZ0NVl57MIdRCFDg@public.gmane.org>
2011-09-20 20:10   ` Passing an initrd to a Linux kernel with Device Tree Grant Likely
     [not found]     ` <20110920201058.GM7781-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2011-09-21  9:35       ` Dave P Martin
     [not found]         ` <3A52818B08EC2744B4FE79467451246180DF6E9E12-x8AJ9SVuP1o/DnoT/0QEu0EOCMrvLtNR@public.gmane.org>
2011-09-21 14:25           ` Nicolas Pitre
     [not found]             ` <alpine.LFD.2.00.1109210957050.12663-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>
2011-09-21 14:38               ` Grant Likely
2011-09-20 17:46 Olivier Martin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox