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 82C48C00528 for ; Mon, 31 Jul 2023 19:32:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4C98D868C1; Mon, 31 Jul 2023 21:32:23 +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="FADOzIiq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2DAA0867C3; Mon, 31 Jul 2023 21:32:21 +0200 (CEST) Received: from mail-yw1-x1135.google.com (mail-yw1-x1135.google.com [IPv6:2607:f8b0:4864:20::1135]) (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 9856186941 for ; Mon, 31 Jul 2023 21:32:16 +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-yw1-x1135.google.com with SMTP id 00721157ae682-583c48a9aa1so51241817b3.1 for ; Mon, 31 Jul 2023 12:32:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1690831935; x=1691436735; 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=YRFtthFnrQdwMV1B3VWlJNqbaKNCNoLyP/Pwchlfks4=; b=FADOzIiql1uQ1PXu8FiB5rHMoJ9kGOHDsJKWdjRSVAWAxNcvMJu/SBBeO5w5RVp0eE LXg9+L4djwSt5aqgb83WxdUstCR+p+hS5Fy33S6/rQjqV7xC4clLSOSX3Kt+N20zY2z7 sI4H3M95seasSWKqi6Vaau9I4b0cddXZ+t0uo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690831935; x=1691436735; 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=YRFtthFnrQdwMV1B3VWlJNqbaKNCNoLyP/Pwchlfks4=; b=kEtWlxAv5kQN4B0DWn5x0Zn/XLCDVRUVkruMgTmIeWh7sGmQklbSAEsRJQ7Jhog7J2 06yG30BXybfhL7Jlm+zAjVL3iDdfQj0pk5/72c5O6MBwSEUeKwE2LKJBJ12VUmMVm2kM WiHH0YrRdXygwhMuznp2nhm+pH+5RdCiBy+EceSOgarkM4Oz0P+xVdl5JhVGFp9d8Pen Do+X49qaofHFqFWHGBklhRNO7UNe8+8YTg/bveQ6iGjI2AcS0cTt6SUjEHYp9wVihz3Q dE61QQtWO3MLwKfhMkvCS+hak+nopgbh3oXXjVjg1JngG76qguZ1d7WLc2wzH3CVyd7s 1IcA== X-Gm-Message-State: ABy/qLb20OrfoCzfrOyTM695EMja94/d44Gmg26z9lCUsHUI3yjA3R21 uhq/RDR5q2M+R3tSq3PWJzrErg== X-Google-Smtp-Source: APBJJlG5d0gFfbFhkSitAPi5F+CapOIIacGPOC71R8wX9qSmOC8cB51hOzFSFfnklkFeHg/jnOJ6pg== X-Received: by 2002:a81:5dc3:0:b0:583:b2a3:f780 with SMTP id r186-20020a815dc3000000b00583b2a3f780mr9299727ywb.49.1690831935272; Mon, 31 Jul 2023 12:32:15 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-7e50-54e3-e9cb-536d.res6.spectrum.com. [2603:6081:7b00:6400:7e50:54e3:e9cb:536d]) by smtp.gmail.com with ESMTPSA id g62-20020a0df641000000b0057060bb2874sm3223704ywf.37.2023.07.31.12.32.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 12:32:14 -0700 (PDT) Date: Mon, 31 Jul 2023 15:32:12 -0400 From: Tom Rini To: Simon Glass Cc: U-Boot Mailing List , Bin Meng , Nikhil M Jain , Anatolij Gustschin , Devarsh Thakkar , Michal Suchanek , Ovidiu Panait , Pali =?iso-8859-1?Q?Roh=E1r?= , Rasmus Villemoes , Stefan Roese Subject: Re: [PATCH v3 5/9] board_f: Fix corruption of relocaddr Message-ID: <20230731193212.GE3630934@bill-the-cat> References: <20230731160008.82342-5-sjg@chromium.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="X2e0mxoEGd1TES28" Content-Disposition: inline In-Reply-To: <20230731160008.82342-5-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean --X2e0mxoEGd1TES28 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 31, 2023 at 09:59:56AM -0600, Simon Glass wrote: > When the video framebuffer comes from the bloblist, we should not change > relocaddr to this address, since it interfers with the normal memory > allocation. >=20 > This fixes a boot loop in qemu-x86_64 >=20 > Signed-off-by: Simon Glass > Fixes: 5bc610a7d9d ("common: board_f: Pass frame buffer info from SPL to = u-boot") > Suggested-by: Nikhil M Jain > --- >=20 > Changes in v3: > - Reword the Kconfig help as suggested >=20 > Changes in v2: > - Add a Kconfig as the suggested conditional did not work >=20 > common/board_f.c | 3 ++- > drivers/video/Kconfig | 9 +++++++++ > 2 files changed, 11 insertions(+), 1 deletion(-) >=20 > diff --git a/common/board_f.c b/common/board_f.c > index 7d2c380e91e..5173d0a0c2d 100644 > --- a/common/board_f.c > +++ b/common/board_f.c > @@ -419,7 +419,8 @@ static int reserve_video(void) > if (!ho) > return log_msg_ret("blf", -ENOENT); > video_reserve_from_bloblist(ho); > - gd->relocaddr =3D ho->fb; > + if (IS_ENABLED(CONFIG_VIDEO_RESERVE_SPL)) > + gd->relocaddr =3D ho->fb; > } else if (CONFIG_IS_ENABLED(VIDEO)) { > ulong addr; > int ret; > diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig > index b41dc60cec5..f2e56204d52 100644 > --- a/drivers/video/Kconfig > +++ b/drivers/video/Kconfig > @@ -1106,6 +1106,15 @@ config SPL_VIDEO_REMOVE > if this option is enabled video driver will be removed at the end of > SPL stage, beforeloading the next stage. > =20 > +config VIDEO_RESERVE_SPL > + bool > + help > + This adjusts reserve_video() to redirect memory reservation when it > + sees a video handoff blob (BLOBLISTT_U_BOOT_VIDEO). This avoids the > + memory used for framebuffer from being allocated by U-Boot proper, > + thus preventing any further memory reservations done by U-Boot proper > + from overwriting the framebuffer. > + > if SPL_SPLASH_SCREEN > =20 > config SPL_SPLASH_SCREEN_ALIGN Nothing selects this and it's not offered as a choice, so now we've just broken the original case? --=20 Tom --X2e0mxoEGd1TES28 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmTIDDkACgkQFHw5/5Y0 tyyTLgv+PQ/xBXPkySAo9H3x4WFSzWZUqsVo0jpA2/KIIIDhla3tZ3z9N3JV1cMn I/7mzoadVJEPbZDLFfzCZA3CMZuTTX2hgyFz++z4QLgbMvg7wISsyxsLgUmUv81C cRIxiZ17gNuE83jU1Pvh6yzW/LyeqwVn8GawikWHLfe9w99uoH53/jn3bmMcuybX dzMwigXeNld38s5u3MZGY5zsB0WGgtCEtRpCk6FrwjTOAYYGtol7TIwk6+sqTtkC vRArJ83PNMjENMw/BrdowIA2mi1y/ML8fdADwU60e2eB6/G7DCyPPNs25z1rxg9F r49bQ4ZsGOUu+eNXJeqVlMa7OAKqUbZh9n/vO5NKLljiyNV+UCoyKJSNEYmUHvSe UH6Ub6rYkIN2uo1gcWnNaDGc8BwWvyr3otnNPjWszMxNFmkbKpVhbHCisAwT2c0R BHwKb88iBYf7PDtwrbpwRC6ATOfmyioReBx/EzN4k+22Qt6EqDibp0fwIDr656qQ A1Heumz6 =fZ6d -----END PGP SIGNATURE----- --X2e0mxoEGd1TES28--