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 21233C001DE for ; Mon, 31 Jul 2023 13:56:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7E797866FB; Mon, 31 Jul 2023 15:56:16 +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="MsKf9G2W"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9095E86A75; Mon, 31 Jul 2023 15:56:15 +0200 (CEST) Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (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 3536B865D9 for ; Mon, 31 Jul 2023 15:56:13 +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-xd36.google.com with SMTP id ca18e2360f4ac-77acb04309dso243408839f.2 for ; Mon, 31 Jul 2023 06:56:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1690811772; x=1691416572; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Mth5guYG/ys0Q1740eGDWeXXy6fUH6dsmZ8Kpujd/MY=; b=MsKf9G2W9N480L8cNHqPsoJF5uFnLzY9dQr4nSYOPtm+I//7u0N+m39t5QRzg6Al6m HgTjkSSvnBIDpgvz+RAzzL7RX8Jnqx9jItwBrt0E+Ly4f2u52+OFVnNXvmdcSdSPylPD X0gkF9YztIG++1tmVaPY+L/ZbHrUVU9iY4T4I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690811772; x=1691416572; 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=Mth5guYG/ys0Q1740eGDWeXXy6fUH6dsmZ8Kpujd/MY=; b=To2dNOoUaRUSkRYmbyzkEF+I0WKIaADlUvz6mFSuvCyZMK8TIbL3tzDjfscqVOQcar uPwYWdJF9mG3B5F3EFYddGVkn+3gLQqnUaG+Bvi/M6UN8UR+M88RlnD1Wy86zq6v/LGZ WzaptrquTduaen3I5FVJgxYMh2h0W4jJD/1I/t64IaKEGEwxDvGFDG1/OA+FSkC470vA PCzdXXTLO7fxclUhvn/jsjdcv8h2jqm5XHU2QFDLWPl5Fev07Hhq3CuwcCNBCytkVY8M CHIQl8umcDodSG2Fi7lrB86AQZu2MoxyVwGC0OAsK0XAxDpj5Fpid0NLy0xllFGgf70N snyA== X-Gm-Message-State: ABy/qLbf4yAPd2v4dzazSoBUT/Ca7Oan/DNdYFTHZkioHlBWDYjQX+QI BTILp4GOx2ajwoRvaYMZ0t5SNVw0DWZE1q5XQTQ= X-Google-Smtp-Source: APBJJlEyuf+C+Z+c7ZFqCDhEWqkR75jP4Yf9GgzCTxlgONA4SovQwTMRSD40gNp7UoCiRm4gt/eD/g== X-Received: by 2002:a6b:f812:0:b0:783:6eef:1496 with SMTP id o18-20020a6bf812000000b007836eef1496mr8752506ioh.19.1690811771774; Mon, 31 Jul 2023 06:56:11 -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 y8-20020a02a388000000b0042b6940b793sm3019399jak.17.2023.07.31.06.56.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 06:56:11 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass Subject: [PATCH v3] x86: Change tesing logic of mtrr commit Date: Mon, 31 Jul 2023 07:56:02 -0600 Message-ID: <20230731135608.975404-1-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 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 Tweak to put back CONFIG_FSP_VERSION2 at top: Signed-off-by: Simon Glass --- Changes in v3: - Allow committing MTRRs with FSP_VERSION2 Changes in v2: - new patch: "x86: Change tesing logic of mtrr commit" arch/x86/lib/init_helpers.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c index f33194045f9e..60a2707dcf1b 100644 --- a/arch/x86/lib/init_helpers.c +++ b/arch/x86/lib/init_helpers.c @@ -21,8 +21,7 @@ int init_cache_f_r(void) /* * 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,8 +29,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) && - !IS_ENABLED(CONFIG_FSP_VERSION1) && + do_mtrr &= !IS_ENABLED(CONFIG_FSP_VERSION1) && !IS_ENABLED(CONFIG_SYS_SLIMBOOTLOADER); if (do_mtrr) { -- 2.41.0.487.g6d72f3e995-goog