From c9e8774cb806dbf989ca84d401d6ecbd199f6b67 Mon Sep 17 00:00:00 2001 From: Leo Yan Date: Wed, 26 Jul 2017 14:36:01 +0800 Subject: [PATCH] hikey: Disable VBUS_DET interrupt for PMIC After disconnect Jumper pin 1-2 in J15 header, the signal VBUS_DET is to be pulled down to low level. This will assert the interrupt signal in PMIC and trigger IRQ in GIC; the asserted signal from VBUS_DET is level triggered and kernel reports the warning for unhooked interrupt handling; and VBUS_DET stays with low level, this triggers IRQ storm in kernel. This patch is to disable interrupt for VBUS_DET in PMIC, this can dismiss the verbose log and IRQ storm after kernel booting. [ 40.835279] irq 57: nobody cared (try booting with the "irqpoll" option) [ 40.842075] CPU: 0 PID: 980 Comm: irq/57-hi655x-p Not tainted 4.4.77-568944-g576a0114dec8-dirty #667 [ 40.851303] Hardware name: HiKey Development Board (DT) [ 40.856580] Call trace: [ 40.859060] [] dump_backtrace+0x0/0x1e0 [ 40.864516] [] show_stack+0x20/0x28 [ 40.869622] [] dump_stack+0xa8/0xe0 [ 40.874729] [] __report_bad_irq+0x40/0xec [ 40.880360] [] note_interrupt+0x1e4/0x2d8 [ 40.885992] [] handle_irq_event_percpu+0xd8/0x268 [ 40.892324] [] handle_irq_event+0x4c/0x7c [ 40.897955] [] handle_level_irq+0xcc/0x178 [ 40.903672] [] generic_handle_irq+0x34/0x4c [ 40.909481] [] pl061_irq_handler+0xa8/0x124 [ 40.915286] [] generic_handle_irq+0x34/0x4c [ 40.921092] [] __handle_domain_irq+0x90/0xf8 [ 40.926985] [] gic_handle_irq+0x58/0xa8 Signed-off-by: Dmitry Shmidt Signed-off-by: Leo Yan --- plat/hisilicon/hikey/hikey_bl1_setup.c | 5 +++++ plat/hisilicon/hikey/include/hi6553.h | 1 + 2 files changed, 6 insertions(+) diff --git a/plat/hisilicon/hikey/hikey_bl1_setup.c b/plat/hisilicon/hikey/hikey_bl1_setup.c index b00587463..05e2e35db 100644 --- a/plat/hisilicon/hikey/hikey_bl1_setup.c +++ b/plat/hisilicon/hikey/hikey_bl1_setup.c @@ -288,6 +288,11 @@ static void hikey_hi6553_init(void) /* select 32.764KHz */ mmio_write_8(HI6553_CLK19M2_600_586_EN, 0x01); + + /* Disable vbus_det interrupts */ + data = mmio_read_8(HI6553_IRQ2_MASK); + data = data | 0x3; + mmio_write_8(HI6553_IRQ2_MASK, data); } static void init_mmc0_pll(void) diff --git a/plat/hisilicon/hikey/include/hi6553.h b/plat/hisilicon/hikey/include/hi6553.h index 76cb8ff10..a80d36dfb 100644 --- a/plat/hisilicon/hikey/include/hi6553.h +++ b/plat/hisilicon/hikey/include/hi6553.h @@ -19,6 +19,7 @@ #define DISABLE6_XO_CLK_RF2 (1 << 4) #define HI6553_VERSION_REG (PMUSSI_BASE + (0x000 << 2)) +#define HI6553_IRQ2_MASK (PMUSSI_BASE + (0x008 << 2)) #define HI6553_ENABLE2_LDO1_8 (PMUSSI_BASE + (0x029 << 2)) #define HI6553_DISABLE2_LDO1_8 (PMUSSI_BASE + (0x02a << 2)) #define HI6553_ONOFF_STATUS2_LDO1_8 (PMUSSI_BASE + (0x02b << 2))