From nobody Tue Feb 10 02:27:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81757+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81757+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1633970741; cv=none; d=zohomail.com; s=zohoarc; b=JVG29ggifBw9x71BHQ70QAMugNZkuYBO6CZe1twMoV8UsI21Cy15hH1YTWREDh8m1VdK6o3RLaH+CPkHfVhzaSCSkTLhkuHADn58qpHS58QXLx3WzYn0alDX/FpMGv6HiDoUCXdH5HgVPyzZL+5zEoOQT4iwG0I+yzzCQZZZBM4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633970741; h=Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=3e3f7W83pX41HyDjWQQj7N4RRbumTaGrBm0xMF9dAOk=; b=f121LHcK2mBx0FDEOUxpN/uRr7mlLBwTGPvhZRwY9BabO2523LKZBfQqZv91JsNDPInr1VJipjpIWafMp/mY8E827KqykHNJ70qSA8vhGkuOwBrmt2kC3Fy1GBMBteEQ30YkMYSEkMjBzPdhcX7556PDgVBRLhNqF1Oj5rczwCM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81757+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 163397074166157.53068104381998; Mon, 11 Oct 2021 09:45:41 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id MD22YY1788612xAXaHubT9cb; Mon, 11 Oct 2021 09:45:41 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.987.1633970739729041997 for ; Mon, 11 Oct 2021 09:45:39 -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 66BBEED1; Mon, 11 Oct 2021 09:45:39 -0700 (PDT) X-Received: from e120189.arm.com (unknown [10.57.74.141]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5CCF13F66F; Mon, 11 Oct 2021 09:45:38 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io, Sami Mujawar , Alexei Fedorov Subject: [edk2-devel] [PATCH v2 6/7] DynamicTablesPkg: Add Pci related objects Date: Mon, 11 Oct 2021 17:45:26 +0100 Message-Id: <20211011164527.18660-7-Pierre.Gondois@arm.com> In-Reply-To: <20211011164527.18660-1-Pierre.Gondois@arm.com> References: <20211011164527.18660-1-Pierre.Gondois@arm.com> Precedence: Bulk List-Unsubscribe: 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,pierre.gondois@arm.com X-Gm-Message-State: x9cwrnVM5ik9StJek7PE9lPgx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633970741; bh=eBjVOWhBgJVq/Eq1i4HMSY52jIdC1ZfKLX5K3aRExoQ=; h=Date:From:Reply-To:Subject:To; b=GlGFK25H49L7H5xvU4VmxLdKS4PRsn2vSDcIZdohQyOptlJrONhKhpTJb6EzDq9j4VV f9QNf2/+8QVGi67WM62PbqdV6hY5TPfbz7UeAf8v/vk3wB5sVeDu0TLJMft/7tgIaV3Vz AT74zjceRQGfFvszTa6Q/jDZto4DUQbcJ7s= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633970743873100018 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois Introduce the following CmObj in the ArmNameSpaceObjects: - CM_ARM_PCI_ADDRESS_MAP_INFO - CM_ARM_PCI_INTERRUPT_MAP_INFO These objects allow to describe address range mapping of Pci busses and interrupt mapping of Pci devices. To: Sami Mujawar To: Alexei Fedorov Reviewed-by: Sami Mujawar Signed-off-by: Pierre Gondois --- .../Include/ArmNameSpaceObjects.h | 78 +++++++++++++++++++ .../ConfigurationManagerObjectParser.c | 28 ++++++- 2 files changed, 105 insertions(+), 1 deletion(-) diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTables= Pkg/Include/ArmNameSpaceObjects.h index f19c9c706669..ac19fa1f6e6c 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -59,6 +59,8 @@ typedef enum ArmObjectID { EArmObjSerialPortInfo, ///< 35 - Generic Serial Port Info EArmObjCmn600Info, ///< 36 - CMN-600 Info EArmObjLpiInfo, ///< 37 - Lpi Info + EArmObjPciAddressMapInfo, ///< 38 - Pci Address Map Info + EArmObjPciInterruptMapInfo, ///< 39 - Pci Interrupt Map Info EArmObjMax } EARM_OBJECT_ID; =20 @@ -433,6 +435,14 @@ typedef struct CmArmPciConfigSpaceInfo { =20 /// The end bus number UINT8 EndBusNumber; + + /// Optional field: Reference Token for address mapping. + /// Token identifying a CM_ARM_OBJ_REF structure. + CM_OBJECT_TOKEN AddressMapToken; + + /// Optional field: Reference Token for interrupt mapping. + /// Token identifying a CM_ARM_OBJ_REF structure. + CM_OBJECT_TOKEN InterruptMapToken; } CM_ARM_PCI_CONFIG_SPACE_INFO; =20 /** A structure that describes the @@ -666,6 +676,10 @@ typedef struct CmArmGenericInterrupt { UINT32 Interrupt; =20 /// Flags + /// BIT0: 0: Interrupt is Level triggered + /// 1: Interrupt is Edge triggered + /// BIT1: 0: Interrupt is Active high + /// 1: Interrupt is Active low UINT32 Flags; } CM_ARM_GENERIC_INTERRUPT; =20 @@ -946,6 +960,70 @@ typedef struct CmArmLpiInfo { CHAR8 StateName[16]; } CM_ARM_LPI_INFO; =20 +/** A structure that describes a PCI Address Map. + + The memory-ranges used by the PCI bus are described by this object. + + ID: EArmObjPciAddressMapInfo +*/ +typedef struct CmArmPciAddressMapInfo { + /** Pci address space code + + Available values are: + - 0: Configuration Space + - 1: I/O Space + - 2: 32-bit-address Memory Space + - 3: 64-bit-address Memory Space + */ + UINT8 SpaceCode; + + /// PCI address + UINT64 PciAddress; + + /// Cpu address + UINT64 CpuAddress; + + /// Address size + UINT64 AddressSize; +} CM_ARM_PCI_ADDRESS_MAP_INFO; + +/** A structure that describes a PCI Interrupt Map. + + The legacy PCI interrupts used by PCI devices are described by this obje= ct. + + Cf Devicetree Specification - Release v0.3 + s2.4.3 "Interrupt Nexus Properties" + + ID: EArmObjPciInterruptMapInfo +*/ +typedef struct CmArmPciInterruptMapInfo { + /// Pci Bus. + /// Value on 8 bits (max 255). + UINT8 PciBus; + + /// Pci Bus. + /// Value on 5 bits (max 31). + UINT8 PciDevice; + + /** PCI interrupt + + ACPI bindings are used: + Cf. ACPI 6.4, s6.2.13 _PRT (PCI Routing Table): + "0-INTA, 1-INTB, 2-INTC, 3-INTD" + + Device-tree bindings are shifted by 1: + "INTA=3D1, INTB=3D2, INTC=3D3, INTD=3D4" + */ + UINT8 PciInterrupt; + + /** Interrupt controller interrupt. + + Cf Devicetree Specification - Release v0.3 + s2.4.3 "Interrupt Nexus Properties": "parent interrupt specifier" + */ + CM_ARM_GENERIC_INTERRUPT IntcInterrupt; +} CM_ARM_PCI_INTERRUPT_MAP_INFO; + #pragma pack() =20 #endif // ARM_NAMESPACE_OBJECTS_H_ diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationMa= nagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/Config= urationManagerObjectParser.c index 2337d47e3fb3..48ddc2c58c3d 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerOb= jectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerOb= jectParser.c @@ -152,7 +152,9 @@ STATIC CONST CM_OBJ_PARSER CmArmPciConfigSpaceInfoParse= r[] =3D { {"BaseAddress", 8, "0x%llx", NULL}, {"PciSegmentGroupNumber", 2, "0x%x", NULL}, {"StartBusNumber", 1, "0x%x", NULL}, - {"EndBusNumber", 1, "0x%x", NULL} + {"EndBusNumber", 1, "0x%x", NULL}, + {"AddressMapToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL}, + {"InterruptMapToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL}, }; =20 /** A parser for EArmObjHypervisorVendorIdentity. @@ -401,6 +403,26 @@ STATIC CONST CM_OBJ_PARSER CmArmLpiInfoParser[] =3D { {"StateName", 16, "0x%a", NULL}, }; =20 +/** A parser for EArmObjPciAddressMapInfo. +*/ +STATIC CONST CM_OBJ_PARSER CmArmPciAddressMapInfoParser[] =3D { + {"SpaceCode", 1, "%d", NULL}, + {"PciAddress", 8, "0x%llx", NULL}, + {"CpuAddress", 8, "0x%llx", NULL}, + {"AddressSize", 8, "0x%llx", NULL}, +}; + +/** A parser for EArmObjPciInterruptMapInfo. +*/ +STATIC CONST CM_OBJ_PARSER CmPciInterruptMapInfoParser[] =3D { + {"PciBus", 1, "0x%x", NULL}, + {"PciDevice", 1, "0x%x", NULL}, + {"PciInterrupt", 1, "0x%x", NULL}, + {"IntcInterrupt", sizeof (CM_ARM_GENERIC_INTERRUPT), + NULL, NULL, CmArmGenericInterruptParser, + ARRAY_SIZE (CmArmGenericInterruptParser)}, +}; + /** A parser for Arm namespace objects. */ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] =3D { @@ -475,6 +497,10 @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectPar= ser[] =3D { ARRAY_SIZE (CmArmCmn600InfoParser)}, {"EArmObjLpiInfo", CmArmLpiInfoParser, ARRAY_SIZE (CmArmLpiInfoParser)}, + {"EArmObjPciAddressMapInfo", CmArmPciAddressMapInfoParser, + ARRAY_SIZE (CmArmPciAddressMapInfoParser)}, + {"EArmObjPciInterruptMapInfo", CmPciInterruptMapInfoParser, + ARRAY_SIZE (CmPciInterruptMapInfoParser)}, {"EArmObjMax", NULL, 0}, }; =20 --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81757): https://edk2.groups.io/g/devel/message/81757 Mute This Topic: https://groups.io/mt/86241746/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-