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 B4771EB64D9 for ; Mon, 19 Jun 2023 12:11:10 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E41DC865F3; Mon, 19 Jun 2023 14:08:12 +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="P3hKGwjY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 967558633D; Mon, 19 Jun 2023 14:03:51 +0200 (CEST) Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (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 83E2F86339 for ; Mon, 19 Jun 2023 14:02:21 +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-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3112f5ab0b1so1411098f8f.0 for ; Mon, 19 Jun 2023 05:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1687176140; x=1689768140; 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=No7yja9ibBfqc7v+1OWo2VvavtrjAJ0Hj1rSMpGGEEY=; b=P3hKGwjYh8ncnHJDsHzgoU9WpiVqqJ9R1ozJLBzcP764n57Ecn5VbgPWnTI/diWF8p HMm7fbIRZycdBLWoXCwX/vTg+FDH/kbHNXZBVSIjhNxL+tGZVv4+TE/8GKyFCoF1Yu5V 0TrBP2X/LwTFPf8VvvI5Zi9hCDoxxTCd1LTBw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687176140; x=1689768140; 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=No7yja9ibBfqc7v+1OWo2VvavtrjAJ0Hj1rSMpGGEEY=; b=ldlb1KwjinRwXXrJGOKQuPkgpiKwdqifAUCzA2ooEDoigi0qNWf9q5HGW4ldC3+Wjp cdCh8IKWbEFyGxgaoM4TZHGWlrETCEtnZXYX23+UmUvDYEkfp4HqC0JymfteA2IS+oR0 aTHxhm2M+WGCoxWvLclJwCwkkbS+Ihdku6WnKoaXCgzkvpS1r7xn026iY5qrC56Er/3M RVL/MaTPZj2J0usv1feZfSZ9cuYmkDz8HZrvXInVvxuNNZMddB3Dn5G1ljLhuK2ZPzdS KnziR8xHkbA2dlc+plZWKq+iFqyUYBwxw3I9+vWz4+nTZnIkeWaZLuPjU/klfbdAIDVn hLbA== X-Gm-Message-State: AC+VfDxFA6ODsaqUKFXoiFWGtFbcwJ5ifqgn2xDVxtpByK2TIhZ0bDyO 1qpng11+kIKI9o3D83G8jYIJCy853gLT9N7VB/8= X-Google-Smtp-Source: ACHHUZ7+mZJqXpNCGUiPP1hx6Izjs0IEv4nMjgE8Q8b6YcfAhHXDxju/u+sGL3Hc5nNlBsaREKadpQ== X-Received: by 2002:a5d:444b:0:b0:30a:f143:25d2 with SMTP id x11-20020a5d444b000000b0030af14325d2mr5744606wrr.5.1687176140792; Mon, 19 Jun 2023 05:02:20 -0700 (PDT) Received: from sjg1.roam.corp.google.com (79-67-123-132.dynamic.dsl.as9105.com. [79.67.123.132]) by smtp.gmail.com with ESMTPSA id k6-20020adff5c6000000b0031122bd3c82sm8886794wrp.17.2023.06.19.05.02.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 05:02:20 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Bin Meng , Nikhil M Jain , Simon Glass Subject: [PATCH v4 36/45] x86: Show the number of physical address bits Date: Mon, 19 Jun 2023 12:59:51 +0100 Message-ID: <20230619120011.1587499-6-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog In-Reply-To: <20230619120011.1587499-1-sjg@chromium.org> References: <20230619120011.1587499-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 Add this information to global_data and show it with the 'bdinfo' command. For now we use CONFIG_CPU_ADDR_BITS to control the number of bits, but this could change if needed. Signed-off-by: Simon Glass --- (no changes since v2) Changes in v2: - Add new patch to show the number of physical address bits arch/x86/cpu/i386/cpu.c | 2 ++ arch/x86/include/asm/global_data.h | 1 + arch/x86/lib/bdinfo.c | 1 + 3 files changed, 4 insertions(+) diff --git a/arch/x86/cpu/i386/cpu.c b/arch/x86/cpu/i386/cpu.c index 91cd5d7c9e40..5c17d279092e 100644 --- a/arch/x86/cpu/i386/cpu.c +++ b/arch/x86/cpu/i386/cpu.c @@ -468,6 +468,7 @@ int x86_cpu_init_f(void) if (ll_boot_init()) setup_cpu_features(); setup_identity(); + gd->arch.phys_bits = cpu_phys_address_size(); setup_mtrr(); setup_pci_ram_top(); @@ -483,6 +484,7 @@ int x86_cpu_reinit_f(void) long addr; setup_identity(); + gd->arch.phys_bits = cpu_phys_address_size(); setup_pci_ram_top(); addr = locate_coreboot_table(); if (addr >= 0) { diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h index ea58259ad774..5b802f79d502 100644 --- a/arch/x86/include/asm/global_data.h +++ b/arch/x86/include/asm/global_data.h @@ -127,6 +127,7 @@ struct arch_global_data { ulong table_end; /* End address of x86 tables */ ulong table_start_high; /* Start address of high x86 tables */ ulong table_end_high; /* End address of high x86 tables */ + uint phys_bits; /* Number of physical address bits */ }; #endif diff --git a/arch/x86/lib/bdinfo.c b/arch/x86/lib/bdinfo.c index 9504e7fc293e..c5fda22679ad 100644 --- a/arch/x86/lib/bdinfo.c +++ b/arch/x86/lib/bdinfo.c @@ -27,6 +27,7 @@ void arch_print_bdinfo(void) bdinfo_print_num_l("table end", gd->arch.table_end); bdinfo_print_num_l(" high start", gd->arch.table_start_high); bdinfo_print_num_l(" high end", gd->arch.table_end_high); + bdinfo_print_num_l("phys bits", gd->arch.phys_bits); if (IS_ENABLED(CONFIG_EFI_STUB)) efi_show_bdinfo(); -- 2.41.0.162.gfafddb0af9-goog