[U-Boot-Users] U-Boot version string in kernel/userspace

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

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.

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

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

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

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

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
participants (6)
-
Andreas Schweigstill
-
Ben Warren
-
Gregoire Banderet
-
Robert Schwebel
-
Timur Tabi
-
Wolfgang Denk