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 65271C001DC for ; Mon, 31 Jul 2023 06:01:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 578C58638D; Mon, 31 Jul 2023 08:01:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinylab.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 3BDC68638D; Mon, 31 Jul 2023 08:01:39 +0200 (CEST) Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.67.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 32E53862DA for ; Mon, 31 Jul 2023 08:01:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinylab.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng@tinylab.org X-QQ-mid: bizesmtp83t1690783282towgmkan Received: from pek-vx-bsp2.wrs.com ( [60.247.85.88]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 31 Jul 2023 14:01:08 +0800 (CST) X-QQ-SSF: 01200000000000F0H000000A0000000 X-QQ-FEAT: jXjag1m6xl7w1306ZtVXQQw5DgJRn1zrJQ77frvDpXYuLjDpS5HzCbLiL+uD6 4zJVeIoAx8AjjTL222Zg1EyRNv9oAIkt/smgE7Yq+k30ODasbHRVXAv5mQ9UKmZYAw+F2RZ Q8OCeoUS5lZowWc2EGwBdfYc5iz+sSTvoHiSl9d+MM7BYmsntJpd3vygs0iP3x4HX4WZKEv X1s8+hPRfaGCeFRMPtimOpepAQwqVwuzWrYmtMxkiGibPBX9gP4fSq143uIENUXyBzOyT+k rPugYuNI8oTvh0bCcvwZ1HbHCiuQjS8qx3P9VyvTzq+KrRheEZOdp/9kbov6kDI3rC6Qvkd zL89ROsVHPyK/W3iKMCHgGFbZ8iKA== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 6570862801328145564 From: Bin Meng To: Simon Glass , u-boot@lists.denx.de Cc: Bin Meng Subject: [PATCH v2 1/6] x86: Change tesing logic of mtrr commit Date: Mon, 31 Jul 2023 14:01:03 +0800 Message-Id: <20230731060108.577470-1-bmeng@tinylab.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz7a-0 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 From: Bin Meng On Coral U-Boot SPL programs some MTRRs and FSPv2 in U-Boot proper needs to program MTRRs too. With current testing logic of mtrr commit in init_cache_f_r(), the mtrr commit is skipped which won't work as the queued mtrr requests include setup for DRAM regions. Change the logic to allow such configuration. Signed-off-by: Bin Meng --- Changes in v2: - new patch: "x86: Change tesing logic of mtrr commit" arch/x86/lib/init_helpers.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c index f33194045f..a2535e4468 100644 --- a/arch/x86/lib/init_helpers.c +++ b/arch/x86/lib/init_helpers.c @@ -14,15 +14,13 @@ DECLARE_GLOBAL_DATA_PTR; int init_cache_f_r(void) { - bool do_mtrr = CONFIG_IS_ENABLED(X86_32BIT_INIT) || - IS_ENABLED(CONFIG_FSP_VERSION2); + bool do_mtrr = CONFIG_IS_ENABLED(X86_32BIT_INIT); int ret; /* * Supported configurations: * - * booting from slimbootloader - in that case the MTRRs are already set - * up + * booting from slimbootloader - MTRRs are already set up * booting with FSPv1 - MTRRs are already set up * booting with FSPv2 - MTRRs must be set here * booting from coreboot - in this case there is no SPL, so we set up @@ -30,7 +28,7 @@ int init_cache_f_r(void) * Note: if there is an SPL, then it has already set up MTRRs so we * don't need to do that here */ - do_mtrr &= !IS_ENABLED(CONFIG_SPL) && + do_mtrr &= (!IS_ENABLED(CONFIG_SPL) || IS_ENABLED(CONFIG_FSP_VERSION2)) && !IS_ENABLED(CONFIG_FSP_VERSION1) && !IS_ENABLED(CONFIG_SYS_SLIMBOOTLOADER); -- 2.25.1