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 6C947C001E0 for ; Mon, 31 Jul 2023 16:00:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2D085866FB; Mon, 31 Jul 2023 18:00:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="kL5SqsLW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E34C086607; Mon, 31 Jul 2023 18:00:26 +0200 (CEST) Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (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 76C96867C3 for ; Mon, 31 Jul 2023 18:00:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd30.google.com with SMTP id ca18e2360f4ac-78374596182so223694539f.0 for ; Mon, 31 Jul 2023 09:00:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1690819221; x=1691424021; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hLutOWlc/WmA51t5vkOpkGTQS6RnPeqnoszLqydI4WI=; b=kL5SqsLWPO9ZKY3kiCuT75MA+CERWs1H9xtd2PviJKaB8zEUu6SMCZ6+V3VWu+i5Zu sg6xpfW6A9SFeTNM/MabbuIWenrMRFjXnjYC38pA8wuzfHiJuX7IsSkPVZTyW0+K4gOw ASj+a7HC4ALsHh07TYGk1HrDNzwHDdt7Fx4pI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690819221; x=1691424021; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hLutOWlc/WmA51t5vkOpkGTQS6RnPeqnoszLqydI4WI=; b=PHbZSb7RX9aO682yOknAunaJPGynXSoKbBAi5+86RHWFO/4yTNluI1+dxOTvmMhp3s kv76eA8DZrFL0pTRUz7WU9Otmvf+/ykyf3S8kAxe3sFnGm57o4sp+vxs4dM/8t6HWb25 nQ0Fy+HgXC15lzPNSlAnKX+d4hLNBKiU79x0Au7c69905Y+ecvAtFAmzbTbMhUA3TT5y tUsRwFVyvB+2+KFeq1RxNaRtzLfMitmU0sgUZ1YV00VyBLrAAUTUkfn5GpFtbH33RGef nFewVHzlkN3xGtdtJfQw05LLLGIKLP7SWolly6kaVxhYuZmMaL1lZMeUkw8FpSOrTRLS tk8Q== X-Gm-Message-State: ABy/qLZ5NvW6zzhmJ9jkQ8HaveOuPp4LLci1LfZjzC0pXA0lbacNo8g8 YQo6h7nkeQFMmSZlXas8l+axaUU3529BeMQQoK0= X-Google-Smtp-Source: APBJJlGOMzdbhWncY2FJ9g2Nb7b9/5P/d+iP6mkcWxgW6zEPKsswSfPiuRAQARCFeLs4S0JN4VCY5A== X-Received: by 2002:a6b:4003:0:b0:78b:b892:e334 with SMTP id k3-20020a6b4003000000b0078bb892e334mr3110854ioa.11.1690819220974; Mon, 31 Jul 2023 09:00:20 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:92f1:4552:f537:69a4]) by smtp.gmail.com with ESMTPSA id r16-20020a02c850000000b0042ad887f705sm3175466jao.143.2023.07.31.09.00.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 09:00:20 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Nikhil M Jain , Anatolij Gustschin , Devarsh Thakkar , Michal Suchanek , Ovidiu Panait , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Rasmus Villemoes , Stefan Roese Subject: [PATCH v3 5/9] board_f: Fix corruption of relocaddr Date: Mon, 31 Jul 2023 09:59:56 -0600 Message-ID: <20230731160008.82342-5-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 When the video framebuffer comes from the bloblist, we should not change relocaddr to this address, since it interfers with the normal memory allocation. This fixes a boot loop in qemu-x86_64 Signed-off-by: Simon Glass Fixes: 5bc610a7d9d ("common: board_f: Pass frame buffer info from SPL to u-boot") Suggested-by: Nikhil M Jain --- Changes in v3: - Reword the Kconfig help as suggested Changes in v2: - Add a Kconfig as the suggested conditional did not work common/board_f.c | 3 ++- drivers/video/Kconfig | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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 = ho->fb; + if (IS_ENABLED(CONFIG_VIDEO_RESERVE_SPL)) + gd->relocaddr = 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. +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 config SPL_SPLASH_SCREEN_ALIGN -- 2.41.0.487.g6d72f3e995-goog