[U-Boot-Custodians] SPL / TPL【请注意,邮件由u-boot-custodians-bounces at lists.denx.de代发】

Kever Yang kever.yang at rock-chips.com
Fri Oct 11 04:39:15 UTC 2019


Hi Masahiro,

On 2019/10/11 上午11:10, Masahiro Yamada wrote:
> On Fri, Oct 11, 2019 at 4:08 AM Tom Rini <trini at konsulko.com> wrote:
>> On Thu, Oct 10, 2019 at 09:46:38AM +0200, Marek Vasut wrote:
>>> On 10/10/19 9:40 AM, Wolfgang Denk wrote:
>>>> Dear Masahiro,
>>>>
>>>> In message <CAK7LNAR45-6SEAeGyjT8o5jP=6iNcSP=A4pW2rQV9V_JfGTi0w at mail.gmail.com> you wrote:
>>>>> This discussion started from this patch:
>>>>> https://patchwork.ozlabs.org/patch/662396/
>>>>>
>>>>> It happened before the rockchip stuff.
>>>> Yes, thanks for the link. Apparently I missed that discussion then :-(
>>>>
>>>> I still cannot see where this thinking that "SPL is big and has all
>>>> features" and "TPL is small" is coming from.  If someone has
>>>> implemented it in this way, then he did a major mistake.
>>> Note that back in the old OneNAND days, TPL was used as the 1 kiB tiny
>>> loader and that loaded the SPL. Even today, there are less features
>>> available for TPL than for SPL, although they are constantly being added
>>> to make these two things virtually identical. So I have a feeling that
>>> this situation naturally evolved that TPL is smaller than SPL and goes
>>> before SPL.
>>>
>>> Just out of curiosity, how many platforms are there that do
>>> SPL->TPL->U-Boot and how many do TPL->SPL->U-Boot ?
>> This last point here is what I'm also wondering about.
>
> You can check that by building every board with CONFIG_TPL=y,
> and comparing the sizes between SPL and TPL.
>
>
>
> For example, I built  evb-rk3229_defconfig, and got this:
>
> $ arm-linux-gnueabihf-size   spl/u-boot-spl
>     text    data     bss     dec     hex filename
>    32818    1836      20   34674    8772 spl/u-boot-spl
> $ arm-linux-gnueabihf-size   tpl/u-boot-tpl
>     text    data     bss     dec     hex filename
>    19558    2516      76   22150    5686 tpl/u-boot-tpl
>
>
> TPL is smaller than SPL, so the rockchip platforms work
> in the boot order of TPL -> SPL -> U-Boot
>
>
> As for rockchip cases, TPL is smaller than SPL, but
> is not as small as 4KB.
>
> Was the 3-stage bootstrap needed
> in the first place?

Yes, it's needed, and Rockchip case is pretty clear.
TPL(run in IRAM) used for DRAM init only, and SPL(run in DRAM) for next 
stage image loading including U-Boot proper,
ATF, OP-TEE or maybe even kernel image in falcon mode.
Some SoC's IRAM size are designed for DRAM init only, and not enough 
space for other program.

Thanks,
- Kever
>
>
>> My gut is that
>> README.TPL is more "old aspiration" than "what we have implemented".
>> And, setting aside some of the back-and-forth jumps we can have, the
>> flow is:
>> ROM/etc -> Tiny Program Loader -> SPL -> U-Boot or Linux
>>
>> and CONFIG_TPL_xxx is used to control the building, or not building, of
>> various portions.
>>
>> --
>> Tom
>> _______________________________________________
>> U-Boot-Custodians mailing list
>> U-Boot-Custodians at lists.denx.de
>> https://lists.denx.de/listinfo/u-boot-custodians
>
>




More information about the U-Boot-Custodians mailing list