Kane Chen has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/60401 )
Change subject: soc/intel/alderlake: Check clkreq overlap ......................................................................
soc/intel/alderlake: Check clkreq overlap
In some cases, partner may assign same clkreq on more than one devices. This could happen when one device is in baseboard dev tree and another one is in override dev tree.
This change add a clkreq overlap check and pop up a warning message
TEST=On brya, assigned one clkreq to 2 devices and found the warning message
Change-Id: I2f701a19118f4702c227b17e43b6551591d9b344 Signed-off-by: Kane Chen kane.chen@intel.corp-partner.google.com --- M src/soc/intel/alderlake/romstage/fsp_params.c 1 file changed, 8 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/60401/1
diff --git a/src/soc/intel/alderlake/romstage/fsp_params.c b/src/soc/intel/alderlake/romstage/fsp_params.c index 8959bf7..f29d7a7 100644 --- a/src/soc/intel/alderlake/romstage/fsp_params.c +++ b/src/soc/intel/alderlake/romstage/fsp_params.c @@ -33,6 +33,8 @@ VTD_TBT3, };
+u32 clk_req_mapping = 0; + static uint8_t clk_src_to_fsp(enum pcie_rp_type type, int rp_number) { assert(type == PCIE_RP_PCH || type == PCIE_RP_CPU); @@ -53,8 +55,13 @@ continue; if (cfg[i].flags & PCIE_RP_CLK_SRC_UNUSED) continue; - if (!(cfg[i].flags & PCIE_RP_CLK_REQ_UNUSED)) + if (clk_req_mapping & (1 << cfg[i].clk_req)) + printk(BIOS_WARNING, "Found overlapped clkreq assignment on clk req %d\n" + , cfg[i].clk_req); + if (!(cfg[i].flags & PCIE_RP_CLK_REQ_UNUSED)) { m_cfg->PcieClkSrcClkReq[cfg[i].clk_src] = cfg[i].clk_req; + clk_req_mapping |= 1 << cfg[i].clk_req; + } m_cfg->PcieClkSrcUsage[cfg[i].clk_src] = clk_src_to_fsp(type, i); } }