From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 8BA49AC1B8D for ; Wed, 19 Jun 2024 22:07:30 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=hkROwjB3KKD/utrgcPCnTYa+ZWVBExoTOZBo1gvJZj8=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1718834850; v=1; b=DLSpMcORTqEeWDfrMHwZQrN9hdWQuMplndQD3vTpk84C2LKBlpvpWNxKw3ROW/CfiHVNR6Nz a/qXmDT2xyl/6RoM8KXV3P253IqYpLxIXr7hNdSe1yZJC8q7UMmlVmpiRvpxGnM4rNFYOKV3fi4 WlPilx+cqaVt8xGv3mZU4cOTxtpeB4rHU6m90u1VopMDCYBsuSD26ZX+dPZ/T8t6okakIh6gf18 hUa0rqF5QBXKOJ/qv6757L6R9SsKufWrM1itDlORxYj5GLWefkgqDWagjbhdNd8c4P27oETp/tF OtoqATkMeiAbIShPVL5JBCOvx5Z/0cxEk+pjfLuF3Y+Gw== X-Received: by 127.0.0.2 with SMTP id ObsCYY7687511x98PwBqHNNp; Wed, 19 Jun 2024 15:07:29 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.34068.1718834848516053781 for ; Wed, 19 Jun 2024 15:07:28 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EE98BDA7; Wed, 19 Jun 2024 15:07:52 -0700 (PDT) X-Received: from e126645.home (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C6AC93F64C; Wed, 19 Jun 2024 15:07:25 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Pierre Gondois , AbdulLateef Attar , Girish Mahadevan , Jeff Brasen , Jeshua Smith , Leif Lindholm , Meenakshi Aggarwal , Sami Mujawar , Sunil V L , Yeo Reum Yun Subject: [edk2-devel] [staging/dynamictables-reorg PATCH 15/15] DynamicTablesPkg: FdtHwInfoParserLib: Create wrapper to get INTC addr cells Date: Thu, 20 Jun 2024 00:06:29 +0200 Message-Id: <20240619220629.1994362-16-pierre.gondois@arm.com> In-Reply-To: <20240619220629.1994362-1-pierre.gondois@arm.com> References: <20240619220629.1994362-1-pierre.gondois@arm.com> MIME-Version: 1.0 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 Resent-Date: Wed, 19 Jun 2024 15:07:28 -0700 Resent-From: pierre.gondois@arm.com Reply-To: devel@edk2.groups.io,pierre.gondois@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: ObFDPtBkmmSRQnd51DihkXJOx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=DLSpMcOR; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Parent interrupt controller's address cells is arch specific. So, create a wrapper function which can be implemented differently for different archs. Move current implementation to ARM specific file. Suggested-by: Sunil V L Signed-off-by: Pierre Gondois --- .../AcpiSsdtPcieLib/SsdtPcieGenerator.c | 2 +- .../FdtHwInfoParserLib/Arm/ArmFdtUtility.c | 33 +++++++++++++++++++ .../Library/FdtHwInfoParserLib/FdtUtility.h | 30 +++++++++++++++++ .../Pci/PciConfigSpaceParser.c | 2 +- 4 files changed, 65 insertions(+), 2 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieG= enerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieG= enerator.c index 2b488016e545..5b6d5515622b 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerato= r.c +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerato= r.c @@ -974,7 +974,7 @@ BuildSsdtPciTableEx ( EFI_STATUS Status;=0D CM_ARCH_COMMON_PCI_CONFIG_SPACE_INFO *PciInfo;=0D UINT32 PciCount;=0D - UINTN Index;=0D + UINT32 Index;=0D EFI_ACPI_DESCRIPTION_HEADER **TableList;=0D ACPI_PCI_GENERATOR *Generator;=0D UINT32 Uid;=0D diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.= c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c index 21b1306e577d..71774fae7113 100644 --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c @@ -83,3 +83,36 @@ FdtGetInterruptFlags ( =0D return AcpiIrqFlags;=0D }=0D +=0D +/** For relevant architectures, get the "#address-cells" and/or "#size-cel= ls"=0D + property of the node.=0D +=0D + According to the Device Tree specification, s2.3.5 "#address-cells and=0D + #size-cells":=0D + "If missing, a client program should assume a default value of 2 for=0D + #address-cells, and a value of 1 for #size-cells."=0D +=0D + @param [in] Fdt Pointer to a Flattened Device Tree.=0D + @param [in] Node Offset of the node having to get the=0D + "#address-cells" and "#size-cells"=0D + properties from.=0D + @param [out] AddressCells If success, number of address-cells.=0D + If the property is not available,=0D + default value is 2.=0D + @param [out] SizeCells If success, number of size-cells.=0D + If the property is not available,=0D + default value is 1.=0D +=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +FdtGetIntcAddressCells (=0D + IN CONST VOID *Fdt,=0D + IN INT32 Node,=0D + OUT INT32 *AddressCells, OPTIONAL=0D + OUT INT32 *SizeCells OPTIONAL=0D + )=0D +{=0D + return FdtGetAddressInfo (Fdt, Node, AddressCells, SizeCells);=0D +}=0D diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h b/Dyn= amicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h index 3f5d131d9ae5..2d7048753b9f 100644 --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h @@ -455,4 +455,34 @@ FdtGetParentAddressInfo ( OUT INT32 *SizeCells OPTIONAL=0D );=0D =0D +/** For relevant architectures, get the "#address-cells" and/or "#size-cel= ls"=0D + property of the node.=0D +=0D + According to the Device Tree specification, s2.3.5 "#address-cells and=0D + #size-cells":=0D + "If missing, a client program should assume a default value of 2 for=0D + #address-cells, and a value of 1 for #size-cells."=0D +=0D + @param [in] Fdt Pointer to a Flattened Device Tree.=0D + @param [in] Node Offset of the node having to get the=0D + "#address-cells" and "#size-cells"=0D + properties from.=0D + @param [out] AddressCells If success, number of address-cells.=0D + If the property is not available,=0D + default value is 2.=0D + @param [out] SizeCells If success, number of size-cells.=0D + If the property is not available,=0D + default value is 1.=0D +=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +FdtGetIntcAddressCells (=0D + IN CONST VOID *Fdt,=0D + IN INT32 Node,=0D + OUT INT32 *AddressCells, OPTIONAL=0D + OUT INT32 *SizeCells OPTIONAL=0D + );=0D +=0D #endif // FDT_UTILITY_H_=0D diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpace= Parser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpacePa= rser.c index 76f9efdf64d5..7f536c0ac63e 100644 --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.c +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.c @@ -365,7 +365,7 @@ ParseIrqMap ( }=0D =0D // Get the "address-cells" property of the IntcNode.=0D - Status =3D FdtGetAddressInfo (Fdt, IntcNode, &IntcAddressCells, NULL);=0D + Status =3D FdtGetIntcAddressCells (Fdt, IntcNode, &IntcAddressCells, NUL= L);=0D if (EFI_ERROR (Status)) {=0D ASSERT (0);=0D return Status;=0D --=20 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119647): https://edk2.groups.io/g/devel/message/119647 Mute This Topic: https://groups.io/mt/106770185/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-