linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Fw: [PATCH 2/15] Automatically lmb_reserve() initrd
@ 2007-03-12 20:21 Stephen Winiecki
  2007-03-12 21:25 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Winiecki @ 2007-03-12 20:21 UTC (permalink / raw)
  To: david; +Cc: linuxppc-dev

+#ifdef CONFIG_BLK_DEV_INITRD
+                DBG("Looking for initrd properties... ");
+                prop = of_get_flat_dt_prop(node, "linux,initrd-start", 
&l);
+                if (prop) {
+                                initrd_start = (unsigned 
long)__va(of_read_ulong(prop, l/4));
+                                prop = of_get_flat_dt_prop(node, 
"linux,initrd-end", &l);
+                                if (prop) {
+                                                initrd_end = (unsigned 
long)__va(of_read_ulong(prop, l/4));
+                                                initrd_below_start_ok = 
1;
+                                } else {
+                                                initrd_start = 0;
+                                }
+                }
+                DBG("initrd_start=0x%lx  initrd_end=0x%lx\n", 
initrd_start, initrd_end);
+#endif /* CONFIG_BLK_DEV_INITRD */
+

Also from Patch 7:
Index: working-2.6/arch/powerpc/boot/main.c
===================================================================
--- working-2.6.orig/arch/powerpc/boot/main.c            2007-02-19 
14:01:15.000000000 +1100
+++ working-2.6/arch/powerpc/boot/main.c                 2007-02-19 
14:01:38.000000000 +1100

+                /* Tell the kernel initrd address via device tree */
+                devp = finddevice("/chosen");
+                if (! devp) {
+                                printf("Device tree has no chosen 
node!\n\r");
+                                exit();
+                }
+
+                initrd_start = (u32)initrd_addr;
+                initrd_end = (u32)initrd_addr + initrd_size;
+
+                setprop(devp, "linux,initrd-start", &initrd_start,
+                                sizeof(initrd_start));
+                setprop(devp, "linux,initrd-end", &initrd_end, 
sizeof(initrd_end));
 
-                flush_cache((void *)vmlinux.addr, vmlinux.size);
+                return (struct addr_range){(void *)initrd_addr, 
initrd_size};

It might be helpful if some kind of message was surfaced if the 
initrd-start/end properties didn't exist in the dt, esp. since it may not 
be well known initially as a dts definition requirement/option (voice of 
experience :)).  In general I think surfacing messages for any properties 
which are detected as not existing and which might be normally expected 
would be a good thing as people get familiar with defining dts files and 
specifying properties for their platforms. 

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

* Re: Fw: [PATCH 2/15] Automatically lmb_reserve() initrd
  2007-03-12 20:21 Fw: [PATCH 2/15] Automatically lmb_reserve() initrd Stephen Winiecki
@ 2007-03-12 21:25 ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2007-03-12 21:25 UTC (permalink / raw)
  To: Stephen Winiecki; +Cc: linuxppc-dev, david


> It might be helpful if some kind of message was surfaced if the 
> initrd-start/end properties didn't exist in the dt, esp. since it may not 
> be well known initially as a dts definition requirement/option (voice of 
> experience :)).  In general I think surfacing messages for any properties 
> which are detected as not existing and which might be normally expected 
> would be a good thing as people get familiar with defining dts files and 
> specifying properties for their platforms. 

Well.. initrd is totally optional...

Ben.

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

* Fw: [PATCH 2/15] Automatically lmb_reserve() initrd
@ 2007-03-13 17:43 Stephen Winiecki
  2007-03-13 18:00 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Winiecki @ 2007-03-13 17:43 UTC (permalink / raw)
  To: benh; +Cc: linuxppc-dev, david

Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote on 03/12/2007 
05:25:32 PM:

> 
> > It might be helpful if some kind of message was surfaced if the 
> > initrd-start/end properties didn't exist in the dt, esp. since it may 
not 
> > be well known initially as a dts definition requirement/option (voice 
of 
> > experience :)).  In general I think surfacing messages for any 
properties 
> > which are detected as not existing and which might be normally 
expected 
> > would be a good thing as people get familiar with defining dts files 
and 
> > specifying properties for their platforms. 
> 
> Well.. initrd is totally optional...
> 

I understand - I guess I am just thinking of the case where someone didn't 
define the property because they were not aware of it - esp in this case 
where the existence of the property name is all that is required for the 
value to be filled in properly by the init code.  Instead of just setting 
the start/end to 0 - maybe include a message something like (even if 
debug) "No initird-start/end property found - setting to 0" - just a minor 
example.  The larger point also being that defining dts files and 
properties may be a new thing for many people with the new support - might 
be helpful to surface missing properties when appropriate (I'm not 
condoning mass amounts of messages for everything). 

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

* Re: Fw: [PATCH 2/15] Automatically lmb_reserve() initrd
  2007-03-13 17:43 Stephen Winiecki
@ 2007-03-13 18:00 ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2007-03-13 18:00 UTC (permalink / raw)
  To: Stephen Winiecki; +Cc: linuxppc-dev, david


> I understand - I guess I am just thinking of the case where someone didn't 
> define the property because they were not aware of it - esp in this case 
> where the existence of the property name is all that is required for the 
> value to be filled in properly by the init code.  Instead of just setting 
> the start/end to 0 - maybe include a message something like (even if 
> debug) "No initird-start/end property found - setting to 0" - just a minor 
> example.  The larger point also being that defining dts files and 
> properties may be a new thing for many people with the new support - might 
> be helpful to surface missing properties when appropriate (I'm not 
> condoning mass amounts of messages for everything). 

I think the proper thing to do instead is improve the documentation :-)

Ben.

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

end of thread, other threads:[~2007-03-13 23:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-12 20:21 Fw: [PATCH 2/15] Automatically lmb_reserve() initrd Stephen Winiecki
2007-03-12 21:25 ` Benjamin Herrenschmidt
  -- strict thread matches above, loose matches on Subject: below --
2007-03-13 17:43 Stephen Winiecki
2007-03-13 18:00 ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).