From patchwork Wed Feb 11 14:32:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1821 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770820484; bh=M+rEpZ/ERXhIGqKPl/0gl9Hnu4CZk6TvqwGYunXKDsg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Jm/d4BY4W532Vbfbh4mkDsMI4C28SVUKkUmdL6qDn6tORORZ1wAglEACqTIiQyhEe r4pIQxEB9XZxk8FZP8Emqp0PLX8aVnLMPZvH3BeHIAzpPDKRSzKL6W7lH7tHmvIOcn 4+3JiGGWPN1BjaMu/0MOud44A54XuxkY+IKLFVxhXA+BfLky0aMglqXdfk5mpui7Hc mwqTKOPYzUsiiMIk2lQukfvDowU1RKyr08b44BS1+pAkafhmpbCcd8ZzFkvkzlxcWx Qn+7ajSlvBo/CJ9UCYbzh1h+UXByUvUwoEV9F8a5A93EqK9i96Fi6qpbakqRfS9XRx MXAU1y8u4S+bQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3280669A92 for ; Wed, 11 Feb 2026 07:34:44 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id cdstFcV7-A7I for ; Wed, 11 Feb 2026 07:34:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770820484; bh=M+rEpZ/ERXhIGqKPl/0gl9Hnu4CZk6TvqwGYunXKDsg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Jm/d4BY4W532Vbfbh4mkDsMI4C28SVUKkUmdL6qDn6tORORZ1wAglEACqTIiQyhEe r4pIQxEB9XZxk8FZP8Emqp0PLX8aVnLMPZvH3BeHIAzpPDKRSzKL6W7lH7tHmvIOcn 4+3JiGGWPN1BjaMu/0MOud44A54XuxkY+IKLFVxhXA+BfLky0aMglqXdfk5mpui7Hc mwqTKOPYzUsiiMIk2lQukfvDowU1RKyr08b44BS1+pAkafhmpbCcd8ZzFkvkzlxcWx Qn+7ajSlvBo/CJ9UCYbzh1h+UXByUvUwoEV9F8a5A93EqK9i96Fi6qpbakqRfS9XRx MXAU1y8u4S+bQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1FB7F69A89 for ; Wed, 11 Feb 2026 07:34:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770820482; bh=3m09I81oYlFQUZekzMLUq1IsyZ1liDxRLqq2KcCmn78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KxT5v4kFvlyHFmo3y9VmumS9UHOvhgo2+jJiCrdXCYWcpODJmK/bEFcB1SJU9rvQG N0UAlUGA9ZEu53w1sBm/Nvufq3WuwlBsc08/KHK4b+Bngl5cDLYKnjxlHJOGpO4ypD y0B5DScXJxkztMKrHcW5UFXw1h9xYO9gLP74KAZJafPwQoXGPDo1BfjV5o4RBdQ7gu bmd+QlZA5wdm5svyvRgfmQPhU6yioHCFIfJdc5pSTOSEUGffsX9ovjbqLZsPBGzxqg /KIdM/031h/x5oMj33gVAQPnSlZAqnnzQI6Sy/wELdehUoLfaUCWCYinJgDJR4czcT i1kGIVcLJg9yg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5B45569A89; Wed, 11 Feb 2026 07:34:42 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id tscrRpfpYF9B; Wed, 11 Feb 2026 07:34:42 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770820478; bh=5MQHViAqKHjRtuVd6IaPDVKZDOvtYy5uGVoMb2VhYok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dx+SS9GKoR4hVNpwm1SRlFEKSLM2flrBnMnuGDcaZf6C5FIS+/8fEQWJ+d9mD8goW 952FCNMKXB4bdxTZz0KCyXWCf7KblJRaDFo2C4UBJw1wYaH8/KFXFj5wiE4VDMTKrz cZhc7sNV835Hd58PuevExY5WouIYtvhQSIhNkDc+Fz7Rdr4GPZW5a3yEiUWFZKl1aL 3oaexYxna07YRX016a6RQVVnyjxCXxh9Qcqwl5dMBbOw9wItisAJQuSNKU1HUmrtMd quCtxdyLhjafHytNkvDANdbuKFTWjJhBTXMJQxA3FEEOYz6p1PpccGrliDEOqV+HWJ lJh2HkGul5ySA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1387D699D6; Wed, 11 Feb 2026 07:34:38 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 11 Feb 2026 07:32:58 -0700 Message-ID: <20260211143309.1183113-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260211143309.1183113-1-sjg@u-boot.org> References: <20260211143309.1183113-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: P4LCTLZOOVQSFHRH2P6W352O7YG6LWSK X-Message-ID-Hash: P4LCTLZOOVQSFHRH2P6W352O7YG6LWSK X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 6" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 10/12] x86: qemu: Enable MTRR setup for x86_64 no-SPL List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The x86_64 no-SPL build does not programme MTRRs because gd->arch.has_mtrr is never set to true. In the SPL-based flow, SPL sets up the MTRRs during its init and they persist into U-Boot proper. Without SPL, nothing sets them up. Set has_mtrr in x86_cpu_init_f() for x86_64, and extend the arch_cpu_init() guard in the QEMU board code to also cover X86_16BIT_INIT so that it is called in the no-SPL path. Co-developed-by: Claude Opus 4.6 Signed-off-by: Simon Glass --- arch/x86/cpu/qemu/qemu.c | 4 +++- arch/x86/cpu/x86_64/cpu.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/x86/cpu/qemu/qemu.c b/arch/x86/cpu/qemu/qemu.c index b393205acb3..87e61558e8d 100644 --- a/arch/x86/cpu/qemu/qemu.c +++ b/arch/x86/cpu/qemu/qemu.c @@ -108,14 +108,16 @@ void qemu_chipset_init(void) } } -#if CONFIG_IS_ENABLED(X86_32BIT_INIT) +#if CONFIG_IS_ENABLED(X86_32BIT_INIT) || CONFIG_IS_ENABLED(X86_16BIT_INIT) int arch_cpu_init(void) { post_code(POST_CPU_INIT); return x86_cpu_init_f(); } +#endif +#if CONFIG_IS_ENABLED(X86_32BIT_INIT) int checkcpu(void) { return 0; diff --git a/arch/x86/cpu/x86_64/cpu.c b/arch/x86/cpu/x86_64/cpu.c index 25ae92c702f..610155d893c 100644 --- a/arch/x86/cpu/x86_64/cpu.c +++ b/arch/x86/cpu/x86_64/cpu.c @@ -61,6 +61,8 @@ int x86_cpu_reinit_f(void) int x86_cpu_init_f(void) { + gd->arch.has_mtrr = true; + return 0; }