From a3146205c382ffdd440dc9c7ea2cac9b0f577aef Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Fri, 29 Apr 2022 14:19:32 +0530 Subject: [PATCH] soc/intel/cmn/blk/pmc: API to inform PMC about PCI enumeration done MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch sends an IPC to PMC to inform about PCI enumeration. BUG=b:211954778 TEST=Able to build and boot google/redrix to OS. Signed-off-by: Subrata Banik Change-Id: I77d428f9501feaccab8bb431090d10ce8d3af9b2 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63953 Tested-by: build bot (Jenkins) Reviewed-by: Eric Lai Reviewed-by: Werner Zeh Reviewed-by: Lean Sheng Tan --- .../common/block/include/intelblocks/pmclib.h | 3 +++ src/soc/intel/common/block/pmc/pmclib.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/soc/intel/common/block/include/intelblocks/pmclib.h b/src/soc/intel/common/block/include/intelblocks/pmclib.h index fc65a089d3..62f27a9d5a 100644 --- a/src/soc/intel/common/block/include/intelblocks/pmclib.h +++ b/src/soc/intel/common/block/include/intelblocks/pmclib.h @@ -28,6 +28,9 @@ enum pch_pmc_xtal { */ enum pch_pmc_xtal pmc_get_xtal_freq(void); +/* pmc_send_pci_enum_done() - send PMC IPC to inform PCI enumeration is done. */ +void pmc_send_pci_enum_done(void); + /* Forward declare the power state struct here */ struct chipset_power_state; diff --git a/src/soc/intel/common/block/pmc/pmclib.c b/src/soc/intel/common/block/pmc/pmclib.c index a733920139..0f1da72577 100644 --- a/src/soc/intel/common/block/pmc/pmclib.c +++ b/src/soc/intel/common/block/pmc/pmclib.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -21,6 +22,9 @@ #include #include +#define PMC_IPC_BIOS_RST_COMPLETE 0xd0 +#define PMC_IPC_BIOS_RST_SUBID_PCI_ENUM_DONE 0 + static struct chipset_power_state power_state; /* List of Minimum Assertion durations in microseconds */ @@ -785,3 +789,15 @@ enum pch_pmc_xtal pmc_get_xtal_freq(void) return XTAL_UNKNOWN_FREQ; } } + +void pmc_send_pci_enum_done(void) +{ + struct pmc_ipc_buffer req = { 0 }; + struct pmc_ipc_buffer rsp; + uint32_t cmd; + + cmd = pmc_make_ipc_cmd(PMC_IPC_BIOS_RST_COMPLETE, + PMC_IPC_BIOS_RST_SUBID_PCI_ENUM_DONE, 0); + if (pmc_send_ipc_cmd(cmd, &req, &rsp) != CB_SUCCESS) + printk(BIOS_ERR, "PMC: Failed sending PCI Enumeration Done Command\n"); +}