Hi,
On 06-07-15 16:28, Ian Campbell wrote:
On Mon, 2015-07-06 at 14:11 +0200, Hans de Goede wrote:
Hi,
On 06-07-15 09:02, Bernhard Nortmann wrote:
Hello Hans!
Am 05.07.2015 11:54, schrieb Hans de Goede:
This seems like a good idea to me, am I reading both the --help
and the code correctly that this only writes u-boot but does not
do the necessary fel exe 0x..... ? It seems to me that such a
command should also execute u-boot.
You're right - the "fel exe" is kept separate. This is done on purpose
to allow uploading other elements via FEL (e.g. boot script, kernel,
initrd). Execution of the bootloader always comes last.
Ah right, I guess that makes sense, but if this is not going to
be a fire and forget command, and people still need to run more
fel commands after it then I'm wondering it this is worth the trouble
at all.
Perhaps do the exe by default but provide a way to ask not to? (Or vice
versa, but that seems less useful to me)
[...]
See above since the user still needs to do the exec I wonder
what the value is in saving the user the single extra
fel write for the u-boot-dtb.bin file. I think having a full
auto mode as described above would be better.
Historically wasn't this what the usb-boot script did (effectively a
wrapper around the fel tool). It's be nice if it either a) started
working again, b) said something when it wasn't supposed to work and
pointed in the right direction or c) went away so it stops being
confusingly tempting to people like me ;-)
Right, this is what the usb-boot script used to do, but the usb-boot
script uses a u-boot script (.scr) file to tell u-boot where to
laod the kernel, etc. This used to work because the FEL build had
a separate u-boot env, which had a boot_cmd env setting which would
execute said script form a fixed address.
However with mainlining the sunxi code the separate env got dropped,
and now we no longer even have a separate FEL build.
So as said I think part of fixing this will be a u-boot patch,
what I've in mind is a bit of code which gets called after the env
is loaded, but before (auto)booting. This can check the EGON0 magic
signature in the first 32k of SRAM. Currently "fel spl" already
mangles this signature, and this way u-boot knows it is not
booting from mmc/nand, but in FEL mode and that it should return
from the SPL to the FEL ROM, so that u-boot-dtb.bin can be loaded
to the DRAM.
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.
So instead what I suggest is a new "fel linux" command which
replaces the old usb-boot script, this command would generate
an scr file on the fly (including setting kernel options specified
on the fel cmdline), patch the boot-signature, upload spl + kernel +
dtb + initrd + generated-scr + u-boot-dtb.bin and then execute
u-boot, which will then autoboot if not interrupted, execute the
scr and boot into the loaded Linux.
Note parts of this could still be done by a shell script, but I
do not believe this will be very hard to do in C, and it would
be good to have this contained in one binary IMHO.
We could also add Bernard's u-boot command and that would then
just load spl + u-boot and execute u-boot.
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.