Skip to contentSkip to conversation

user-space ===>> U-Boot ====>> user-space ?

U-Boot bosmith 3 participants 3 messages Oct 12, 2010

lore
Share & tools
lore

bosmith

author
#0 lore raw

Hi
Is there a simple way to send data from a Linux user-space program to U-Boot?
How about from U-Boot up to a user-space program?

The data may change often enough that using fw_printenv and fw_setenv might wear out the NAND storage area for the environment.

The use-case is to have two kernel images, two root file systems, and to let a user-space application specify which to use and then force a reboot. The system will not lose power during this reboot.

This seems like a common enough problem. Has anyone solved it before?

Signature · 2 lines
View this message in context: http://old.nabble.com/user-space--%3D%3D%3D%3E%3E--U-Boot--%3D%3D%3D%3D%3E%3E--user-space---tp29939469p29939469.html
Sent from the Uboot - Users mailing list archive at Nabble.com.
#1 lore raw

Dear bosmith,

Quoted 4 lines · In message <[email protected]> you wrote:

Is there a simple way to send data from a Linux user-space program to U-Boot?
How about from U-Boot up to a user-space program?

I know of two communication methods:

Using the environment (and fw_printenv/fw_setenv in Linux user space), and using a shared log buffer (which may be a bit difficult to read / process in U-Boot if that should be needed).

Quoted 2 lines

The data may change often enough that using fw_printenv and fw_setenv might wear out the NAND storage area for the environment.

Then put all this stuff in a UBI partition, and use the "env import" / "env export" features in U-Boot to access it (or extend the code to handle environment in a UBI partition directly).

Quoted 3 lines

The use-case is to have two kernel images, two root file systems, and to let a user-space application specify which to use and then force a reboot. The system will not lose power during this reboot.

And you think you will switch betweent these two so often that using the environment would wear out the NAND? I think you are too pessimistic.

Quoted 1 line

This seems like a common enough problem. Has anyone solved it before?

Most people use the environment for this purpose.

Best regards,

Wolfgang Denk

Signature · 4 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
Today is the yesterday you worried about tomorrow.
#2 lore raw
In reply to bosmith

From: bosmith

Quoted 8 lines

...
The use-case is to have two kernel images, two root file systems, and to let a user-space application specify which to use and then force a reboot. The system will not lose power during this reboot.

This seems like a common enough problem. Has anyone solved it before?

This sort of image swapping in flash is best done with some support from board logic.

For example, the FSL mpc85xx boards have a register that a user can write
that inverts a high-order flash address bit. Inverting this bit causes the next boot to access the alternate bank.

This allows simple bank switching with no modification to any code.

Ed