From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D90BC48BC2 for ; Sun, 27 Jun 2021 23:52:36 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DE8AA61C31 for ; Sun, 27 Jun 2021 23:52:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE8AA61C31 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C243F82D1B; Mon, 28 Jun 2021 01:51:54 +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="WzRp4Nk8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8741582D50; Mon, 28 Jun 2021 01:51:32 +0200 (CEST) Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) (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 794F78291E for ; Mon, 28 Jun 2021 01:51: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=sjg@chromium.org Received: by mail-oi1-x22a.google.com with SMTP id u11so19842843oiv.1 for ; Sun, 27 Jun 2021 16:51:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ogpeZskiPHamCorMReY7g1VtY+5uszNi0Uz3GpcmwFo=; b=WzRp4Nk8uA1HraUcRaKbYlo7oyCRkuw7BLVnfiFk/JkYpDFlMxtaa4cWHCZffN2Ha8 qfMGhRSJyAdyr/WtfN+ExUZuoQ9pJvXT+4ef2CoWeo+xcbaSe6po2MY0O+dopPPsHMH0 usKsZwh2YX036O5YMdGqm6wNTQ5OVKr4zxBQw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ogpeZskiPHamCorMReY7g1VtY+5uszNi0Uz3GpcmwFo=; b=nJ8WwPIQw0z48elLXXWPmMvZ4o7jjliCLWCqyG6rA3LzooqnDWo9uqOVPe/JiHyQhE F8YS2K9d39k+4Mc+wTS2svvzsOF9c4fJKY1CQXcfBwyoXfPjsi3epVE1hnFYl5r8H3MZ Ld8Nbl9C9Li8Kxz0SXXzmaNt3iV8Xqs/JXPrseKEnlTpctVVxrPqAduyvV9DDznPmw4S lPBY1gVYTVXnZuqcHNb09hbH6IoBXxSaJAZrS/phOuR1J2aRvXyTdRq46qE38475j6Sq p1nNBeVjXxGqNJWtke9gpgfS0tOq86GA757zEJU9D1ZJWWILNHzXLNt7fzLOcuZLfzHw 4ckA== X-Gm-Message-State: AOAM530MFiJaFp/fCcX8fIdY4hwaxxxCm/yizZ/IhKtBGbvrCSU4MZTW Snq36rUpCmrnm8X0sSVv8rGdS4AVJQZhKhyR X-Google-Smtp-Source: ABdhPJxqzrcHr7iWrU+vAlK0XhNqi+33IIoHaxQILd1gV7IiEsd6F2V5/DFGI6f3zQ8SbHtqlexaDw== X-Received: by 2002:a05:6808:2cf:: with SMTP id a15mr9152962oid.84.1624837886889; Sun, 27 Jun 2021 16:51:26 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id bb34sm1297928oob.39.2021.06.27.16.51.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jun 2021 16:51:26 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Bin Meng Subject: [PATCH v3 08/16] x86: Do cache set-up by default when booting from coreboot Date: Sun, 27 Jun 2021 17:51:03 -0600 Message-Id: <20210627175102.v3.8.I3985bbff0c8e8da9bbec97b4e740de82e4bf2e51@changeid> X-Mailer: git-send-email 2.32.0.93.g670b81a890-goog In-Reply-To: <20210627235111.485507-1-sjg@chromium.org> References: <20210627235111.485507-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean A recent change to disable cache setup when booting from coreboot assumed that this has been done by SPL. The result is that for the coreboot board, the cache is disabled (in start.S) and never re-enabled. If the cache was turned off, as it is on boards without SPL, we should turn it back on. Add this new condition. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v2) Changes in v2: - Add a comment about the cases arch/x86/lib/init_helpers.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c index 67401b9ba79..f33194045f9 100644 --- a/arch/x86/lib/init_helpers.c +++ b/arch/x86/lib/init_helpers.c @@ -18,10 +18,20 @@ int init_cache_f_r(void) IS_ENABLED(CONFIG_FSP_VERSION2); int ret; - if (!ll_boot_init()) - return 0; - - do_mtrr &= !IS_ENABLED(CONFIG_FSP_VERSION1) && + /* + * Supported configurations: + * + * booting from slimbootloader - in that case the 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 + * the MTRRs here + * 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) && !IS_ENABLED(CONFIG_SYS_SLIMBOOTLOADER); if (do_mtrr) { -- 2.32.0.93.g670b81a890-goog