Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions platforms/bk7231n/bk7231n_os/beken378/driver/intc/intc.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,20 @@ void intc_init(void)
*((volatile uint32_t *)0x400014) = (uint32_t)&do_dabort;
*((volatile uint32_t *)0x400018) = (uint32_t)&do_reserved;

/*
* Deep-sleep wakeup is not a full cold boot: some interrupt status bits can
* remain set. If we enable global IRQ/FIQ here while a pending interrupt is
* already latched, we may enter IRQ/FIQ handlers before the OS/heap is ready,
* and get stuck very early in boot (no further logs after bk_misc_init_start_type).
*
* Clear any pending interrupt status before enabling sources.
*/
{
UINT32 clr = 0xFFFFFFFF;
icu_ctrl(CMD_CLR_INTR_STATUS, &clr);
icu_ctrl(CMD_CLR_INTR_RAW_STATUS, &clr);
}

intc_enable(FIQ_MAC_GENERAL);
intc_enable(FIQ_MAC_PROT_TRIGGER);

Expand Down