From eca6f1ffbfc1aba2775fc1708784eebe193dff3f Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Thu, 19 Sep 2019 15:31:51 +0800 Subject: [PATCH] irq: gicv2: fix GIC not response to USB OTG IRQ It handles the issue when the bootflow without Miniloader, i.e. Maskrom => Trust(optional) => U-Boot. Change-Id: I445225d5cce9abd2117ef468f15774e3fa57e16d Signed-off-by: Joseph Chen --- drivers/irq/irq-gic.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/irq/irq-gic.c b/drivers/irq/irq-gic.c index 4d8d29ddfa..43a1abcfdc 100644 --- a/drivers/irq/irq-gic.c +++ b/drivers/irq/irq-gic.c @@ -330,8 +330,17 @@ static int gic_irq_init(void) #ifdef CONFIG_GICV2 u32 val; - /* end of interrupt */ - gicc_writel(PLATFORM_GIC_MAX_IRQ, GICC_EOIR); + /* + * If system boot without Miniloader: + * "Maskrom => Trust(optional) => U-Boot" + * + * IRQ_USB_OTG must be acked by GICC_EIO due to maskrom jumps to the + * U-Boot in its USB interrupt. Without this ack, the GICC_IAR always + * return a spurious interrupt ID 1023 for USB OTG interrupt. + */ +#ifdef IRQ_USB_OTG + gicc_writel(IRQ_USB_OTG, GICC_EOIR); +#endif /* disable gicc and gicd */ gicc_writel(0, GICC_CTLR);