Skip to content

Commit b3bd7bd

Browse files
Deshatty, Deeptiddeshat
authored andcommitted
pm: handle reset prep IRQ
In the SoC warm reboot process, sometimes there are instances where the ISH firmware fails to receive the warm reboot request from PMC, leading to the failure to reboot ISH firmware hence causing ISHTP kernel driver communication failure with ISH firmware. This issue is observred when there is an IPC request pending at the ISH and at the time a warm reboot is initiated causing IPM driver timeout. The IPM driver timeout is set to 1sec waiting for the Peer ACK. Due to warm reboot, Peer ACK is not received leading to timeout of 1sec. During this time ISH HW triggeres the RESET PREP IRQ, but we do not observe ISR routine exexuted at firmware side which is expected to handle the warm reboot. Changes done to perform ish pm init using zephyr SYS_INIT() in PRE_KERNEL_2 stage. This change helps handle the IRQ rightly and invokes the ISR routine to handle the firmware reset. Change-Id: I454bd75257cdfc1c8f37e582231f6fe7f5e8f91d
1 parent cd9c972 commit b3bd7bd

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

bsp_sedi/soc/intel_ish/pm/ish_pm.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "sedi_driver_uart.h"
1212
#include <sedi_driver_rtc.h>
1313
#include <zephyr/sys/printk.h>
14+
#include <zephyr/init.h>
1415
#include <zephyr/irq.h>
1516
#include <zephyr/drivers/interrupt_controller/ioapic.h>
1617
#include <zephyr/arch/x86/ia32/segmentation.h>
@@ -610,6 +611,16 @@ static void reset_prep_isr(void)
610611

611612
void sedi_pm_init(void)
612613
{
614+
/*TODO: remove the api */
615+
}
616+
617+
static int ish_sedi_pm_init(void)
618+
{
619+
/* register ISR */
620+
IRQ_CONNECT(SEDI_IRQ_RESET_PREP, 4, reset_prep_isr, 0, IOAPIC_LEVEL);
621+
IRQ_CONNECT(SEDI_IRQ_PMU2IOAPIC, 4, pmu_wakeup_isr, 0, IOAPIC_LEVEL);
622+
IRQ_CONNECT(SEDI_IRQ_PCIEDEV, 2, pcie_dev_isr, 0, IOAPIC_LEVEL);
623+
613624
/* clear reset bit */
614625
write32(ISH_RST_REG, 0);
615626

@@ -631,10 +642,6 @@ void sedi_pm_init(void)
631642
write32(PMU_ISH_FABRIC_CNT, (read32(PMU_ISH_FABRIC_CNT) & 0xffff0000) | FABRIC_IDLE_COUNT);
632643
write32(PMU_PGCB_CLKGATE_CTRL, TRUNK_CLKGATE_COUNT);
633644

634-
IRQ_CONNECT(SEDI_IRQ_RESET_PREP, 5, reset_prep_isr, 0, IOAPIC_LEVEL);
635-
IRQ_CONNECT(SEDI_IRQ_PMU2IOAPIC, 5, pmu_wakeup_isr, 0, IOAPIC_LEVEL);
636-
IRQ_CONNECT(SEDI_IRQ_PCIEDEV, 5, pcie_dev_isr, 0, IOAPIC_LEVEL);
637-
638645
/* unmask reset prep avail interrupt */
639646
write32(PMU_RST_PREP, 0);
640647
sedi_core_irq_enable(SEDI_IRQ_RESET_PREP);
@@ -647,7 +654,10 @@ void sedi_pm_init(void)
647654
write32(PMU_D3_STATUS, read32(PMU_D3_STATUS));
648655

649656
sedi_core_irq_enable(SEDI_IRQ_PCIEDEV);
657+
658+
return 0;
650659
}
660+
SYS_INIT(ish_sedi_pm_init, PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
651661

652662
void ish_pm_reset(enum ish_pm_state pm_state)
653663
{

0 commit comments

Comments
 (0)