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 190A9C77B78 for ; Wed, 19 Apr 2023 04:11:28 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CEBC8861EF; Wed, 19 Apr 2023 06:05:17 +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="EZAimV7i"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 838B086235; Wed, 19 Apr 2023 06:04:25 +0200 (CEST) Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (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 D46448620D for ; Wed, 19 Apr 2023 06:04: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=sjg@chromium.org Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-763703a6df9so33817939f.3 for ; Tue, 18 Apr 2023 21:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1681877048; x=1684469048; 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=Wl+Qnl54NejEhJve4h+kLJTZfOUwtOWPaPXHbSYPAEc=; b=EZAimV7i1PxiwgZEhQ61mUNgAnhQoc6VlCbI1hkGemfyMtrTvbZ3cNv1fHZfWnFVJ3 g7CZg9gGQZkG3I/pCrKleVDvXObR2+KyMnk2BE24L3x2bm7MuMNqRwVAYWpaF2xAMGep NOVRBK0jl2ytE3YCZOzghe4tOzG53GllkpMx0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681877048; x=1684469048; 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=Wl+Qnl54NejEhJve4h+kLJTZfOUwtOWPaPXHbSYPAEc=; b=fVNE8qN0Ij2Hf3XkURQ8oEzWDudojnlXAMppddToeds8/qeDMWu2DuRBhP1ylQgLam 68EfwMcrvf3RWntJoPxrWJFaE3x5LL95sxPxEFL3pqHZwWSiiALa05IzbKM4kNSSb39j Sa8AXX/Hgwn5bN7k0gtJWFPETervH60tQyVMNgojqVzMeBL1MFKBD8syamQMqbcgN62E iJoN2ddGOcVutG49h8kjsYdWi8TfG8hLa0Axa4cvbP3tYO60dSm8madTIsXFde3HLdh9 qshE8rI5V9XeR4Nc71oY/tydG3KfEci4dgiwtavdl6bhm8+IBcjt8A5vxHvjZvqJ9leJ 8ADw== X-Gm-Message-State: AAQBX9cm2p5e3MqMwKlu0EaUJjxXkXHgODXRGBpdzyrQMThHfSp+cPBZ itrT1sPyU+PpoIMplQEthZMVhu0mvtwEPC6ly58= X-Google-Smtp-Source: AKy350b1mty9+JXq/ryZ3kyd75jN5JhgYcoOVvm+mFKKLnA14wA7sXyCG2lBMn7Ce0D/kPTrarO+Zg== X-Received: by 2002:a6b:7f49:0:b0:760:e9b6:e6d9 with SMTP id m9-20020a6b7f49000000b00760e9b6e6d9mr3673797ioq.1.1681877048126; Tue, 18 Apr 2023 21:04:08 -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 i4-20020a05663815c400b0040f91082a4fsm3261982jat.75.2023.04.18.21.04.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Apr 2023 21:04:07 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Bin Meng , Simon Glass Subject: [PATCH v2 35/42] x86: Show the number of physical address bits Date: Wed, 19 Apr 2023 16:03:07 +1200 Message-ID: <20230419040314.160352-4-sjg@chromium.org> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog In-Reply-To: <20230419040314.160352-1-sjg@chromium.org> References: <20230419040314.160352-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 --- 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.40.0.634.g4ca3ef3211-goog