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 C21EF941D98 for ; Tue, 9 Jan 2024 16:30:39 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=F+sxvnUgOsYFBS6lJ2oFSr8FfOF10m2damI9W603x24=; 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:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1704817838; v=1; b=ROL+IOLrypnyt6cqth88z0iEdQ77zeqsoLiJhV7YOTugJO5h+mCazntMCPqnaxNVjvtpELbr N+7zqSGKHiMtUWQ/eJyIRTVmdC9nqb/8zU7DnHXDu48opTGsTgqbS0HwI1efDi+0RXKJzOIVz3S y7VKsv/8Ky0MHwBQJbbJNmhQ= X-Received: by 127.0.0.2 with SMTP id 9gY3YY7687511xvwXqCZbk0n; Tue, 09 Jan 2024 08:30:38 -0800 X-Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mx.groups.io with SMTP id smtpd.web11.21062.1704817837955962393 for ; Tue, 09 Jan 2024 08:30:38 -0800 X-Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1d3ef33e68dso21758735ad.1 for ; Tue, 09 Jan 2024 08:30:37 -0800 (PST) X-Gm-Message-State: ccWSG3RqKL699O1qoXwdUEcmx7686176AA= X-Google-Smtp-Source: AGHT+IEVL5BE2nQLalpLtXxdJ7HN3PHO8zieiYMeUfFk7XaEhfFFYVowrGPiGHim38e6iYcWZpzhiQ== X-Received: by 2002:a17:902:d58a:b0:1d4:a6ce:113c with SMTP id k10-20020a170902d58a00b001d4a6ce113cmr1406837plh.53.1704817836277; Tue, 09 Jan 2024 08:30:36 -0800 (PST) X-Received: from localhost.localdomain ([106.51.188.200]) by smtp.gmail.com with ESMTPSA id c12-20020a170902b68c00b001d457090851sm1983596pls.289.2024.01.09.08.30.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 08:30:35 -0800 (PST) From: "Sunil V L" To: devel@edk2.groups.io Cc: Sunil V L , Ard Biesheuvel , Leif Lindholm , Pierre Gondois , Sami Mujawar Subject: [edk2-devel] [RFC PATCH v1 14/20] DynamicTablesPkg/FdtHwInfoParserLib: Add function for INTC address cells Date: Tue, 9 Jan 2024 21:59:38 +0530 Message-Id: <20240109162944.528006-15-sunilvl@ventanamicro.com> In-Reply-To: <20240109162944.528006-1-sunilvl@ventanamicro.com> References: <20240109162944.528006-1-sunilvl@ventanamicro.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 Reply-To: devel@edk2.groups.io,sunilvl@ventanamicro.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=ROL+IOLr; dmarc=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 Parent interrupt controller's address cells is arch specific. So, create a function which can be implemented differently for different archs. Move current implementation to ARM specific file. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Pierre Gondois Cc: Sami Mujawar Signed-off-by: Sunil V L --- .../Library/FdtHwInfoParserLib/FdtUtility.h | 9 ++++++ .../FdtHwInfoParserLib/Arm/ArmFdtUtility.c | 29 +++++++++++++++++++ .../Pci/PciConfigSpaceParser.c | 2 +- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h index 3f5d131d9ae5..1d56d044a73e 100644 --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h @@ -455,4 +455,13 @@ FdtGetParentAddressInfo ( OUT INT32 *SizeCells OPTIONAL ); +EFI_STATUS +EFIAPI +FdtGetIntcAddressCells ( + IN CONST VOID *Fdt, + IN INT32 Node, + OUT INT32 *AddressCells, OPTIONAL + OUT INT32 *SizeCells OPTIONAL + ); + #endif // FDT_UTILITY_H_ diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c index 21b1306e577d..1b2196ef1734 100644 --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c @@ -83,3 +83,32 @@ FdtGetInterruptFlags ( return AcpiIrqFlags; } + +/** Get the Address cell info of the INTC node + + @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_SUCCESS The function completed successfully. + @retval EFI_ABORTED An error occurred. + @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/Pci/PciConfigSpaceParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.c index afe756bcedab..766f784da13c 100644 --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.c +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.c @@ -365,7 +365,7 @@ ParseIrqMap ( } // Get the "address-cells" property of the IntcNode. - Status = FdtGetAddressInfo (Fdt, IntcNode, &IntcAddressCells, NULL); + Status = FdtGetIntcAddressCells (Fdt, IntcNode, &IntcAddressCells, NULL); if (EFI_ERROR (Status)) { ASSERT (0); return Status; -- 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113476): https://edk2.groups.io/g/devel/message/113476 Mute This Topic: https://groups.io/mt/103622734/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-