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 D82547803CF for ; Wed, 3 Jul 2024 06:51:11 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=75iDVqYAwsHyHBoCH5W5USzLnTqRLaWkWADzaUZ9bKA=; 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:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Disposition; s=20240206; t=1719989471; v=1; b=jViFH2395O2dRsspwq4UOxXJSh+w3Sm9ZmPHxdMR1DT4pWgeIZeyUuXV5nS/56vNsNnsAqyB 2KapC3/B/TDTpWeqHfJsVewG9fG9ji75do71DYRy9ftS8UnlYrYDHTJwzTLPBa/1QoegcxmdfEB GkYMLG//1at6Ro129+VcGsmEU0SLAcaOPBOBcFu3KT2VSk6FdqpV5ZeisY2lrX6ZqRt0mUYFeB1 h7iuYvsWcdbUEQCELUc7f8/4wrjALX7fq9E0DoQNwY91zy0malhE1c0oNjc0nPm93KOtY1Gzh+o 67JGUKJyqnvcQwSDxQUJhVcdWnl9d5aCOMClMxq0Z7sow== X-Received: by 127.0.0.2 with SMTP id xLwLYY7687511xrthBfYTTDU; Tue, 02 Jul 2024 23:51:10 -0700 X-Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.42]) by mx.groups.io with SMTP id smtpd.web10.44705.1719989469391422454 for ; Tue, 02 Jul 2024 23:51:09 -0700 X-Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-25da8a19acaso2411026fac.2 for ; Tue, 02 Jul 2024 23:51:09 -0700 (PDT) X-Gm-Message-State: ckKtI8Uv8qZeiLSFaKOsg6Y2x7686176AA= X-Google-Smtp-Source: AGHT+IFPsgHN4jDZldnnozXAi+cIjDhpkS132Mqd3pL4olt76XXnvW+LZawU3/4CsXHfbopTNNFfCg== X-Received: by 2002:a05:6871:24d9:b0:25e:ff1:8314 with SMTP id 586e51a60fabf-25e0ff18736mr706080fac.33.1719989468472; Tue, 02 Jul 2024 23:51:08 -0700 (PDT) X-Received: from sunil-laptop ([14.141.91.70]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-25d8e234bdfsm2605178fac.32.2024.07.02.23.51.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 23:51:07 -0700 (PDT) Date: Wed, 3 Jul 2024 12:20:59 +0530 From: "Sunil V L" To: Pierre Gondois Cc: devel@edk2.groups.io, AbdulLateef Attar , Girish Mahadevan , Jeff Brasen , Jeshua Smith , Leif Lindholm , Meenakshi Aggarwal , Sami Mujawar , Yeo Reum Yun Subject: Re: [edk2-devel] [staging/dynamictables-reorg PATCH 15/15] DynamicTablesPkg: FdtHwInfoParserLib: Create wrapper to get INTC addr cells Message-ID: References: <20240619220629.1994362-1-pierre.gondois@arm.com> <20240619220629.1994362-16-pierre.gondois@arm.com> MIME-Version: 1.0 In-Reply-To: <20240619220629.1994362-16-pierre.gondois@arm.com> 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: Tue, 02 Jul 2024 23:51:09 -0700 Resent-From: sunilvl@ventanamicro.com Reply-To: devel@edk2.groups.io,sunilvl@ventanamicro.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: 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=20240206 header.b=jViFH239; dmarc=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 On Thu, Jun 20, 2024 at 12:06:29AM +0200, Pierre Gondois wrote: > 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/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c > index 2b488016e545..5b6d5515622b 100644 > --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c > +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c > @@ -974,7 +974,7 @@ BuildSsdtPciTableEx ( > EFI_STATUS Status; > CM_ARCH_COMMON_PCI_CONFIG_SPACE_INFO *PciInfo; > UINT32 PciCount; > - UINTN Index; > + UINT32 Index; > EFI_ACPI_DESCRIPTION_HEADER **TableList; > ACPI_PCI_GENERATOR *Generator; > UINT32 Uid; > 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 ( > > return AcpiIrqFlags; > } > + > +/** For relevant architectures, get the "#address-cells" and/or "#size-cells" > + property of the node. > + > + According to the Device Tree specification, s2.3.5 "#address-cells and > + #size-cells": > + "If missing, a client program should assume a default value of 2 for > + #address-cells, and a value of 1 for #size-cells." > + > + @param [in] Fdt Pointer to a Flattened Device Tree. > + @param [in] Node Offset of the node having to get the > + "#address-cells" and "#size-cells" > + properties from. > + @param [out] AddressCells If success, number of address-cells. > + If the property is not available, > + default value is 2. > + @param [out] SizeCells If success, number of size-cells. > + If the property is not available, > + default value is 1. > + > + @retval EFI_INVALID_PARAMETER Invalid parameter. > +**/ > +EFI_STATUS > +EFIAPI > +FdtGetIntcAddressCells ( > + IN CONST VOID *Fdt, > + IN INT32 Node, > + OUT INT32 *AddressCells, OPTIONAL > + OUT INT32 *SizeCells OPTIONAL > + ) > +{ > + return FdtGetAddressInfo (Fdt, Node, AddressCells, SizeCells); > +} > diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h b/DynamicTablesPkg/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 > ); > > +/** For relevant architectures, get the "#address-cells" and/or "#size-cells" > + property of the node. > + > + According to the Device Tree specification, s2.3.5 "#address-cells and > + #size-cells": > + "If missing, a client program should assume a default value of 2 for > + #address-cells, and a value of 1 for #size-cells." > + > + @param [in] Fdt Pointer to a Flattened Device Tree. > + @param [in] Node Offset of the node having to get the > + "#address-cells" and "#size-cells" > + properties from. > + @param [out] AddressCells If success, number of address-cells. > + If the property is not available, > + default value is 2. > + @param [out] SizeCells If success, number of size-cells. > + If the property is not available, > + default value is 1. > + > + @retval EFI_INVALID_PARAMETER Invalid parameter. > +**/ > +EFI_STATUS > +EFIAPI > +FdtGetIntcAddressCells ( > + IN CONST VOID *Fdt, > + IN INT32 Node, > + OUT INT32 *AddressCells, OPTIONAL > + OUT INT32 *SizeCells OPTIONAL NIT: I might be wrong but alignment doesn't look correct. Otherwise, LGTM. Reviewed-by: Sunil V L Thanks! Sunil -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119771): https://edk2.groups.io/g/devel/message/119771 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] -=-=-=-=-=-=-=-=-=-=-=-