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 38593740041 for ; Tue, 9 Jan 2024 16:30:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=kPWZs7T93yL2rn3AvrQggLa8vAdAgXEPEqLO3Uv03bg=; 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=1704817822; v=1; b=c07TZQCgpZYgx4ngNGGhJz17wDiKWWXUjMEvqySIfZOn1zPaUEnWEX/5aOvDsn+LYA05hRKZ BxoeXqIandNf4IbNxnPwkZEl8ekHEHACIZ8O9GV5CSJTEp9B769refkhBjYV4DtYlM16wT3Ozaz E1Og7d0pGj9IN/7R2ibTM8WQ= X-Received: by 127.0.0.2 with SMTP id SXBoYY7687511xljn7u24B4x; Tue, 09 Jan 2024 08:30:22 -0800 X-Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mx.groups.io with SMTP id smtpd.web10.21260.1704817822434865340 for ; Tue, 09 Jan 2024 08:30:22 -0800 X-Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1d4414ec9c7so14310205ad.0 for ; Tue, 09 Jan 2024 08:30:22 -0800 (PST) X-Gm-Message-State: uMLdNtaPM89sKBs5csRK3Q5Ex7686176AA= X-Google-Smtp-Source: AGHT+IG0x+xqzlwENW6Gqhfk2yIknJPfPE2ncxqg5V6hq86b5styaaYAiuf5ctJB8Jg65GViyJdSxQ== X-Received: by 2002:a17:902:740b:b0:1d4:1dac:9fa9 with SMTP id g11-20020a170902740b00b001d41dac9fa9mr3440797pll.72.1704817820207; Tue, 09 Jan 2024 08:30:20 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 08:30:19 -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 08/20] DynamicTablesPkg: FdtHwInfoParserLib: Pci: Make it common for architectures Date: Tue, 9 Jan 2024 21:59:32 +0530 Message-Id: <20240109162944.528006-9-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=c07TZQCg; 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 PciConfigParser is a generic concept and can be used by other architectures. Hence, rename to reflect it is common and updates the consumers. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Pierre Gondois Cc: Sami Mujawar Signed-off-by: Sunil V L --- .../FdtHwInfoParserLib/FdtHwInfoParserLib.inf | 4 ++-- ...nfigSpaceParser.h => PciConfigSpaceParser.h} | 10 +++++----- .../FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c | 4 ++-- ...nfigSpaceParser.c => PciConfigSpaceParser.c} | 17 ++++------------- 4 files changed, 13 insertions(+), 22 deletions(-) rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.h => PciConfigSpaceParser.h} (93%) rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.c => PciConfigSpaceParser.c} (95%) 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 FdtUtility.c FdtUtility.h - Pci/ArmPciConfigSpaceParser.c - Pci/ArmPciConfigSpaceParser.h + Pci/PciConfigSpaceParser.c + Pci/PciConfigSpaceParser.h Serial/ArmSerialPortParser.c Serial/ArmSerialPortParser.h diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.h similarity index 93% rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.h index bfe724a69e55..106a7a92af47 100644 --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.h @@ -1,5 +1,5 @@ /** @file - Arm PCI Configuration Space Parser. + PCI Configuration Space Parser. Copyright (c) 2021, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -12,8 +12,8 @@ - linux kernel code **/ -#ifndef ARM_PCI_CONFIG_SPACE_PARSER_H_ -#define ARM_PCI_CONFIG_SPACE_PARSER_H_ +#ifndef PCI_CONFIG_SPACE_PARSER_H_ +#define PCI_CONFIG_SPACE_PARSER_H_ /** Read LEN bits at OFF offsets bits of the ADDR. @@ -135,9 +135,9 @@ typedef struct PciParserTable { **/ EFI_STATUS EFIAPI -ArmPciConfigInfoParser ( +PciConfigInfoParser ( IN CONST FDT_HW_INFO_PARSER_HANDLE FdtParserHandle, IN INT32 FdtBranch ); -#endif // ARM_PCI_CONFIG_SPACE_PARSER_H_ +#endif // PCI_CONFIG_SPACE_PARSER_H_ diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c index 4b1f5eeea423..8dd6546e62f0 100644 --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c @@ -9,7 +9,7 @@ #include "Arm/BootArch/ArmBootArchParser.h" #include "Arm/GenericTimer/ArmGenericTimerParser.h" #include "Arm/Gic/ArmGicDispatcher.h" -#include "Pci/ArmPciConfigSpaceParser.h" +#include "Pci/PciConfigSpaceParser.h" #include "Serial/ArmSerialPortParser.h" /** Ordered table of parsers/dispatchers. @@ -25,7 +25,7 @@ STATIC CONST FDT_HW_INFO_PARSER_FUNC HwInfoParserTable[] = { ArmBootArchInfoParser, ArmGenericTimerInfoParser, ArmGicDispatcher, - ArmPciConfigInfoParser, + PciConfigInfoParser, SerialPortDispatcher }; diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.c similarity index 95% rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.c index d6a08c47b7d5..afe756bcedab 100644 --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.c @@ -1,5 +1,5 @@ /** @file - Arm PCI Configuration Space Parser. + PCI Configuration Space Parser. Copyright (c) 2021, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -16,8 +16,7 @@ #include #include "FdtHwInfoParser.h" -#include "Pci/ArmPciConfigSpaceParser.h" -#include "Arm/Gic/ArmGicDispatcher.h" +#include "Pci/PciConfigSpaceParser.h" /** List of "compatible" property values for host PCIe bridges nodes. @@ -306,8 +305,7 @@ ParseIrqMap ( CONST UINT8 *IrqMapMask; INT32 IrqMapMaskSize; - INT32 PHandleOffset; - UINT32 GicVersion; + INT32 PHandleOffset; UINT32 PciAddressAttr; @@ -366,13 +364,6 @@ ParseIrqMap ( return EFI_ABORTED; } - // Only support Gic(s) for now. - Status = GetGicVersion (Fdt, IntcNode, &GicVersion); - if (EFI_ERROR (Status)) { - ASSERT (0); - return Status; - } - // Get the "address-cells" property of the IntcNode. Status = FdtGetAddressInfo (Fdt, IntcNode, &IntcAddressCells, NULL); if (EFI_ERROR (Status)) { @@ -725,7 +716,7 @@ FreeParserTable ( **/ EFI_STATUS EFIAPI -ArmPciConfigInfoParser ( +PciConfigInfoParser ( IN CONST FDT_HW_INFO_PARSER_HANDLE FdtParserHandle, IN INT32 FdtBranch ) -- 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113470): https://edk2.groups.io/g/devel/message/113470 Mute This Topic: https://groups.io/mt/103622723/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-