* [U-Boot-Users] Wrong location of environment. Copy environment, substitute variables?
@ 2006-07-07 14:02 Andrew Zhukov
2006-07-07 14:13 ` Anders Larsen
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Zhukov @ 2006-07-07 14:02 UTC (permalink / raw)
To: u-boot
I have at91rm9200dk with SPI DataFlash only (without Flash), u-boot
1.1.4, kernel 2.6.10.
I'd like the kernel to use u-boot's "bootargs" as cmdline. To use
u-boot's data the kernel should know its absolute locations...
I see the kernel expects environment at TEXT_BASE + 0x100 (that's
20000100), but u-boot places environment at 21ede00c (result of function
env_get_addr(0)). I believe the last will move if I edit smth in u-boot.
Summary: in function do_bootm (where u-boot starts loading the kernel),
I should copy the whole environment to the area starting from location
20000100.
Is this right way?
Trouble: bootm doesn't substitute variables (${ipaddr} ${serverip}
etc.). I should copy-substitute. There should be a function for
substitution - does anybody know?
Regards
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread* [U-Boot-Users] Wrong location of environment. Copy environment, substitute variables?
2006-07-07 14:02 [U-Boot-Users] Wrong location of environment. Copy environment, substitute variables? Andrew Zhukov
@ 2006-07-07 14:13 ` Anders Larsen
2006-07-08 10:40 ` Wolfgang Denk
0 siblings, 1 reply; 3+ messages in thread
From: Anders Larsen @ 2006-07-07 14:13 UTC (permalink / raw)
To: u-boot
On Fri, 07 Jul 2006 17:02:23 +0300, Andrew Zhukov wrote:
> I have at91rm9200dk with SPI DataFlash only (without Flash), u-boot
> 1.1.4, kernel 2.6.10.
>
> I'd like the kernel to use u-boot's "bootargs" as cmdline. To use
> u-boot's data the kernel should know its absolute locations...
> I see the kernel expects environment at TEXT_BASE + 0x100 (that's
> 20000100), but u-boot places environment at 21ede00c (result of function
> env_get_addr(0)). I believe the last will move if I edit smth in u-boot.
>
> Summary: in function do_bootm (where u-boot starts loading the kernel),
> I should copy the whole environment to the area starting from location
> 20000100.
>
> Is this right way?
No no no!
The kernel expects a tagged list of parameters at 0x20000100; this list
includes - among other values - the contents of "bootargs" tagged as
command-line "ATAG_CMDLINE" (only the contents of bootargs is copied;
other u-boot environment variables are not).
This already works out-of-the-box.
> Trouble: bootm doesn't substitute variables (${ipaddr} ${serverip}
> etc.). I should copy-substitute. There should be a function for
> substitution - does anybody know?
With the hush parser you can use a trick like e.g.
setenv bootcmd setenv bootargs ip=${ipaddr} ... \; bootm 0x10040000
'boot' will then set the bootargs variable just prior to booting.
Cheers
Anders
^ permalink raw reply [flat|nested] 3+ messages in thread* [U-Boot-Users] Wrong location of environment. Copy environment, substitute variables?
2006-07-07 14:13 ` Anders Larsen
@ 2006-07-08 10:40 ` Wolfgang Denk
0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2006-07-08 10:40 UTC (permalink / raw)
To: u-boot
In message <pan.2006.07.07.14.13.32.809057@alarsen.net> you wrote:
>
> With the hush parser you can use a trick like e.g.
> setenv bootcmd setenv bootargs ip=${ipaddr} ... \; bootm 0x10040000
The same works exactly like this using the simple parser, btw. (even
using the same syntax).
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"In the long run, every program becomes rococo, and then rubble."
- Alan Perlis
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-07-08 10:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-07 14:02 [U-Boot-Users] Wrong location of environment. Copy environment, substitute variables? Andrew Zhukov
2006-07-07 14:13 ` Anders Larsen
2006-07-08 10:40 ` Wolfgang Denk
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.