public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] omap3evm: Pass 'mem' argument to linux kernel
@ 2011-09-27 11:21 Sanjeev Premi
  2011-09-27 12:05 ` Igor Grinberg
  2011-09-28 18:47 ` Wolfgang Denk
  0 siblings, 2 replies; 5+ messages in thread
From: Sanjeev Premi @ 2011-09-27 11:21 UTC (permalink / raw)
  To: u-boot

In absence of this argument, Linux kernel doesn't boot.

Default value has been set to 128M to ensure that
Linux kernel boots on older EVMs as well.

Signed-off-by: Sanjeev Premi <premi@ti.com>
Cc: Sandeep Paulraj <s-paulraj@ti.com>
---

 This patch has been created against u-boot-ti/next.

 include/configs/omap3_evm.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 7af30c2..ea51216 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -200,11 +200,14 @@
 	"loadaddr=0x82000000\0" \
 	"usbtty=cdc_acm\0" \
 	"mmcdev=0\0" \
+	"memsize=128M\0" \
 	"console=ttyO0,115200n8\0" \
 	"mmcargs=setenv bootargs console=${console} " \
+		"mem=${memsize}\0 " \
 		"root=/dev/mmcblk0p2 rw " \
 		"rootfstype=ext3 rootwait\0" \
 	"nandargs=setenv bootargs console=${console} " \
+		"mem=${memsize}\0 " \
 		"root=/dev/mtdblock4 rw " \
 		"rootfstype=jffs2\0" \
 	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
-- 
1.7.0.4

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

* [U-Boot] [PATCH] omap3evm: Pass 'mem' argument to linux kernel
  2011-09-27 11:21 [U-Boot] [PATCH] omap3evm: Pass 'mem' argument to linux kernel Sanjeev Premi
@ 2011-09-27 12:05 ` Igor Grinberg
  2011-09-27 18:08   ` Premi, Sanjeev
  2011-09-28 18:47 ` Wolfgang Denk
  1 sibling, 1 reply; 5+ messages in thread
From: Igor Grinberg @ 2011-09-27 12:05 UTC (permalink / raw)
  To: u-boot

On 09/27/11 14:21, Sanjeev Premi wrote:
> In absence of this argument, Linux kernel doesn't boot.
> 
> Default value has been set to 128M to ensure that
> Linux kernel boots on older EVMs as well.

This change affects all EVMs, unless they explicitly change/remove
the memsize variable or change the *args variables.

Can't the get_ram_size() function be used for detecting the actual
amount of RAM? and then the memory tag or FDT equivalent
(if there is one) used to pass the memory size information?

> 
> Signed-off-by: Sanjeev Premi <premi@ti.com>
> Cc: Sandeep Paulraj <s-paulraj@ti.com>
> ---
> 
>  This patch has been created against u-boot-ti/next.
> 
>  include/configs/omap3_evm.h |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
> index 7af30c2..ea51216 100644
> --- a/include/configs/omap3_evm.h
> +++ b/include/configs/omap3_evm.h
> @@ -200,11 +200,14 @@
>  	"loadaddr=0x82000000\0" \
>  	"usbtty=cdc_acm\0" \
>  	"mmcdev=0\0" \
> +	"memsize=128M\0" \
>  	"console=ttyO0,115200n8\0" \
>  	"mmcargs=setenv bootargs console=${console} " \
> +		"mem=${memsize}\0 " \
>  		"root=/dev/mmcblk0p2 rw " \
>  		"rootfstype=ext3 rootwait\0" \
>  	"nandargs=setenv bootargs console=${console} " \
> +		"mem=${memsize}\0 " \
>  		"root=/dev/mtdblock4 rw " \
>  		"rootfstype=jffs2\0" \
>  	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \

-- 
Regards,
Igor.

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

* [U-Boot] [PATCH] omap3evm: Pass 'mem' argument to linux kernel
  2011-09-27 12:05 ` Igor Grinberg
@ 2011-09-27 18:08   ` Premi, Sanjeev
  2011-09-28 18:53     ` Wolfgang Denk
  0 siblings, 1 reply; 5+ messages in thread
From: Premi, Sanjeev @ 2011-09-27 18:08 UTC (permalink / raw)
  To: u-boot

> -----Original Message-----
> From: Igor Grinberg [mailto:grinberg at compulab.co.il] 
> Sent: Tuesday, September 27, 2011 5:35 PM
> To: Premi, Sanjeev
> Cc: u-boot at lists.denx.de
> Subject: Re: [U-Boot] [PATCH] omap3evm: Pass 'mem' argument 
> to linux kernel

Sorry missed this mail earlier...

> 
> On 09/27/11 14:21, Sanjeev Premi wrote:
> > In absence of this argument, Linux kernel doesn't boot.
> > 
> > Default value has been set to 128M to ensure that
> > Linux kernel boots on older EVMs as well.
> 
> This change affects all EVMs, unless they explicitly change/remove
> the memsize variable or change the *args variables.

Today without this patch, all EVMs should anyway be broken :(
...but may be working as users may have their own bootargs with
"mem=XYZM" in their bootargs.

The patch only ensures that the kernel would boot if there was
no "saved" environment e.g. when environment partition is erased.
or when u-boot is flashed on new boards.

> 
> Can't the get_ram_size() function be used for detecting the actual
> amount of RAM? and then the memory tag or FDT equivalent
> (if there is one) used to pass the memory size information?
> 

Yes something like this can be done, but that would mean string
manipulation at run-time. Question is - when we should/ shouldn't
do this manipulation.

If user wants to explicitly pass only a portion of memory to Linux
using environment variables, we shouldn't be manipulating the
bootargs.

~sanjeev

[snip]...[snip]

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

* [U-Boot] [PATCH] omap3evm: Pass 'mem' argument to linux kernel
  2011-09-27 11:21 [U-Boot] [PATCH] omap3evm: Pass 'mem' argument to linux kernel Sanjeev Premi
  2011-09-27 12:05 ` Igor Grinberg
@ 2011-09-28 18:47 ` Wolfgang Denk
  1 sibling, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2011-09-28 18:47 UTC (permalink / raw)
  To: u-boot

Dear Sanjeev Premi,

In message <1317122493-26452-1-git-send-email-premi@ti.com> you wrote:
> In absence of this argument, Linux kernel doesn't boot.
> 
> Default value has been set to 128M to ensure that
> Linux kernel boots on older EVMs as well.
> 
> Signed-off-by: Sanjeev Premi <premi@ti.com>
> Cc: Sandeep Paulraj <s-paulraj@ti.com>
> ---

Why do we need to pass any mem= argument at all?  This should never be
necessary.  If it is, then this is a bug in the Linux kernel and needs
to be fixed there.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"I think they're going to take all this money that we  spend  now  on
war and death --"                   "And make them spend it on life."
	-- Edith Keeler and Kirk, "The City on the Edge of Forever",
	   stardate unknown.

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

* [U-Boot] [PATCH] omap3evm: Pass 'mem' argument to linux kernel
  2011-09-27 18:08   ` Premi, Sanjeev
@ 2011-09-28 18:53     ` Wolfgang Denk
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2011-09-28 18:53 UTC (permalink / raw)
  To: u-boot

Dear "Premi, Sanjeev",

In message <B85A65D85D7EB246BE421B3FB0FBB59302577A8A72@dbde02.ent.ti.com> you wrote:
>
> > Can't the get_ram_size() function be used for detecting the actual
> > amount of RAM? and then the memory tag or FDT equivalent
> > (if there is one) used to pass the memory size information?
> 
> Yes something like this can be done, but that would mean string
> manipulation at run-time. Question is - when we should/ shouldn't
> do this manipulation.

I don't understand what you are trying to say.

There are two possibilities:

- In a FDT enabled kernel, memory information is passed in the device
  tree; no "string manipulation" is needed anywhere.  If the user
  decides to overwrite the auto-detected settings by using a "mem="
  boot argument, this is his decision and of course he can do so.

- Without FDT support, on ARM systems we pass a memory information in
  one or more ATAG_MEM entries.  Again, no "string manipulation" is
  needed anywhere.

> If user wants to explicitly pass only a portion of memory to Linux
> using environment variables, we shouldn't be manipulating the
> bootargs.

This statement makes even less ense to me.  Passing a "mem=" boot
argument is the official, documented way to acchive this.  So what
makes you think we should not pass such a boot argument?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
How many seconds are there in a year? If I tell you there are 3.155 x
10^7, you won't even try to remember it. On the other hand, who could
forget that, to within half a percent, pi seconds is a nanocentury.
                                                - Tom Duff, Bell Labs

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

end of thread, other threads:[~2011-09-28 18:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-27 11:21 [U-Boot] [PATCH] omap3evm: Pass 'mem' argument to linux kernel Sanjeev Premi
2011-09-27 12:05 ` Igor Grinberg
2011-09-27 18:08   ` Premi, Sanjeev
2011-09-28 18:53     ` Wolfgang Denk
2011-09-28 18:47 ` Wolfgang Denk

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