[edk2-devel] [PATCH 09/14] DynamicTablesPkg: Fix Ssdt PCI generation comments

PierreGondois posted 14 patches 3 years, 4 months ago
[edk2-devel] [PATCH 09/14] DynamicTablesPkg: Fix Ssdt PCI generation comments
Posted by PierreGondois 3 years, 4 months ago
From: Pierre Gondois <pierre.gondois@arm.com>

The second model of the _PRT object is used. Indeed:
- the interrupts described are not re-configurable
- OSes are aware of the polarity of PCI legacy interrupts,
  so there is no need to accurately describe the polarity.

Also, fix a comment for the CM_ARM_PCI_INTERRUPT_MAP_INFO obj.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h            | 2 +-
 .../Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c       | 8 ++------
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index cd39e609d6c4..d711f3ec5938 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -1014,7 +1014,7 @@ typedef struct CmArmPciInterruptMapInfo {
   /// Value on 8 bits (max 255).
   UINT8    PciBus;
 
-  /// Pci Bus.
+  /// Pci Device.
   /// Value on 5 bits (max 31).
   UINT8    PciDevice;
 
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
index 85098752c614..c54ae6f551f6 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
@@ -288,12 +288,6 @@ GeneratePciDeviceInfo (
 
   Cf. ACPI 6.4 specification, s6.2.13 "_PRT (PCI Routing Table)"
 
-  The first model (defining a _CRS object) is used. This is necessary because
-  PCI legacy interrupts are active low and GICv2 SPI interrupts are active
-  high.
-  Even though PCI interrupts cannot be re-routed, only the first model allows
-  to specify the activation state (low/high).
-
   @param [in]       Generator       The SSDT Pci generator.
   @param [in]       CfgMgrProtocol  Pointer to the Configuration Manager
                                     Protocol interface.
@@ -397,6 +391,8 @@ GeneratePrt (
        High word-Device #, Low word-Function #. (for example, device 3,
        function 2 is 0x00030002). To refer to all the functions on a device #,
        use a function number of FFFF).
+
+      Use the second model for _PRT object and describe a hardwired interrupt.
     */
     Status = AmlAddPrtEntry (
                (IrqMapInfo->PciDevice << 16) | 0xFFFF,
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94890): https://edk2.groups.io/g/devel/message/94890
Mute This Topic: https://groups.io/mt/94232528/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 09/14] DynamicTablesPkg: Fix Ssdt PCI generation comments
Posted by Sami Mujawar 3 years, 3 months ago
Hi Pierre,

Thank you for this patch.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
>
> The second model of the _PRT object is used. Indeed:
> - the interrupts described are not re-configurable
> - OSes are aware of the polarity of PCI legacy interrupts,
>    so there is no need to accurately describe the polarity.
>
> Also, fix a comment for the CM_ARM_PCI_INTERRUPT_MAP_INFO obj.
>
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
> ---
>   DynamicTablesPkg/Include/ArmNameSpaceObjects.h            | 2 +-
>   .../Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c       | 8 ++------
>   2 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
> index cd39e609d6c4..d711f3ec5938 100644
> --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
> +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
> @@ -1014,7 +1014,7 @@ typedef struct CmArmPciInterruptMapInfo {
>     /// Value on 8 bits (max 255).
>     UINT8    PciBus;
>   
> -  /// Pci Bus.
> +  /// Pci Device.
>     /// Value on 5 bits (max 31).
>     UINT8    PciDevice;
>   
> diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
> index 85098752c614..c54ae6f551f6 100644
> --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
> +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
> @@ -288,12 +288,6 @@ GeneratePciDeviceInfo (
>   
>     Cf. ACPI 6.4 specification, s6.2.13 "_PRT (PCI Routing Table)"
>   
> -  The first model (defining a _CRS object) is used. This is necessary because
> -  PCI legacy interrupts are active low and GICv2 SPI interrupts are active
> -  high.
> -  Even though PCI interrupts cannot be re-routed, only the first model allows
> -  to specify the activation state (low/high).
> -
>     @param [in]       Generator       The SSDT Pci generator.
>     @param [in]       CfgMgrProtocol  Pointer to the Configuration Manager
>                                       Protocol interface.
> @@ -397,6 +391,8 @@ GeneratePrt (
>          High word-Device #, Low word-Function #. (for example, device 3,
>          function 2 is 0x00030002). To refer to all the functions on a device #,
>          use a function number of FFFF).
> +
> +      Use the second model for _PRT object and describe a hardwired interrupt.
>       */
>       Status = AmlAddPrtEntry (
>                  (IrqMapInfo->PciDevice << 16) | 0xFFFF,


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95606): https://edk2.groups.io/g/devel/message/95606
Mute This Topic: https://groups.io/mt/94232528/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-