From: Sean Anderson <seanga2@gmail.com>
To: Tom Rini <trini@konsulko.com>, Rick Chen <rickchen36@gmail.com>
Cc: Rick Chen <rick@andestech.com>,
ycliang@andestech.com, u-boot@lists.denx.de, sjg@chromium.org,
xypron.glpk@gmx.de
Subject: Re: [PATCH 1/4] riscv: spl: Introduce SPL_OPENSBI_OS_BOOT
Date: Tue, 13 Dec 2022 21:01:13 -0500 [thread overview]
Message-ID: <2806e0d0-b434-08bd-0ee6-cc3e4fd704c4@gmail.com> (raw)
In-Reply-To: <20221213162452.GX3787616@bill-the-cat>
On 12/13/22 11:24, Tom Rini wrote:
> On Tue, Dec 13, 2022 at 08:42:47AM +0800, Rick Chen wrote:
>> Hi Sean,
>>
>>> On 12/12/22 10:03, Tom Rini wrote:
>>>> On Mon, Dec 12, 2022 at 02:45:10PM +0800, Rick Chen wrote:
>>>>> Hi Tom
>>>>>
>>>>>> On Fri, Dec 09, 2022 at 08:48:37AM -0500, Sean Anderson wrote:
>>>>>>> On 12/7/22 01:23, Rick Chen wrote:
>>>>>>>> In RISC-V, it only provide normal mode booting currently.
>>>>>>>> To speed up the booting process, here provide SPL_OPENSBI_OS_BOOT
>>>>>>>> to achieve this feature which will be call Fast-Boot mode. By
>>>>>>>
>>>>>>> Can you name this something different. We already have something called
>>>>>>> fastboot in-tree (the Android-derived protocol) and there's a Microsoft
>>>>>>> technology called fastboot (some kind of hibernation). "OS Boot" isn't
>>>>>>> very specific either, since we (almost always) boot an OS. Maybe "Eagle
>>>>>>> mode" by analogy to Falcon mode, which lets SPL directly boot an OS.
>>>>>>>
>>>>>>> (Is this substantially different from falcon mode anyway?)
>>>>>>
>>>>>> I was kind of wondering if this is different, really, from Falcon Mode.
>>>>>> Falcon Mode didn't initially have to factor in other-firmware as that's
>>>>>> not a hard requirement on arm32 like it is on arm64 or risc-v. But my
>>>>>> first read of this was that it seems like the RISC-V specific side of
>>>>>> doing Falcon Mode and dealing with the prior stage needs correctly.
>>>>>>
>>>>>
>>>>> Yes. It is a little bit different from the Falcon mode (SPL_OS_BOOT=y).
>>>>> When I try to enable SPL_OS_BOOT, it will encounter that SYS_SPL_ARGS_ADDR and
>>>>> jump_to_image_linux() shall be defined but they are un-necessary for RISC-V.
>>>>> Because the flow of OpenSBI and SPL_OS_BOOT are totally different code
>>>>> flow in board_init_r() of common/spl/spl.c.
>>>>> That is why I added a new symbol called SPL_OPENSBI_OS_BOOT for this
>>>>> RISC-V fast boot implementation.
>>>>
>>>> Those sound like fairly minor challenges for the same fundamental
>>>> concept. We have SYS_SPL_ARGS_ADDR for "where is the device tree to
>>>> pass along". We might need to do a little code re-factoring here. But
>>>> maybe also a little bit of explaining why we wouldn't be booting to the
>>>> OS directly but instead passing back to openSBI to do this? That's not
>>>> normally how RISC-V boots the OS, right? Or am I miss-understanding
>>>> something here?
>>>>
>>>
>>> The usual process is
>>>
>>> ROM -> SPL -> SBI -> U-Boot -> Linux
>>
>> In RISC-V, Linux runs in S-mode, it needs the OpenSBI which plays as
>> M-mode to deal with SBI calls at run-time.
>> So the fast boot idea, I just want to bypass U-Boot and jump to Linux
>> directly and Linux still needs OpenSBI.
>> Hence SPL_OPENSBI can't be disabled here.
>
> So is the flow here:
> a) ROM -> SPL -> SBI -> SPL -> Linux
> or
> b) ROM -> SPL -> SBI -> Linux
The latter. The regular boot is
(M) Boot ROM loads SPL and executes it
(M) SPL loads SBI and U-Boot proper and executes SBI
(M) SBI performs initialization and executes U-Boot
(S) U-Boot loads Linux and executes it
(S) Linux boots
And this would change that to
(M) Boot ROM loads SPL and executes it
(M) SPL loads SBI and Linux and executes SBI
(M) SBI performs initialization and executes Linux
(S) Linux boots
So the idea here is to load Linux in SPL instead of U-Boot. But I think this is
the only way to go for platforms which use OpenSBI. Regular falcon mode would
require a Linux which runs in M-mode. So I don't think we need a separate config.
--Sean
> It's not clear to me, and I think that'll help figure out what's best
> here. Since I kinda think we're looking at a more generic issue that we
> see with newer architectures and maybe we already had to solve this (but
> didn't name things well enough) for aarch64.
>
next prev parent reply other threads:[~2022-12-14 2:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-07 6:23 [PATCH 1/4] riscv: spl: Introduce SPL_OPENSBI_OS_BOOT Rick Chen
2022-12-07 6:23 ` [PATCH 2/4] riscv: dts: Support Fast-Boot Rick Chen
2022-12-07 6:23 ` [PATCH 3/4] riscv: ae350: Support Fast Boot Rick Chen
2022-12-07 6:23 ` [PATCH 4/4] doc: ae350: Add Fast Boot description Rick Chen
2022-12-09 13:48 ` [PATCH 1/4] riscv: spl: Introduce SPL_OPENSBI_OS_BOOT Sean Anderson
2022-12-09 22:07 ` Tom Rini
2022-12-12 6:45 ` Rick Chen
2022-12-12 15:03 ` Tom Rini
2022-12-13 0:31 ` Sean Anderson
2022-12-13 0:42 ` Rick Chen
2022-12-13 16:24 ` Tom Rini
2022-12-14 2:01 ` Sean Anderson [this message]
2022-12-14 6:32 ` Rick Chen
2022-12-13 1:31 ` Rick Chen
2022-12-12 7:49 ` Rick Chen
2022-12-12 15:52 ` Tom Rini
2022-12-13 2:06 ` Rick Chen
2022-12-13 16:27 ` Tom Rini
2022-12-14 0:49 ` Rick Chen
2022-12-14 1:54 ` Tom Rini
2022-12-14 2:14 ` Rick Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2806e0d0-b434-08bd-0ee6-cc3e4fd704c4@gmail.com \
--to=seanga2@gmail.com \
--cc=rick@andestech.com \
--cc=rickchen36@gmail.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
--cc=ycliang@andestech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox