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 @@ -361,6 +361,13 @@ config ARM64_GICV3_SPI_EDGE
361
361
---help---
362
362
Configure all SPIs(Shared Peripheral Interrupts) as edge-triggered by default.
363
363
364
+ config ARM64_GICV3_SPI_ROUTING_CPU0
365
+ bool "Configure SPI interrupt affinity routing to CPU0 by default"
366
+ default y if SMP
367
+ default n
368
+ ---help---
369
+ Configure SPI interrupt affinity routing to CPU0 by default.
370
+
364
371
endif
365
372
366
373
config ARM64_SEMIHOSTING_HOSTFS
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_ARM64_GICV3_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_ARM64_GICV3_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