public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "PierreGondois" <pierre.gondois@arm.com>
To: devel@edk2.groups.io
Cc: Pierre Gondois <pierre.gondois@arm.com>,
	AbdulLateef Attar <AbdulLateef.Attar@amd.com>,
	Girish Mahadevan <gmahadevan@nvidia.com>,
	Jeff Brasen <jbrasen@nvidia.com>,
	Jeshua Smith <jeshuas@nvidia.com>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>,
	Sami Mujawar <sami.mujawar@arm.com>,
	Sunil V L <sunilvl@ventanamicro.com>,
	Yeo Reum Yun <YeoReum.Yun@arm.com>
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	[thread overview]
Message-ID: <20240619220629.1994362-12-pierre.gondois@arm.com> (raw)
In-Reply-To: <20240619220629.1994362-1-pierre.gondois@arm.com>

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 <sunilvl@ventanamicro.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c |  4 ++--
 .../FdtHwInfoParserLib/FdtHwInfoParserLib.inf   |  4 ++--
 ...nfigSpaceParser.c => PciConfigSpaceParser.c} | 17 ++++-------------
 ...nfigSpaceParser.h => PciConfigSpaceParser.h} | 10 +++++-----
 4 files changed, 13 insertions(+), 22 deletions(-)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.c => PciConfigSpaceParser.c} (95%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.h => PciConfigSpaceParser.h} (93%)

diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.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"
 #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/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.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 5d11863dfe0a..76f9efdf64d5 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.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -16,8 +16,7 @@
 #include <Library/DebugLib.h>
 
 #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)) {
@@ -727,7 +718,7 @@ FreeParserTable (
 **/
 EFI_STATUS
 EFIAPI
-ArmPciConfigInfoParser (
+PciConfigInfoParser (
   IN  CONST FDT_HW_INFO_PARSER_HANDLE  FdtParserHandle,
   IN        INT32                      FdtBranch
   )
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 e68013838515..aeffe7ac3501 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.<BR>
   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_
-- 
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]
-=-=-=-=-=-=-=-=-=-=-=-



  parent reply	other threads:[~2024-06-19 22:07 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 01/15] DynamicTablesPkg: Acpi: Move generic libraries to common folder PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 02/15] DynamicTablesPkg: Acpi: Prepare common libraries to support other archs PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 03/15] DynamicTablesPkg: AcpiFadtLib: Prepare " PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 04/15] DynamicTablesPkg: AcpiDbg2Lib: " PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 05/15] DynamicTablesPkg: AcpiSpcrLib: " PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 06/15] DynamicTablesPkg: AcpiSratLib: " PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 07/15] DynamicTablesPkg: AcpiSsdtCpuTopologyLib: Avoid dependency on GICC PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 08/15] DynamicTablesPkg: DynamicTableManagerDxe: Refactor PresenceArray PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 09/15] DynamicTablesPkg: FdtHwInfoParserLib: Move ARM parsers to Arm directory PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 10/15] DynamicTablesPkg: FdtHwInfoParserLib: Refactor to prepare for other archs PierreGondois
2024-06-19 22:06 ` PierreGondois [this message]
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 12/15] DynamicTablesPkg: FdtHwInfoParserLib: Make Serial Port parser arch neutral PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 13/15] DynamicTablesPkg: FdtHwInfoParserLib: Move ArmLib.h to ArmGicCParser.c PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 14/15] DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder PierreGondois
2024-07-03  6:20   ` Sunil V L
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 15/15] DynamicTablesPkg: FdtHwInfoParserLib: Create wrapper to get INTC addr cells PierreGondois
2024-07-03  6:50   ` Sunil V L
2024-07-03  7:36     ` Sami Mujawar
2024-07-03  9:08 ` [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs Sami Mujawar
2024-07-03  9:36   ` Sunil V L
2024-07-03  9:39     ` Sami Mujawar
2024-07-03  9:43       ` Sunil V L
2024-07-03  9:55   ` PierreGondois

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240619220629.1994362-12-pierre.gondois@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox