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 840C7C7EE21 for ; Thu, 4 May 2023 23:07:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 418228619C; Fri, 5 May 2023 00:59:38 +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="K+oP1bhK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 63308860D6; Fri, 5 May 2023 00:59:18 +0200 (CEST) Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (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 9554B860B2 for ; Fri, 5 May 2023 00:59:14 +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-xd2f.google.com with SMTP id ca18e2360f4ac-768d75b2369so75942439f.0 for ; Thu, 04 May 2023 15:59:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1683241153; x=1685833153; 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=4BilGGzC7sS06vyxZ2+duofSZphPrw5OWq7IOt3RBqA=; b=K+oP1bhK/p0U0QpxgmYn+NudrpVu5tETqDEeSuwZdtslmb3MogMHOVFjFf5rNwHaCk hqUVjYktJFcKWvbeaXf86zNwi4ciOGE9SdP2ti9pMINJBMFSgtv0LCUSYtULISz55LOI JVbz2S9YQaQ7nIaDUFAC4/scYqV4DGMwAaBmY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683241153; x=1685833153; 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=4BilGGzC7sS06vyxZ2+duofSZphPrw5OWq7IOt3RBqA=; b=ihGL/VxQ9dUepYoTZxRHf2zfGBkTvBRAg+5aC6W4lB9b8QdE6SYIBZ6rwvV2H4G0sF HjW6PiiNa+r6X2x79kEkJnVO93mTSIUtfPmoWig1XbTj04I2PIdbxiiksjLdyl17chbG OTKhTNdZZF3IqpG+Wl6ztwIazf4/VbWE6ubop0Eiq+eNS36kolnJzoBH5Mpw1MY3ALOq ocf37oL+SdSPZlaYiwz/wSAFRoI0dwrYbmLk7jBu34SDEQHY3mbdChApALS+pr3hZYWh 8cnHGcQuggoNNtdPW+E7QM+GObHgVrB1Uhn0hiLOKEKkZ/gcpxLvboOMq2CvcIGmfHpt DqbQ== X-Gm-Message-State: AC+VfDxq7fHyPsAzkX1+qLeuZdwVgHOejkIUk2QmRNs5D9pH1aBA8bZP ODQS7MCXNKaFk3GbK22xjTpIfiBFbd0J9rKjSYo= X-Google-Smtp-Source: ACHHUZ72Hte4ZhTr//NlLF7eQNruhv5yusUt/t32tEaG+QoUTczglhJKauSuetzf/BE6laXDfXZMeQ== X-Received: by 2002:a6b:d60a:0:b0:743:7742:1bc2 with SMTP id w10-20020a6bd60a000000b0074377421bc2mr168245ioa.16.1683241153223; Thu, 04 May 2023 15:59:13 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:b5a:9fa0:3da:54ec]) by smtp.gmail.com with ESMTPSA id e11-20020a5ede0b000000b007608af6dfb4sm39506iok.31.2023.05.04.15.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 15:59:13 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Nikhil M Jain , Bin Meng , Simon Glass Subject: [PATCH v3 36/43] x86: Show the number of physical address bits Date: Thu, 4 May 2023 16:58:22 -0600 Message-ID: <20230504225829.2537050-5-sjg@chromium.org> X-Mailer: git-send-email 2.40.1.521.gf1e218fcd8-goog In-Reply-To: <20230504225829.2537050-1-sjg@chromium.org> References: <20230504225829.2537050-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 91cd5d7c9e4..5c17d279092 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 ea58259ad77..5b802f79d50 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 9504e7fc293..c5fda22679a 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.40.1.521.gf1e218fcd8-goog