Skip to content

Commit c467506

Browse files
lifenggitacckwd-doodling
authored andcommitted
pm: allow reset when reset type is set
If ISH is busy and not read reset_prep_avail in time, ap could starts its boot flow and clear the bit. To make sure ISH won't miss reboot request, check the reset type also. Signed-off-by: Li Feng <li1.feng@intel.com>
1 parent 37374e4 commit c467506

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

bsp_sedi/soc/intel_ish/pm/aon/aon_task.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#define AON_IDT_ENTRY_VEC_FIRST SEDI_VEC_RESET_PREP
1717
#define AON_IDT_ENTRY_VEC_LAST SEDI_VEC_PMU2IOAPIC
1818

19+
#define PMU_RST_AP_REBOOT 0x40
1920
static void handle_reset(enum ish_pm_state pm_state);
2021

2122
/* ISR for PMU wakeup interrupt */
@@ -654,6 +655,8 @@ static void sram_exit_sleep_mode(void)
654655

655656
static void handle_d0i2(void)
656657
{
658+
uint32_t reg_val;
659+
657660
pg_exit_save_ctx();
658661
aon_share.pg_exit = 0;
659662

@@ -700,8 +703,11 @@ static void handle_d0i2(void)
700703
continue;
701704
#endif
702705

703-
if (read32(PMU_RST_PREP) & PMU_RST_PREP_AVAIL)
706+
reg_val = read32(PMU_RST_PREP);
707+
if ((reg_val & PMU_RST_PREP_AVAIL) ||
708+
((reg_val & PMU_RST_PREP_RESET_TYPE) == PMU_RST_AP_REBOOT)) {
704709
handle_reset(ISH_PM_STATE_RESET_PREP);
710+
}
705711

706712
if (aon_share.pg_exit)
707713
ish_dma_set_msb(PAGING_CHAN, aon_share.uma_msb,
@@ -711,6 +717,7 @@ static void handle_d0i2(void)
711717
static void handle_d0i3(void)
712718
{
713719
int ret;
720+
uint32_t reg_val;
714721

715722
pg_exit_save_ctx();
716723
aon_share.pg_exit = 0;
@@ -744,8 +751,11 @@ static void handle_d0i3(void)
744751

745752
clear_vnnred_aoncg();
746753

747-
if (read32(PMU_RST_PREP) & PMU_RST_PREP_AVAIL)
754+
reg_val = read32(PMU_RST_PREP);
755+
if ((reg_val & PMU_RST_PREP_AVAIL) ||
756+
((reg_val & PMU_RST_PREP_RESET_TYPE) == PMU_RST_AP_REBOOT)) {
748757
handle_reset(ISH_PM_STATE_RESET_PREP);
758+
}
749759

750760
/* power on main SRAM */
751761
sram_power(1);

bsp_sedi/soc/intel_ish/pm/pm_regs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
#define PMU_RST_PREP (SEDI_PMU_BASE + 0x5c)
6464
#define PMU_RST_PREP_GET BIT(0)
6565
#define PMU_RST_PREP_AVAIL BIT(1)
66+
#define PMU_RST_PREP_RESET_TYPE 0x3FC
6667
#define PMU_RST_PREP_INT_MASK BIT(31)
6768

6869
#define VNN_ID_DMA0 4

0 commit comments

Comments
 (0)