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

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?

Dear bosmith,
In message 29939469.post@talk.nabble.com 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).
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).
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.
This seems like a common enough problem. Has anyone solved it before?
Most people use the environment for this purpose.
Best regards,
Wolfgang Denk

From: bosmith
... 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
participants (3)
-
bosmith
-
Swarthout Edward L-SWARTHOU
-
Wolfgang Denk