[edk2-devel] [PATCH v2 2/2] ArmPkg/ArmGicV3Dxe: Use ArmGicSetInterruptPriority() to set priority

Quan Nguyen via groups.io posted 2 patches 5 years, 1 month ago
[edk2-devel] [PATCH v2 2/2] ArmPkg/ArmGicV3Dxe: Use ArmGicSetInterruptPriority() to set priority
Posted by Quan Nguyen via groups.io 5 years, 1 month ago
When Affinity Routing enabled, the GICR_IPRIORITYR<n> is used to set
priority for SGIs and PPIs instead of GICD_IPRIORITYR<n>.
This patch calls ArmGicSetInterruptPriority() helper function when
setting priority to handle the difference.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Victor Gallardo <Victor@os.amperecomputing.com>
Signed-off-by: Quan Nguyen <quan@os.amperecomputing.com>
---
 ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c b/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c
index d7da1f198d9e..16bccbff413b 100644
--- a/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c
+++ b/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c
@@ -374,8 +374,6 @@ GicV3DxeInitialize (
 {

   EFI_STATUS              Status;

   UINTN                   Index;

-  UINT32                  RegOffset;

-  UINTN                   RegShift;

   UINT64                  CpuTarget;

   UINT64                  MpId;

 

@@ -397,12 +395,11 @@ GicV3DxeInitialize (
     GicV3DisableInterruptSource (&gHardwareInterruptV3Protocol, Index);

 

     // Set Priority

-    RegOffset = Index / 4;

-    RegShift = (Index % 4) * 8;

-    MmioAndThenOr32 (

-      mGicDistributorBase + ARM_GIC_ICDIPR + (4 * RegOffset),

-      ~(0xff << RegShift),

-      ARM_GIC_DEFAULT_PRIORITY << RegShift

+    ArmGicSetInterruptPriority (

+      mGicDistributorBase,

+      mGicRedistributorsBase,

+      Index,

+      ARM_GIC_DEFAULT_PRIORITY

       );

   }

 

-- 
2.28.0



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