diff mbox series

[boot-wrapper] gic: assign last ITLine to group 1

Message ID 20221027153210.30692-1-vkorenblit@sequans.com (mailing list archive)
State New, archived
Headers show
Series [boot-wrapper] gic: assign last ITLine to group 1 | expand

Commit Message

Valentin Korenblit Oct. 27, 2022, 3:32 p.m. UTC
ITLinesNumber, bits [4:0] == NUM_SPIS/32

The loop is not considering the last irq line, thus
only NUM_SPIS-32 are usable in non-secure mode.

Signed-off-by: Valentin Korenblit <vkorenblit@sequans.com>
---
 common/gic-v3.c | 2 +-
 common/gic.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/common/gic-v3.c b/common/gic-v3.c
index 6207007..23d6dc5 100644
--- a/common/gic-v3.c
+++ b/common/gic-v3.c
@@ -91,7 +91,7 @@  void gic_secure_init_primary(void)
 	} while (!(typer & GICR_TYPER_Last));
 
 	typer = raw_readl(gicd_base + GICD_TYPER);
-	for (i = 1; i < (typer & GICD_TYPER_ITLineNumber); i++) {
+	for (i = 1; i <= (typer & GICD_TYPER_ITLineNumber); i++) {
 		raw_writel(~0x0, gicd_base + GICD_IGROUP0 + i * 4);
 		raw_writel(0x0, gicd_base + GICD_IGRPMOD0 + i * 4);
 	}
diff --git a/common/gic.c b/common/gic.c
index 04d4289..6c3ee76 100644
--- a/common/gic.c
+++ b/common/gic.c
@@ -41,7 +41,7 @@  void gic_secure_init(void)
 		uint32_t typer = raw_readl(gicd_base + GICD_TYPER);
 
 		/* Set SPIs to Group 1 */
-		for (i = 1; i < (typer & GICD_TYPER_ITLineNumber); i++)
+		for (i = 1; i <= (typer & GICD_TYPER_ITLineNumber); i++)
 			raw_writel(~0, gicd_base + GICD_IGROUPRn + i * 4);
 
 		raw_writel(GICD_CTLR_EnableGrp0 | GICD_CTLR_EnableGrp1,