* [U-Boot-Users] U-Boot version string in kernel/userspace
@ 2008-01-21 16:21 Gregoire Banderet
2008-01-21 21:59 ` Timur Tabi
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Gregoire Banderet @ 2008-01-21 16:21 UTC (permalink / raw)
To: u-boot
Hi,
Waht's the best way to get the U-Boot version string (the one returned
by U-Boot cmd "version") from userspace?
Arg passed to the kernel?
U-Boot env variables and use fw_getenv?
...?
-- Greg
^ permalink raw reply [flat|nested] 7+ messages in thread* [U-Boot-Users] U-Boot version string in kernel/userspace
2008-01-21 16:21 [U-Boot-Users] U-Boot version string in kernel/userspace Gregoire Banderet
@ 2008-01-21 21:59 ` Timur Tabi
2008-01-22 6:44 ` Wolfgang Denk
2008-01-21 22:14 ` Ben Warren
2008-01-22 11:53 ` Andreas Schweigstill
2 siblings, 1 reply; 7+ messages in thread
From: Timur Tabi @ 2008-01-21 21:59 UTC (permalink / raw)
To: u-boot
Gregoire Banderet wrote:
> Hi,
>
> Waht's the best way to get the U-Boot version string (the one returned
> by U-Boot cmd "version") from userspace?
> Arg passed to the kernel?
> U-Boot env variables and use fw_getenv?
U-Boot disappears when the kernel loads, so the only cross-platform option is to
pass a command-line parameter to the kernel. Such a change would probably not
be accepted into the mainline, however.
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] U-Boot version string in kernel/userspace
2008-01-21 21:59 ` Timur Tabi
@ 2008-01-22 6:44 ` Wolfgang Denk
0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2008-01-22 6:44 UTC (permalink / raw)
To: u-boot
In message <479515A4.3080103@freescale.com> you wrote:
>
> > Waht's the best way to get the U-Boot version string (the one returned
> > by U-Boot cmd "version") from userspace?
> > Arg passed to the kernel?
> > U-Boot env variables and use fw_getenv?
>
> U-Boot disappears when the kernel loads, so the only cross-platform option is to
> pass a command-line parameter to the kernel. Such a change would probably not
> be accepted into the mainline, however.
First, reading the kernel command line can be done in user space - no
need to change the kernel to do that.
Second, using the command line is not the only way to access
envrionment data. Assuming the environment is stored in flash (or
similar), you can of course read (and write) it from Linux, too.
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
...when fits of creativity run strong, more than one programmer or
writer has been known to abandon the desktop for the more spacious
floor. - Fred Brooks, Jr.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] U-Boot version string in kernel/userspace
2008-01-21 16:21 [U-Boot-Users] U-Boot version string in kernel/userspace Gregoire Banderet
2008-01-21 21:59 ` Timur Tabi
@ 2008-01-21 22:14 ` Ben Warren
2008-01-22 11:53 ` Andreas Schweigstill
2 siblings, 0 replies; 7+ messages in thread
From: Ben Warren @ 2008-01-21 22:14 UTC (permalink / raw)
To: u-boot
Hi Gregoire,
On Jan 21, 2008 11:21 AM, Gregoire Banderet <Gregoire.Banderet@ge.com> wrote:
> Hi,
>
> Waht's the best way to get the U-Boot version string (the one returned
> by U-Boot cmd "version") from userspace?
> Arg passed to the kernel?
> U-Boot env variables and use fw_getenv?
> ...?
>
Yeah, I'd get it via the fw_getenv utility. There's an environment
variable called 'ver', that should be accessible. I say 'should',
because I've never looked at it before and don't currently have access
to a Linux-booted board to verify. I have used fw_getenv/fw_setenv
extensively to read and write other variables and have never had any
problems.
regards,
Ben
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] U-Boot version string in kernel/userspace
2008-01-21 16:21 [U-Boot-Users] U-Boot version string in kernel/userspace Gregoire Banderet
2008-01-21 21:59 ` Timur Tabi
2008-01-21 22:14 ` Ben Warren
@ 2008-01-22 11:53 ` Andreas Schweigstill
2008-01-22 13:47 ` Wolfgang Denk
2 siblings, 1 reply; 7+ messages in thread
From: Andreas Schweigstill @ 2008-01-22 11:53 UTC (permalink / raw)
To: u-boot
Hello!
Gregoire Banderet schrieb:
> Waht's the best way to get the U-Boot version string (the one returned
> by U-Boot cmd "version") from userspace?
> Arg passed to the kernel?
> U-Boot env variables and use fw_getenv?
fw_getenv works fine for userspace programs. But I find it quite usefull
to forward U-Boot configuration parameters to Linux kernel space via
ATAGs, especially regarding different hardware versions and vice versa.
Accessing the data which has been provided by ATAGs can be very fast
because the ATAG data can be copied to global structures which can be
accessed by the kernel and also be kernel modules. Typical applications
are information about slightly different hardware versions, like GPIO
mapping or polarity.
With best regards
Andreas
--
Dipl.-Phys. Andreas Schweigstill
Schweigstill IT | Embedded Systems
Schauenburgerstra?e 116, D-24118 Kiel, Germany
Phone: (+49) 431 5606-435, Fax: (+49) 431 5606-436
Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] U-Boot version string in kernel/userspace
2008-01-22 11:53 ` Andreas Schweigstill
@ 2008-01-22 13:47 ` Wolfgang Denk
2008-01-22 20:52 ` Robert Schwebel
0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2008-01-22 13:47 UTC (permalink / raw)
To: u-boot
In message <4795D957.1070305@schweigstill.de> you wrote:
>
> fw_getenv works fine for userspace programs. But I find it quite usefull
> to forward U-Boot configuration parameters to Linux kernel space via
> ATAGs, especially regarding different hardware versions and vice versa.
> Accessing the data which has been provided by ATAGs can be very fast
> because the ATAG data can be copied to global structures which can be
> accessed by the kernel and also be kernel modules. Typical applications
> are information about slightly different hardware versions, like GPIO
> mapping or polarity.
I agree that this may make sense on ARM systems - to me it would also
make sense to pass the MAC address as an ATAG. The problem is that
you will probably run into problems if youy try pushing such code
into the mainline kernel. RMK will likely block it.
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
"It ain't so much the things we don't know that get us in trouble.
It's the things we know that ain't so." - Artemus Ward aka Charles
Farrar Brown
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] U-Boot version string in kernel/userspace
2008-01-22 13:47 ` Wolfgang Denk
@ 2008-01-22 20:52 ` Robert Schwebel
0 siblings, 0 replies; 7+ messages in thread
From: Robert Schwebel @ 2008-01-22 20:52 UTC (permalink / raw)
To: u-boot
On Tue, Jan 22, 2008 at 02:47:48PM +0100, Wolfgang Denk wrote:
> I agree that this may make sense on ARM systems - to me it would also
> make sense to pass the MAC address as an ATAG. The problem is that
> you will probably run into problems if youy try pushing such code
> into the mainline kernel. RMK will likely block it.
And for good reasons. He has explained it many times on alkml.
Robert
--
Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
Pengutronix - Linux Solutions for Science and Industry
Handelsregister: Amtsgericht Hildesheim, HRA 2686
Hannoversche Str. 2, 31134 Hildesheim, Germany
Phone: +49-5121-206917-0 | Fax: +49-5121-206917-9
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-01-22 20:52 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-21 16:21 [U-Boot-Users] U-Boot version string in kernel/userspace Gregoire Banderet
2008-01-21 21:59 ` Timur Tabi
2008-01-22 6:44 ` Wolfgang Denk
2008-01-21 22:14 ` Ben Warren
2008-01-22 11:53 ` Andreas Schweigstill
2008-01-22 13:47 ` Wolfgang Denk
2008-01-22 20:52 ` Robert Schwebel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox