return EFI_UNSUPPORTED;\r
}\r
\r
- ArmGicEnableInterrupt (mGicDistributorBase, Source);\r
+ ArmGicEnableInterrupt (mGicDistributorBase, mGicRedistributorsBase, Source);\r
\r
return EFI_SUCCESS;\r
}\r
return EFI_UNSUPPORTED;\r
}\r
\r
- ArmGicDisableInterrupt (mGicDistributorBase, Source);\r
+ ArmGicDisableInterrupt (mGicDistributorBase, mGicRedistributorsBase, Source);\r
\r
return EFI_SUCCESS;\r
}\r
return EFI_UNSUPPORTED;\r
}\r
\r
- *InterruptState = ArmGicIsInterruptEnabled (mGicDistributorBase, Source);\r
+ *InterruptState = ArmGicIsInterruptEnabled (mGicDistributorBase, mGicRedistributorsBase, Source);\r
\r
return EFI_SUCCESS;\r
}\r
UINTN Index;\r
UINT32 RegOffset;\r
UINTN RegShift;\r
- UINT32 CpuTarget;\r
+ UINT64 CpuTarget;\r
+ UINT64 MpId;\r
\r
// Make sure the Interrupt Controller Protocol is not already installed in the system.\r
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid);\r
// Targets the interrupts to the Primary Cpu\r
//\r
\r
- // Only Primary CPU will run this code. We can identify our GIC CPU ID by reading\r
- // the GIC Distributor Target register. The 8 first GICD_ITARGETSRn are banked to each\r
- // connected CPU. These 8 registers hold the CPU targets fields for interrupts 0-31.\r
- // More Info in the GIC Specification about "Interrupt Processor Targets Registers"\r
- //\r
- // Read the first Interrupt Processor Targets Register (that corresponds to the 4\r
- // first SGIs)\r
- CpuTarget = MmioRead32 (mGicDistributorBase + ARM_GIC_ICDIPTR);\r
-\r
- // The CPU target is a bit field mapping each CPU to a GIC CPU Interface. This value\r
- // is 0 when we run on a uniprocessor platform.\r
- if (CpuTarget != 0) {\r
- // The 8 first Interrupt Processor Targets Registers are read-only\r
- for (Index = 8; Index < (mGicNumInterrupts / 4); Index++) {\r
- MmioWrite32 (mGicDistributorBase + ARM_GIC_ICDIPTR + (Index * 4), CpuTarget);\r
- }\r
+ MpId = ArmReadMpidr ();\r
+ CpuTarget = MpId & (ARM_CORE_AFF0 | ARM_CORE_AFF1 | ARM_CORE_AFF2 | ARM_CORE_AFF3);\r
+\r
+ // Route the SPIs to the primary CPU. SPIs start at the INTID 32\r
+ for (Index = 0; Index < (mGicNumInterrupts - 32); Index++) {\r
+ MmioWrite32 (mGicDistributorBase + ARM_GICD_IROUTER + (Index * 8), CpuTarget | ARM_GICD_IROUTER_IRM);\r
}\r
\r
// Set binary point reg to 0x7 (no preemption)\r