From mboxrd@z Thu Jan 1 00:00:00 1970 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 2C1ADC433F5 for ; Tue, 19 Apr 2022 21:28:39 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4B24583D9B; Tue, 19 Apr 2022 23:28:37 +0200 (CEST) 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="eordZbod"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4719683DC5; Tue, 19 Apr 2022 23:28:36 +0200 (CEST) Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (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 0F6E283D87 for ; Tue, 19 Apr 2022 23:28:32 +0200 (CEST) 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-qt1-x82e.google.com with SMTP id hf18so12787336qtb.0 for ; Tue, 19 Apr 2022 14:28:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gF30C1ITeZ+ky+xw4PayP0w20qqwoy89fv4+1jLa0Ww=; b=eordZbodtc6bn1nzls0MDVSqgFEiIvfsbaRCKEtbko45VNajsD5lEHDitRG0qQCcKH JJrds5doShWjmcMzgIK/c7PuDyaZAOSsmabledzCM92lXQpItisoNuUTCIGLEuqN6EbP qrXMHfCm8vFS5E7GOH6vKsIOCKeS4e3pxYrRc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gF30C1ITeZ+ky+xw4PayP0w20qqwoy89fv4+1jLa0Ww=; b=ZQWOkyjhNYG5/TlO/aDYm6LS+5+3FDgolswAN7n5Bu4mNPzUIbnur9w10iXTiBCIfZ dQFsrQ6Qwfonx0SXUbmB4k51NhA52EDyiFXEDYs4zF7kb6cxxMppqnL+SZ8iBrPfpEry yavZJMYB1e1ykfwXOU9Q7RZtSiYfxjq1kUadKswI5UTZH1i5bA1jHjzEV4hRNwiMiynb DVfoIWDFlKcDZC+rbFGKKxn4ylszV+dVGL2YnMdrJ7y9u1GqTLbuyBFCpzwso7dSGlzo nv9d1Le4/YE9F9erYSMCBygBjnEMtXyxz5p86z5CzQjfTIZrjX2q9zbavnrrz1UWiQi/ 58SQ== X-Gm-Message-State: AOAM533CaQ6t2I56KKk2j9Qvt1Mq9w0cOKuJMyIBnomY9XxXcwvuEGy+ zD6z9ixkAzxA2xhWQwavVMFKvhKRxdAA5Q== X-Google-Smtp-Source: ABdhPJy3TXx9LsKsZCa1tdi+e9EIt/oB3QO1PtD87IshJp4E2ilA8pBHrdoE6wChFoQQ2/GEPj3UMQ== X-Received: by 2002:a05:622a:1a11:b0:2f1:f173:b7cc with SMTP id f17-20020a05622a1a1100b002f1f173b7ccmr11531337qtb.318.1650403710830; Tue, 19 Apr 2022 14:28:30 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-2ef0-5dff-fedb-a8ba.res6.spectrum.com. [2603:6081:7b01:cbda:2ef0:5dff:fedb:a8ba]) by smtp.gmail.com with ESMTPSA id a28-20020a05620a02fc00b0069e8e766a0csm555424qko.94.2022.04.19.14.28.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Apr 2022 14:28:30 -0700 (PDT) Date: Tue, 19 Apr 2022 17:28:28 -0400 From: Tom Rini To: Nathan Barrett-Morrison Cc: u-boot@lists.denx.de Subject: Re: Falcon Mode Support For Uncompressed Kernel Images Message-ID: <20220419212828.GT3045430@bill-the-cat> References: <20220131151124.GN7515@bill-the-cat> <20220131153554.GV7515@bill-the-cat> <20220419203029.GA177037@bill-the-cat> <5b260898-686f-0e7c-c3b0-1e327d7b63da@timesys.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="CKf/2jVYos1l2hij" Content-Disposition: inline In-Reply-To: <5b260898-686f-0e7c-c3b0-1e327d7b63da@timesys.com> 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.5 at phobos.denx.de X-Virus-Status: Clean --CKf/2jVYos1l2hij Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 19, 2022 at 05:16:21PM -0400, Nathan Barrett-Morrison wrote: > Hi Tom, >=20 > Let's see if this works any better. Using a new mail client that is supp= osed to not modify whitespace: >=20 > From f1c34333f79996bd2927a60f4858c01699431cba Mon Sep 17 00:00:00 2001 > From: Nathan Barrett Morrison > Date: Wed, 2 Feb 2022 15:05:18 -0500 > Subject: [PATCH v2] Add in the ability to load and boot an uncompressed k= ernel > image during the Falcon Mode boot sequence. >=20 > This is required for architectures which do not support compressed kernel= images (i.e. ARM64). This is only used while not booting via FIT image. >=20 > Signed-off-by: Nathan Barrett-Morrison > Cc: Tom Rini > --- > Changes for v2: > - Remove original SPL_OS_BOOT_UNCOMPRESSED option and check via CMD_BO= OTI and CMD_BOOTZ instead Whitespace is fine, but since it's in reply to the previous email, that really throws patchwork for a loop so this doesn't show up yet. Please do this is a new thread, thanks. >=20 > arch/arm/lib/Makefile | 5 ++++- > common/spl/spl.c | 21 +++++++++++++++++++++ > 2 files changed, 25 insertions(+), 1 deletion(-) >=20 > diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile > index c603fe61bc..08b7475e37 100644 > --- a/arch/arm/lib/Makefile > +++ b/arch/arm/lib/Makefile > @@ -36,7 +36,10 @@ obj-$(CONFIG_CMD_BOOTZ) +=3D bootm.o zimage.o > obj-$(CONFIG_SYS_L2_PL310) +=3D cache-pl310.o > else > obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) +=3D spl.o > -obj-$(CONFIG_SPL_FRAMEWORK) +=3D zimage.o > +ifdef CONFIG_SPL_FRAMEWORK > +obj-$(CONFIG_CMD_BOOTI) +=3D image.o > +obj-$(CONFIG_CMD_BOOTZ) +=3D zimage.o > +endif > obj-$(CONFIG_OF_LIBFDT) +=3D bootm-fdt.o > endif > ifdef CONFIG_ARM64 > diff --git a/common/spl/spl.c b/common/spl/spl.c > index c9750ee163..7b86443f1b 100644 > --- a/common/spl/spl.c > +++ b/common/spl/spl.c > @@ -107,6 +107,11 @@ int __weak bootz_setup(ulong image, ulong *start, ul= ong *end) > { > return 1; > } > + > +int __weak booti_setup(ulong image, ulong *relocated_addr, ulong *size, = bool force_reloc) > +{ > + return 1; > +} > #endif > =20 > /* Weak default function for arch/board-specific fixups to the spl_image= _info */ > @@ -366,6 +371,21 @@ int spl_parse_image_header(struct spl_image_info *sp= l_image, > #endif > =20 > #if CONFIG_IS_ENABLED(OS_BOOT) > +#if defined(CMD_BOOTI) > + ulong start, size; > + > + if (!booti_setup((ulong)header, &start, &size, 0)) { > + spl_image->name =3D "Linux"; > + spl_image->os =3D IH_OS_LINUX; > + spl_image->load_addr =3D start; > + spl_image->entry_point =3D start; > + spl_image->size =3D size; > + debug(SPL_TPL_PROMPT > + "payload Image, load addr: 0x%lx size: %d\n", > + spl_image->load_addr, spl_image->size); > + return 0; > + } > +#elif defined(CMD_BOOTZ) > ulong start, end; > =20 > if (!bootz_setup((ulong)header, &start, &end)) { > @@ -379,6 +399,7 @@ int spl_parse_image_header(struct spl_image_info *spl= _image, > spl_image->load_addr, spl_image->size); > return 0; > } > +#endif > #endif > =20 > if (!spl_parse_board_header(spl_image, bootdev, (const void *)header, = sizeof(*header))) > --=20 > 2.30.2 >=20 > On 4/19/22 16:30, Tom Rini wrote: > > On Wed, Feb 02, 2022 at 04:53:11PM -0500, Nathan Barrett-Morrison wrote: > >> Hi Tom, > >> > >> I've attached version 2 of the patch. I believe this should adhere mo= re > >> closely to your suggestions. > >> > >> Keep in mind, CONFIG_IS_ENABLED will not work for checking > >> CMD_BOOTI/CMD_BOOTZ in this case, as there is no CONFIG_SPL_CMD_BOOTx.= So, > >> I'm just directly checking if it's defined instead. > >> > >> I verified both CONFIG_IS_ENABLED() and IS_ENABLED() did not work. > >> > >> Sincerely, > >> Nathan > >> > >> On Mon, Jan 31, 2022 at 10:35 AM Tom Rini wrote: > >> > >>> On Mon, Jan 31, 2022 at 10:23:58AM -0500, Nathan Barrett-Morrison wro= te: > >>> > >>>> Hi Tom, > >>>> > >>>> Yea, I'm not sure if uncompressed ARM32 would work, but I don't beli= eve > >>> it > >>>> was ever working to begin with... as bootz_setup is being called rig= ht > >>> now > >>>> ( @ > >>> https://source.denx.de/u-boot/u-boot/-/blob/master/common/spl/spl.c#L= 366 > >>>> ) > >>>> > >>>> My intent was for SPL_OS_BOOT_UNCOMPRESSED to only be used for platf= orms > >>>> which need booti_setup (ARM64, ...). > >>>> > >>>> So... I could add a dependency on ARM64 in the config option or I co= uld > >>>> remove the option altogether and let the booti_setup fail and fallba= ck to > >>>> bootz_setup. Would either of those work for you? > >>> > >>> The code and logic overall needs a bit of refactoring to support > >>> "booti", "bootz" and also FIT images. I believe FIT images are how > >>> anyone doing falcon mode on arm64 has worked thus far. booti/bootz > >>> should only be an option when CMD_BOOTI/Z is set, and FIT should depe= nd > >>> on SPL_LOAD_FIT already. > >>> > >>> -- > >>> Tom > >>> > >=20 > >> From 5d37f2a930e7cb3455b6ec925ec6e67b40d4c022 Mon Sep 17 00:00:00 2001 > >> From: Nathan Barrett Morrison > >> Date: Wed, 2 Feb 2022 15:05:18 -0500 > >> Subject: [PATCH v2] Add in the ability to load and boot an uncompresse= d kernel > >> image during the Falcon Mode boot sequence. > >> > >> This is required for architectures which do not support compressed ker= nel images (i.e. ARM64). This is only used while not booting via FIT image. > >> > >> Signed-off-by: Nathan Barrett-Morrison > >> Cc: Tom Rini > >> --- > >> Changes for v2: > >> - Remove original SPL_OS_BOOT_UNCOMPRESSED option and check via CMD= _BOOTI and CMD_BOOTZ instead > >> > >> arch/arm/lib/Makefile | 5 ++++- > >> common/spl/spl.c | 21 +++++++++++++++++++++ > >> 2 files changed, 25 insertions(+), 1 deletion(-) > >> > >> diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile > >> index c48e1f622d..57e49f69f7 100644 > >> --- a/arch/arm/lib/Makefile > >> +++ b/arch/arm/lib/Makefile > >> @@ -36,7 +36,10 @@ obj-$(CONFIG_CMD_BOOTZ) +=3D bootm.o zimage.o > >> obj-$(CONFIG_SYS_L2_PL310) +=3D cache-pl310.o > >> else > >> obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) +=3D spl.o > >> -obj-$(CONFIG_SPL_FRAMEWORK) +=3D zimage.o > >> +ifdef CONFIG_SPL_FRAMEWORK > >> +obj-$(CONFIG_CMD_BOOTI) +=3D image.o > >> +obj-$(CONFIG_CMD_BOOTZ) +=3D zimage.o > >> +endif > >> obj-$(CONFIG_OF_LIBFDT) +=3D bootm-fdt.o > >> endif > >> ifdef CONFIG_ARM64 > >> diff --git a/common/spl/spl.c b/common/spl/spl.c > >> index f51d1f3205..1f6b3f1ac8 100644 > >> --- a/common/spl/spl.c > >> +++ b/common/spl/spl.c > >> @@ -104,6 +104,11 @@ int __weak bootz_setup(ulong image, ulong *start,= ulong *end) > >> { > >> return 1; > >> } > >> + > >> +int __weak booti_setup(ulong image, ulong *relocated_addr, ulong *siz= e, bool force_reloc) > >> +{ > >> + return 1; > >> +} > >> #endif > >> =20 > >> /* Weak default function for arch/board-specific fixups to the spl_im= age_info */ > >> @@ -354,6 +359,21 @@ int spl_parse_image_header(struct spl_image_info = *spl_image, > >> #endif > >> =20 > >> #if CONFIG_IS_ENABLED(OS_BOOT) > >> +#if defined(CMD_BOOTI) > >> + ulong start, size; > >> + > >> + if (!booti_setup((ulong)header, &start, &size, 0)) { > >> + spl_image->name =3D "Linux"; > >> + spl_image->os =3D IH_OS_LINUX; > >> + spl_image->load_addr =3D start; > >> + spl_image->entry_point =3D start; > >> + spl_image->size =3D size; > >> + debug(SPL_TPL_PROMPT > >> + "payload Image, load addr: 0x%lx size: %d\n", > >> + spl_image->load_addr, spl_image->size); > >> + return 0; > >> + } > >> +#elif defined(CMD_BOOTZ) > >> ulong start, end; > >> =20 > >> if (!bootz_setup((ulong)header, &start, &end)) { > >> @@ -367,6 +387,7 @@ int spl_parse_image_header(struct spl_image_info *= spl_image, > >> spl_image->load_addr, spl_image->size); > >> return 0; > >> } > >> +#endif > >> #endif > >> =20 > >> if (!spl_parse_board_header(spl_image, (const void *)header, sizeof= (*header))) > >=20 > > Sorry for the late response. Attached patches aren't picked up by > > patchwork. I think this looks OK, but can you please re-send it > > directly rather than as attachment? Thanks. > >=20 --=20 Tom --CKf/2jVYos1l2hij Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmJfKXwACgkQFHw5/5Y0 tyxlhgv/QHAfJnDVjJdbreaH5MZtDsLU9Vn759WTVKTSL/It0/DBB3G2bKUk8Q1F aeU+qN2xWJhRxRcBWMSriLuySxPQiGndkhCAWBLUvW0iPNlR0wCaV/UUAsxX+3Pq GqVxCfNZI1My0Nn8QQmVIjDi7AKIvujIYU/Tww2NpnGKWdf43TS7H/td0HGKio5X 4UWOZqWbk3RDlCCVRdNQ/lX8Yhv/yXpBpMwR3KKPsBSHULxmLgf2sqOkUXE0QNo8 jMBWR1s7/cBq0YwsFyYrfjHNTT0kOH5zldHYe8DO4wU4/8iTqvrck6ZI0Jw4Vz1x 2T+C4tUp7G3xH8yiEB3VYgEPCXgaLMQaMq0Zn+Esi1/V34T/daBbsjtozm7y6kX3 yB43R4z8b1eDpNxSBO2L3LC6+y4DlVKM9RMXd4sCE6mU4rA5ZXBoXUuMg05JGteK UkcKh1Sy/bpkhpchWPaeL0rI/HXjlL2Ne9F9jfVzlSf2D2VtUtebbtZ9zXPVccms A8UN9Q9r =FgP9 -----END PGP SIGNATURE----- --CKf/2jVYos1l2hij--