Boot Linux FIT image from SPL

Fabio Estevam festevam at gmail.com
Thu Dec 30 22:42:02 CET 2021


Hi Sven,

On Thu, Dec 30, 2021 at 6:22 PM Sven Schwermer <sven at svenschwermer.de> wrote:
>
> Hi Fabio,
>
> Thank you for the hint. That's a _very_ useful document. In the
> meantime, I have been able to boot my Linux FIT image straight from SPL
> on my i.MX6ULL platform.

Glad you got it to work. It would be nice if you could submit a patch
adding a document
adapted for i.MX6ULL.

> I have, however, noticed that Linux boots much faster when launched from
> u-boot proper compared to SPL. Time to (initramfs) init is 1.2s vs. 5s.
> That is with identical FIT images (kernel, device tree, initramfs,
> kernel command line). I ruled out differing core clock rates (both run
> at 396MHz), caches (caches seem to be disabled before handing over to
> Linux) and differing load addresses (might cause additional relocations,
> copies).
>
> What other setup could u-boot proper do that would make Linux boot
> faster that I haven't thought about?

Looking at your previous log, I see that you boot from serial download mode.

I recall seeing such a slow boot behavior when booting from SDP and
this was fixed by the following commit:

commit c5437e5b8aff9c952ebaab9be7670439c141e4e7
Author: Ye Li <ye.li at nxp.com>
Date:   Mon May 14 09:44:29 2018 -0300

    imx: Enable ACTLR.SMP bit for all i.MX cortex-a7 platforms

    According to the Cortex-A7 TRM, for ACTLR.SMP bit "You must ensure this bit
    is set to 1 before the caches and MMU are enabled, or any cache and TLB
    maintenance operations are performed".
    ROM sets this bit in normal boot flow, but when in serial download mode,
    it is not set.
    Here we add it in u-boot as a common flow for all i.MX cortex-a7 platforms,
    including mx7d, mx6ul/ull and mx7ulp.

    Signed-off-by: Ye Li <ye.li at nxp.com>
    [fabio: adapted to U-Boot mainline codebase and make checkpatch happy]
    Signed-off-by: Fabio Estevam <fabio.estevam at nxp.com>

Such slow boot is not observed if you boot from other media, such as
eMMC, for example.

You could try performing the setting of ACTLR.SMP bit inside SPL.
Currently, it is done only inside U-Boot proper.

Hope this helps.


More information about the U-Boot mailing list