Skip to content

Commit

Permalink
arch/armv8-a: new config to set SPIs Configuration to edge-triggered
Browse files Browse the repository at this point in the history
Configure all SPIs(Shared Peripheral Interrupts) as edge-triggered by default

Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao committed Oct 14, 2024
1 parent 8b4603f commit 5ab4074
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions arch/arm64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,16 @@ config ARMV8A_HAVE_GICv3
Selected by the configuration tool if the architecture supports the
Generic Interrupt Controller (GIC)

if ARMV8A_HAVE_GICv3

config ARMV8A_GIC_SPI_EDGE
bool "Configure all SPIs(Shared Peripheral Interrupts) as edge-triggered by default"
default n
---help---
Configure all SPIs(Shared Peripheral Interrupts) as edge-triggered by default.

endif # ARMV8A_HAVE_GICv3

config ARCH_CORTEX_A53
bool
default n
Expand Down
8 changes: 8 additions & 0 deletions arch/arm64/src/common/arm64_gicv3.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,15 @@ static void gicv3_dist_init(void)
intid += GIC_NUM_CFG_PER_REG)
{
idx = intid / GIC_NUM_CFG_PER_REG;
#ifdef CONFIG_ARMV8A_GIC_SPI_EDGE
/* Configure all SPIs as edge-triggered by default */

putreg32(0xaaaaaaaa, ICFGR(base, idx));
#else
/* Configure all SPIs as level-sensitive by default */

putreg32(0, ICFGR(base, idx));
#endif
}

/* TODO: Some arrch64 Cortex-A core maybe without security state
Expand Down

0 comments on commit 5ab4074

Please sign in to comment.