Hi,
On 07-07-15 11:39, Bernhard Nortmann wrote:
Am 07.07.2015 11:19, schrieb Hans de Goede:
We could agree upon a special magic signature between the fel tool
and the sunxi u-boot code which means that u-boot should patch
its boot_cmd in the env to load a script from DRAM (at a fixed
offset). We could always do the boot_cmd patching when in fel-mode
(which we already detect) but I do not believe this is desirable.
Until now I've use a simple (and somewhat crude) workaround for this,
i.e. to achieve a more flexible FEL boot sequence.
I defined a different bootcmd for u-boot to check for the presence of
a script file (uploaded via fel):
#define CONFIG_BOOTCOMMAND "source ${scriptaddr} || run distro_bootcmd"
A "normal" boot is expected to have invalid data at ${scriptaddr},
so the source command would fail (due to checksum mismatch).
But if a FEL-provided script is present, it will be executed before
anything else.
I've been thinking about doing something similar, but can we perhaps
only do this when we know we are booting in FEL mode ?
So take the FEL or not FEL check from spl_boot_device(), and when setting
up the env, do
setenv boot_cmd "source ${scriptaddr} || run distro_bootcmd"
If we're booting from FEL. We should probably also do something wrt
where the env gets loaded from when booting in FEL mode, ensuring that
we always use the default env then.
I'm not sure if the env loading code already supports dynamically
figuring out where to load the env from, if it does not then we
should probably fix that as we will need the same when running
from mmc or nand with a single unified binary.
Regards,
Hans
--
You received this message because you are subscribed to the Google Groups
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.