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 EE102C001DF for ; Sun, 30 Jul 2023 17:18:12 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B626B86A86; Sun, 30 Jul 2023 19:16:49 +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="UUS5mpqy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1FA4F8692B; Sun, 30 Jul 2023 19:16:36 +0200 (CEST) Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) (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 910C286A2A for ; Sun, 30 Jul 2023 19:16:29 +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-il1-x133.google.com with SMTP id e9e14a558f8ab-3490cce32c4so9761665ab.0 for ; Sun, 30 Jul 2023 10:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1690737388; x=1691342188; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AVA5DWFzy51V43miGEIicU7wHMpdytAf+GI+rj0qFU8=; b=UUS5mpqywn8rlZnTjaJ6Ugcuzk+uuA5u1Dx2Z5P4O2Lzo/BMcwseRYPwX6sg/9446G 8Gk0tCqZma37jU3sOndXzEYHPGX3LtqWyW5uioX0uRO7hLn57rIIjpc3TKbllqCWTAT9 VImsJCipEp1pHuvz3pMhDhpDjaV7a6YjGb0mg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690737388; x=1691342188; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AVA5DWFzy51V43miGEIicU7wHMpdytAf+GI+rj0qFU8=; b=Q0f3u3Lcr2UjiY0NblHwj1NErBzCxlOWm/xK+pgvcpLjua6aoUKT5RUUVkpgKGX4h7 fnlbPfeXSHlOuyt4QbV1RIISsSaxJX8QwfiUnaVIu8/U9ktxoJkJmslJEfuyG2rcVTuu Hn7J9KaDJfKzkyknxzuTtsgGkaKYBqltLS0t9OgsHhMj4P2roDfKUuRf5jTn5pU7a/Ut Y8r+9ifaU/yEqcw+W0P19uO24HBWzhx7RoLfV6tRqknfLDDtDRmnjExgRCDCDLx1jZpc t8DTS8auywObVo+L7R7+WXZLR6WUoW0TdskEf40orHxl0fh9iQK1NSuLVqjWlc8C6yOs 4rPQ== X-Gm-Message-State: ABy/qLbs+BmvxSEz3519aGwvSsof91LLbF4Gx8YU5cdQ8hSo1Ruolt8R 9xMSedxBwds8PGFRjE1cQyASq3PsVPBcLeOu1O4= X-Google-Smtp-Source: APBJJlF79kTmka/sacrStuaBho/Vk2uHjKmjKsXybxDvPDgy9yVa4zwFQI4/c4pMHg+nVG5+3a7LjA== X-Received: by 2002:a05:6e02:1ca2:b0:349:785:adad with SMTP id x2-20020a056e021ca200b003490785adadmr7764234ill.10.1690737388169; Sun, 30 Jul 2023 10:16:28 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id l1-20020a02cd81000000b0042b57bbbaf2sm2519732jap.26.2023.07.30.10.16.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jul 2023 10:16:27 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Bin Meng , Nikhil M Jain , Anatolij Gustschin , Devarsh Thakkar , Michal Suchanek , Ovidiu Panait , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Rasmus Villemoes , Stefan Roese Subject: [PATCH v2 5/9] board_f: Fix corruption of relocaddr Date: Sun, 30 Jul 2023 11:16:03 -0600 Message-ID: <20230730171619.915576-5-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230730171619.915576-1-sjg@chromium.org> References: <20230730171619.915576-1-sjg@chromium.org> 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 v2: - Add a Kconfig as the suggested conditional did not work common/board_f.c | 3 ++- drivers/video/Kconfig | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/common/board_f.c b/common/board_f.c index 7d2c380e91e2..5173d0a0c2d5 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 b41dc60cec59..e0e07ed0cda5 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -1106,6 +1106,14 @@ 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 video being allocated to U-Boot, thus having some + data structures overwrite the framebuffer. + if SPL_SPLASH_SCREEN config SPL_SPLASH_SCREEN_ALIGN -- 2.41.0.487.g6d72f3e995-goog