sunxi-tools icon indicating copy to clipboard operation
sunxi-tools copied to clipboard

Remove the workaround code from fel-sdboot.c (and possibly uart0-helloworld)

Open n1tehawk opened this issue 9 years ago • 3 comments

The root cause of the problems that surfaced with these ARM binaries is that the U-Boot mksunxiboot utility writes a minimal header that is too small to avoid corruption of actual code by the BROM bootloader. See https://patchwork.ozlabs.org/patch/622173.

Once this is fixed (in upstream U-Boot), we should probably revert the NOP padding used in fel-sdboot.c to circumvent this. The uart0-helloworld-sdboot.sunxi under development currently also contains a workaround that won't be needed any more afterwards.

n1tehawk avatar May 14 '16 09:05 n1tehawk

Yes, the workaround needs to be at least changed to branch over the corrupted location. The description at https://github.com/linux-sunxi/sunxi-tools/blob/ce9cf33606492076b81e1157ba9fc54b56379335/fel-sdboot.c#L41-L50 also needs to be updated. It did accurately state the facts, but now we have more information.

As for removing the workaround completely, some people may still try to recompile these binaries and use a buggy mksunxiboot tool while doing this. It might be safer to keep the workarounds at least for a year or so, maybe even longer.

ssvb avatar May 19 '16 18:05 ssvb

Okay, i'll tag this as "wontfix" for the time being - so the issue can be left open until we decide that a sane mksunxiboot should have made it everywhere, and the workaround gets finally removed.

n1tehawk avatar May 27 '16 08:05 n1tehawk

Note: U-Boot release v2016.07 contains the related commit that fixes SPL header size, and thus mksunxiboot operation. Images created with this (or a later) version account for the field written by the BROM, i.e. they should no longer suffer from code corruption.

n1tehawk avatar Jul 25 '16 13:07 n1tehawk