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 92A3B740039 for ; Wed, 19 Jun 2024 22:07:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=y+l9BBXx1KiiyXUqevlfT11Fs7zqOJT7pMauJ+fcTiw=; 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=1718834844; v=1; b=cWt+k1oVkmy2doCCVFckh+VN/VwjDNbZMfB/IzNgcBjAc/JhWQC4gaeKKGMsXQCMQ9H06SLn t9RzelCQJSqCMELpLRRG1jMGyk4fzCY/F2X7VCFX0zALWsXqqCsRXDukR0tXiH3a44FSJ4V/lE8 elKklvTqKgpM9frT6s+n7FIN20zDmfhIqCONZ18w3/W0Ijor3FikWZBGfqCLBO/1wnMGdCksryK M4on7dtS68wqiZqm+wTfvqq99VLil/ZLH3Q1tuGsmK7LGVnk1PLjRiE1jF3FHt6aVGiUVgxE5Ol 15COIVD/ZFJs25xlq+dvMAPvWxhfn3LUd5pJ5QxhNqRrQ== X-Received: by 127.0.0.2 with SMTP id kw03YY7687511xmpMZDo9l21; Wed, 19 Jun 2024 15:07:23 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.34005.1718834837527347986 for ; Wed, 19 Jun 2024 15:07:17 -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 E87E2DA7; Wed, 19 Jun 2024 15:07:41 -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 D0BC23F64C; Wed, 19 Jun 2024 15:07:14 -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 11/15] DynamicTablesPkg: FdtHwInfoParserLib: Make Pci parser arch neutral Date: Thu, 20 Jun 2024 00:06:25 +0200 Message-Id: <20240619220629.1994362-12-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:17 -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: FVHqdQC1rrE5CRBNnoueOdGzx7686176AA= 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=cWt+k1oV; 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 To allow other architectures to potentially re-use the serial port parser and make the code arch neutral, remove the Arm prefixes. Also remove the check searching for a GIC version. Suggested-by: Sunil V L Signed-off-by: Pierre Gondois --- .../FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c | 4 ++-- .../FdtHwInfoParserLib/FdtHwInfoParserLib.inf | 4 ++-- ...nfigSpaceParser.c =3D> PciConfigSpaceParser.c} | 17 ++++------------- ...nfigSpaceParser.h =3D> PciConfigSpaceParser.h} | 10 +++++----- 4 files changed, 13 insertions(+), 22 deletions(-) rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceP= arser.c =3D> PciConfigSpaceParser.c} (95%) rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceP= arser.h =3D> PciConfigSpaceParser.h} (93%) diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoPa= rser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser= .c index 403402731add..49a7636dad0a 100644 --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c @@ -9,7 +9,7 @@ #include "Arm/BootArch/ArmBootArchParser.h"=0D #include "Arm/GenericTimer/ArmGenericTimerParser.h"=0D #include "Arm/Gic/ArmGicDispatcher.h"=0D -#include "Pci/ArmPciConfigSpaceParser.h"=0D +#include "Pci/PciConfigSpaceParser.h"=0D #include "Serial/ArmSerialPortParser.h"=0D =0D /** Ordered table of parsers/dispatchers.=0D @@ -25,7 +25,7 @@ STATIC CONST FDT_HW_INFO_PARSER_FUNC HwInfoParserTable[]= =3D { ArmBootArchInfoParser,=0D ArmGenericTimerInfoParser,=0D ArmGicDispatcher,=0D - ArmPciConfigInfoParser,=0D + PciConfigInfoParser,=0D SerialPortDispatcher=0D };=0D =0D diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib= .inf b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf index 3abc6a0fd274..55ec7d97fa18 100644 --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf @@ -22,8 +22,8 @@ [Sources] FdtHwInfoParser.h=0D FdtUtility.c=0D FdtUtility.h=0D - Pci/ArmPciConfigSpaceParser.c=0D - Pci/ArmPciConfigSpaceParser.h=0D + Pci/PciConfigSpaceParser.c=0D + Pci/PciConfigSpaceParser.h=0D Serial/ArmSerialPortParser.c=0D Serial/ArmSerialPortParser.h=0D =0D diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSp= aceParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpac= eParser.c similarity index 95% rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpa= ceParser.c rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpacePar= ser.c index 5d11863dfe0a..76f9efdf64d5 100644 --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpacePars= er.c +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.c @@ -1,5 +1,5 @@ /** @file=0D - Arm PCI Configuration Space Parser.=0D + PCI Configuration Space Parser.=0D =0D Copyright (c) 2021, ARM Limited. All rights reserved.
=0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D @@ -16,8 +16,7 @@ #include =0D =0D #include "FdtHwInfoParser.h"=0D -#include "Pci/ArmPciConfigSpaceParser.h"=0D -#include "Arm/Gic/ArmGicDispatcher.h"=0D +#include "Pci/PciConfigSpaceParser.h"=0D =0D /** List of "compatible" property values for host PCIe bridges nodes.=0D =0D @@ -306,8 +305,7 @@ ParseIrqMap ( CONST UINT8 *IrqMapMask;=0D INT32 IrqMapMaskSize;=0D =0D - INT32 PHandleOffset;=0D - UINT32 GicVersion;=0D + INT32 PHandleOffset;=0D =0D UINT32 PciAddressAttr;=0D =0D @@ -366,13 +364,6 @@ ParseIrqMap ( return EFI_ABORTED;=0D }=0D =0D - // Only support Gic(s) for now.=0D - Status =3D GetGicVersion (Fdt, IntcNode, &GicVersion);=0D - if (EFI_ERROR (Status)) {=0D - ASSERT (0);=0D - return Status;=0D - }=0D -=0D // Get the "address-cells" property of the IntcNode.=0D Status =3D FdtGetAddressInfo (Fdt, IntcNode, &IntcAddressCells, NULL);=0D if (EFI_ERROR (Status)) {=0D @@ -727,7 +718,7 @@ FreeParserTable ( **/=0D EFI_STATUS=0D EFIAPI=0D -ArmPciConfigInfoParser (=0D +PciConfigInfoParser (=0D IN CONST FDT_HW_INFO_PARSER_HANDLE FdtParserHandle,=0D IN INT32 FdtBranch=0D )=0D diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSp= aceParser.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpac= eParser.h similarity index 93% rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpa= ceParser.h rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpacePar= ser.h index e68013838515..aeffe7ac3501 100644 --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpacePars= er.h +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.h @@ -1,5 +1,5 @@ /** @file=0D - Arm PCI Configuration Space Parser.=0D + PCI Configuration Space Parser.=0D =0D Copyright (c) 2021, ARM Limited. All rights reserved.
=0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D @@ -12,8 +12,8 @@ - linux kernel code=0D **/=0D =0D -#ifndef ARM_PCI_CONFIG_SPACE_PARSER_H_=0D -#define ARM_PCI_CONFIG_SPACE_PARSER_H_=0D +#ifndef PCI_CONFIG_SPACE_PARSER_H_=0D +#define PCI_CONFIG_SPACE_PARSER_H_=0D =0D /** Read LEN bits at OFF offsets bits of the ADDR.=0D =0D @@ -135,9 +135,9 @@ typedef struct PciParserTable { **/=0D EFI_STATUS=0D EFIAPI=0D -ArmPciConfigInfoParser (=0D +PciConfigInfoParser (=0D IN CONST FDT_HW_INFO_PARSER_HANDLE FdtParserHandle,=0D IN INT32 FdtBranch=0D );=0D =0D -#endif // ARM_PCI_CONFIG_SPACE_PARSER_H_=0D +#endif // PCI_CONFIG_SPACE_PARSER_H_=0D --=20 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119643): https://edk2.groups.io/g/devel/message/119643 Mute This Topic: https://groups.io/mt/106770176/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-