Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6DA3BC4332F for ; Tue, 13 Dec 2022 16:25:03 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CAA7884D85; Tue, 13 Dec 2022 17:25:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="KGupJN7H"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 022A784EA1; Tue, 13 Dec 2022 17:24:59 +0100 (CET) Received: from mail-vs1-xe31.google.com (mail-vs1-xe31.google.com [IPv6:2607:f8b0:4864:20::e31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6861E84D70 for ; Tue, 13 Dec 2022 17:24:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-vs1-xe31.google.com with SMTP id f189so15140375vsc.11 for ; Tue, 13 Dec 2022 08:24:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=pZIJDdSBIDALbIbbS1SV4ZPaVZRujg9kaQq0a1dURvI=; b=KGupJN7H8DL1CIMQ+oeLzYjJdG7CEvj3wahnEpqFhhsRbB/nTcFrfVcfFR2xGJe0Qk BSl6u8Om98vMpOygEKypRW1EFueiVZohwvI4NbZIUsIZn0Kf6Atl70r46BLQYN1QcYBV IbLYoBP4IABpeaAmntOpTD2OkOli+QExI3ljY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pZIJDdSBIDALbIbbS1SV4ZPaVZRujg9kaQq0a1dURvI=; b=G3jE+AM1NGeY/TqYi6PxzbF4SSX7omVWF8OpN/Uw4aMwx2yW/jP1x4mxIoUuoMFpso DT+Wq966o28/S+6frXwN6NAVJAzBdobCSFOFq7pVWK68LVaK34ZWusiJ6wg7LEZSepiN EL0pTjKrzlPXK1OJGZdqAIQqMs1b+7qAMD23fbqDLD3FXLawiXfirC/FJT2Vm77F7auM wyznB3UTH4oNDeUy9QpENyaa0Bs2oi68rIgUD5gpx3MdZvZGsc3qjDCUt6c6/sbkFzhq Ptk6yqsY9jhzx0pgZ8r5d3OzsmbFmmF7HTum55nsIvngRgQO64uK+t+Dr09sIc8t8CbA 9BwQ== X-Gm-Message-State: ANoB5plY3Sq1qq/kpRkrGSA+/FWycF7mSpC8Z6MQiUx+sBt8LdwD2GUW N5tG1XCYqDGmt0lZor78bu9A0Q== X-Google-Smtp-Source: AA0mqf6yzlLrn2hNZSUex9g5bJt+gmpAfiPO/pS10NOClhDNZR8DOht9oXfnvpfEeo7NhV/Zx3xYaA== X-Received: by 2002:a67:d796:0:b0:3b1:fde0:8255 with SMTP id q22-20020a67d796000000b003b1fde08255mr11920956vsj.0.1670948695116; Tue, 13 Dec 2022 08:24:55 -0800 (PST) Received: from bill-the-cat (2603-6081-7b00-6400-09de-b540-f7da-b28e.res6.spectrum.com. [2603:6081:7b00:6400:9de:b540:f7da:b28e]) by smtp.gmail.com with ESMTPSA id w4-20020a05620a424400b006a6ebde4799sm8206694qko.90.2022.12.13.08.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Dec 2022 08:24:54 -0800 (PST) Date: Tue, 13 Dec 2022 11:24:52 -0500 From: Tom Rini To: Rick Chen Cc: Sean Anderson , Rick Chen , 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 Message-ID: <20221213162452.GX3787616@bill-the-cat> References: <20221207062334.21292-1-rick@andestech.com> <1162c5df-dcfc-0908-1d07-32145e3a6aaa@gmail.com> <20221209220723.GS3787616@bill-the-cat> <20221212150315.GS3787616@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="I4v642SBYP+0WzS3" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean --I4v642SBYP+0WzS3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 13, 2022 at 08:42:47AM +0800, Rick Chen wrote: > Hi Sean, >=20 > > 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 c= alled > > >>>> fastboot in-tree (the Android-derived protocol) and there's a Micr= osoft > > >>>> technology called fastboot (some kind of hibernation). "OS Boot" i= sn'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 O= S. > > >>>> > > >>>> (Is this substantially different from falcon mode anyway?) > > >>> > > >>> I was kind of wondering if this is different, really, from Falcon M= ode. > > >>> Falcon Mode didn't initially have to factor in other-firmware as th= at'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= =3Dy). > > >> When I try to enable SPL_OS_BOOT, it will encounter that SYS_SPL_ARG= S_ADDR and > > >> jump_to_image_linux() shall be defined but they are un-necessary f= or RISC-V. > > >> Because the flow of OpenSBI and SPL_OS_BOOT are totally different co= de > > >> 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 t= he > > > 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 >=20 > 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 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. --=20 Tom --I4v642SBYP+0WzS3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmOYp1EACgkQFHw5/5Y0 tyxiPgv/WVXI31l5dhoyJv1va2uwoUG06CkFV+0KuV3H9AJr2Yz8HwmjyQ9ed9C6 YRSz4NWlZXeI9dYMLSJoE6Hk4M2Ondt45WN2NugtwX+BBBVseiLeZDMtGD28ela9 Ue8/O3/K1XJPdK/DShlgdBIiWPaQcY5Ulyh5hbi8vK/7wx9YBy5QS97YIXZZvX10 JYjdZiYKEmYpP8k0XFBwAGF2aiPMY00xgfzLL4b8AZlIH5SmR8A7b0f5xvtcM6I3 5J6SjZvhmgoYwL4A5JEFcGtW6m1FQmTLueYfk144C1UTYPgPEYB+I3/xdNynUaEe pd39iwpUpYQz7Tz1UubUNNsnxEdddqbSwAgTptA+94Og+ZpP5OKtw5z0psgzKEfz uWeoVehVU/Ml4SYbnSDawMadoMLJYuzxVZerMWNZuVAVt/3tw/NYnkjw+y48ye5m DLojrv+fOnWt1t5iKSRAnS4RDJtcDZp2R490uNMRIsS/YZjFJBPOKvOgJeJbiHPa t3rW0k4O =N/2L -----END PGP SIGNATURE----- --I4v642SBYP+0WzS3--