Skip to contentSkip to conversation

omap3evm: Pass 'mem' argument to linux kernel

PATCH Superseded Sanjeev Premi 4 participants 5 messages Sep 27, 2011 – Sep 28, 2011

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 omap3evm: Pass 'mem' argument to linux kernel

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.

Cc Sandeep Paulraj <[email protected]>

---

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

 include/configs/omap3_evm.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
include/configs/omap3_evm.h +3 -0
index 7af30c2..ea51216 100644
@@ -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" \
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 omap3evm: Pass 'mem' argument to linux kernel

Quoted 4 lines · Sanjeev Premi

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?

Quoted 29 lines
Cc Sandeep Paulraj <[email protected]>

---

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

 include/configs/omap3_evm.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
include/configs/omap3_evm.h +3 -0
index 7af30c2..ea51216 100644
@@ -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" \
Signature · 2 lines
Regards,
Igor.
#2 lore raw

PATCH 1/1 omap3evm: Pass 'mem' argument to linux kernel

Quoted 7 lines

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

Quoted 9 lines · Sanjeev Premi
Quoted 4 lines

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.

Quoted 5 lines

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]

#3 lore raw

PATCH 1/1 omap3evm: Pass 'mem' argument to linux kernel

Dear "Premi, Sanjeev",

Quoted 8 lines · In message <[email protected]> you…
Quoted 4 lines

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.

Quoted 3 lines

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

Signature · 7 lines
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
#4 lore raw

PATCH 1/1 omap3evm: Pass 'mem' argument to linux kernel

In reply to Sanjeev Premi

Dear Sanjeev Premi,

Quoted 8 lines · In message <[email protected]> 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.

Cc Sandeep Paulraj <[email protected]>

---

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

Signature · 7 lines
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.