File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,13 @@ config ARMV8A_GIC_SPI_EDGE
226
226
---help---
227
227
Configure all SPIs(Shared Peripheral Interrupts) as edge-triggered by default.
228
228
229
+ config ARMV8A_GIC_SPI_ROUTING_CPU0
230
+ bool "Configure SPI interrupt affinity routing to CPU0 by default"
231
+ default y if SMP
232
+ default n
233
+ ---help---
234
+ Configure SPI interrupt affinity routing to CPU0 by default.
235
+
229
236
endif # ARMV8A_HAVE_GICv3
230
237
231
238
config ARCH_CORTEX_A53
Original file line number Diff line number Diff line change @@ -506,7 +506,7 @@ void arm64_cpu_enable(void);
506
506
#ifdef CONFIG_SMP
507
507
uint64_t arm64_get_mpid (int cpu );
508
508
#else
509
- # define arm64_get_mpid (cpu ) GET_MPIDR()
509
+ # define arm64_get_mpid (cpu ) ( GET_MPIDR() & MPIDR_ID_MASK )
510
510
#endif /* CONFIG_SMP */
511
511
512
512
/****************************************************************************
Original file line number Diff line number Diff line change @@ -254,10 +254,12 @@ void arm64_gic_irq_enable(unsigned int intid)
254
254
* SPI's affinity, now set it to be the PE on which it is enabled.
255
255
*/
256
256
257
+ #ifndef CONFIG_ARMV8A_GIC_SPI_ROUTING_CPU0
257
258
if (GIC_IS_SPI (intid ))
258
259
{
259
260
arm64_gic_write_irouter ((GET_MPIDR () & MPIDR_ID_MASK ), intid );
260
261
}
262
+ #endif
261
263
262
264
putreg32 (mask , ISENABLER (GET_DIST_BASE (intid ), idx ));
263
265
}
@@ -618,6 +620,17 @@ static void gicv3_dist_init(void)
618
620
#endif
619
621
}
620
622
623
+ /* Configure SPI interrupt affinity routing to CPU0 */
624
+
625
+ #ifdef CONFIG_ARMV8A_GIC_SPI_ROUTING_CPU0
626
+ uint64_t mpid = arm64_get_mpid (0 );
627
+
628
+ for (intid = GIC_SPI_INT_BASE ; intid < num_ints ; intid ++ )
629
+ {
630
+ putreg64 (mpid , IROUTER (base , intid ));
631
+ }
632
+ #endif
633
+
621
634
/* TODO: Some arrch64 Cortex-A core maybe without security state
622
635
* it has different GIC configure with standard arrch64 A or R core
623
636
*/
You can’t perform that action at this time.
0 commit comments