From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 1404CAC17A7 for ; Fri, 19 Jan 2024 19:20:52 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=4ckcVS2ZcleIYWy2e9ASPVS1gcfIIbqPRxcaKx6kogY=; c=relaxed/simple; d=groups.io; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Disposition; s=20140610; t=1705692051; v=1; b=q22zCZlk3NR33KuUMKt8IVAHgvGOvH4ufQcQ6M8TYxPCW0IykNrjfg1f86jKdv1F7WgwIA2v EIdpxjEF1Pbeuy4NWSshXPb6DQqk44C/sqAIr1uYoKcNlqedf//jwLXSj8W1YkRnEn1Z+0dDNcL yf34yum8g2HkscKDkFox70zg= X-Received: by 127.0.0.2 with SMTP id hVXRYY7687511xizBgK0Kuuc; Fri, 19 Jan 2024 11:20:51 -0800 X-Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by mx.groups.io with SMTP id smtpd.web11.2714.1705692050963633211 for ; Fri, 19 Jan 2024 11:20:51 -0800 X-Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40JGGOq1006515; Fri, 19 Jan 2024 19:20:50 GMT X-Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vqn89hb8r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Jan 2024 19:20:49 +0000 (GMT) X-Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40JJKm6I014231 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Jan 2024 19:20:48 GMT X-Received: from qc-i7.hemma.eciton.net (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 19 Jan 2024 11:20:46 -0800 Date: Fri, 19 Jan 2024 19:20:43 +0000 From: "Leif Lindholm" To: Marcin Juszkiewicz CC: , Ard Biesheuvel , Graeme Gregory Subject: Re: [edk2-devel] [PATCH edk2-platforms v2 3/4] Platform/SbsaQemu: use PcdCoreCount directly Message-ID: References: <20240116-no-dt-for-cpu-v2-0-6cf078d9ab76@linaro.org> <20240116-no-dt-for-cpu-v2-3-6cf078d9ab76@linaro.org> MIME-Version: 1.0 In-Reply-To: <20240116-no-dt-for-cpu-v2-3-6cf078d9ab76@linaro.org> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-GUID: 7CTB-FYRkEqK5c14CXJDPGAAtjhY-Sfb X-Proofpoint-ORIG-GUID: 7CTB-FYRkEqK5c14CXJDPGAAtjhY-Sfb Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,quic_llindhol@quicinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: W7fluUGSmfy1UrsdbrSIpXJYx7686176AA= Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=q22zCZlk; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=quicinc.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On Tue, Jan 16, 2024 at 08:48:34 +0100, Marcin Juszkiewicz wrote: > During platform initialization we read amount of cpu cores and set > PcdCoreCount so there is no need to call FdtHandler. > > Signed-off-by: Marcin Juszkiewicz > --- > Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf | 6 ++---- > Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c | 10 ++++------ > .../Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 12 +++--------- > 3 files changed, 9 insertions(+), 19 deletions(-) > > diff --git a/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf > index a34f54d431d4..8e2bf8c512f1 100644 > --- a/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf > +++ b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf > @@ -3,7 +3,7 @@ > # > # Copyright (c) 2021, NUVIA Inc. All rights reserved. > # Copyright (c) 2018, Hisilicon Limited. All rights reserved. > -# Copyright (c) 2018, Linaro Limited. All rights reserved. > +# Copyright (c) 2023, Linaro Ltd. All rights reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > @@ -29,8 +29,6 @@ [Packages] > > [LibraryClasses] > BaseMemoryLib > - FdtLib > - FdtHelperLib > IoLib > PcdLib > > @@ -40,7 +38,6 @@ [Guids] > [Pcd] > gArmTokenSpaceGuid.PcdEmbeddedControllerFirmwareRelease > gArmTokenSpaceGuid.PcdSystemBiosRelease > - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdDeviceTreeBaseAddress > > gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdSystemManufacturer > gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdSystemSerialNumber > @@ -56,3 +53,4 @@ [Pcd] > gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisManufacturer > gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisAssetTag > gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisSKU > + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdCoreCount > diff --git a/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c > index c38f2851904f..ab97768b5ddc 100644 > --- a/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c > +++ b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c > @@ -2,7 +2,7 @@ > * OemMiscLib.c > * > * Copyright (c) 2021, NUVIA Inc. All rights reserved. > -* Copyright (c) 2020, Linaro Ltd. All rights reserved. > +* Copyright (c) Linaro Ltd. All rights reserved. > * > * SPDX-License-Identifier: BSD-2-Clause-Patent > * > @@ -12,14 +12,12 @@ > #include > #include > #include > -#include > #include > #include > #include > #include > #include > #include > -#include > > /** Returns whether the specified processor is present or not. > > @@ -33,7 +31,7 @@ OemIsProcessorPresent ( > UINTN ProcessorIndex > ) > { > - if (ProcessorIndex < FdtHelperCountCpus ()) { > + if (ProcessorIndex < PcdGet32 (PcdCoreCount)) { > return TRUE; > } > > @@ -76,7 +74,7 @@ OemGetProcessorInformation ( > { > UINT16 ProcessorCount; > > - ProcessorCount = FdtHelperCountCpus (); > + ProcessorCount = PcdGet32 (PcdCoreCount); > > if (ProcessorIndex < ProcessorCount) { > ProcessorStatus->Bits.CpuStatus = 1; // CPU enabled > @@ -121,7 +119,7 @@ OemGetMaxProcessors ( > VOID > ) > { > - return FdtHelperCountCpus (); > + return PcdGet32 (PcdCoreCount); > } > > /** Gets information about the cache at the specified cache level. > diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c > index 9fb17151d7b8..7ef314ae9f67 100644 > --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c > +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c > @@ -1,7 +1,7 @@ > /** @file > * This file is an ACPI driver for the Qemu SBSA platform. > * > -* Copyright (c) 2020, Linaro Ltd. All rights reserved. > +* Copyright (c) Linaro Ltd. All rights reserved. > * > * SPDX-License-Identifier: BSD-2-Clause-Patent > * > @@ -255,7 +255,7 @@ AddMadtTable ( > // Initialize GIC Redistributor Structure > EFI_ACPI_6_0_GICR_STRUCTURE Gicr = SBSAQEMU_MADT_GICR_INIT(); > > - // Get CoreCount which was determined eariler after parsing device tree > + // Get CoreCount which was determined earlier from TF-A Where we got the information from no longer matters, since we've abstracted that away. / Leif > NumCores = PcdGet32 (PcdCoreCount); > > // Calculate the new table size based on the number of cores > @@ -291,7 +291,7 @@ AddMadtTable ( > New += sizeof (EFI_ACPI_6_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER); > > // Add new GICC structures for the Cores > - for (CoreIndex = 0; CoreIndex < PcdGet32 (PcdCoreCount); CoreIndex++) { > + for (CoreIndex = 0; CoreIndex < NumCores; CoreIndex++) { > EFI_ACPI_6_0_GIC_STRUCTURE *GiccPtr; > > CopyMem (New, &Gicc, sizeof (EFI_ACPI_6_0_GIC_STRUCTURE)); > @@ -758,12 +758,6 @@ InitializeSbsaQemuAcpiDxe ( > { > EFI_STATUS Status; > EFI_ACPI_TABLE_PROTOCOL *AcpiTable; > - UINT32 NumCores; > - > - // Parse the device tree and get the number of CPUs > - NumCores = FdtHelperCountCpus (); > - Status = PcdSet32S (PcdCoreCount, NumCores); > - ASSERT_RETURN_ERROR (Status); > > // Check if ACPI Table Protocol has been installed > Status = gBS->LocateProtocol ( > > -- > 2.43.0 > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114096): https://edk2.groups.io/g/devel/message/114096 Mute This Topic: https://groups.io/mt/103758016/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-