From 99c138ec5007ae5ca4775a103b63ceac490cca79 Mon Sep 17 00:00:00 2001 From: Ingo Reitz <9l@9lo.re> Date: Tue, 10 Jun 2025 05:31:07 +0200 Subject: [PATCH] soc/mediatek: Don't attempt de-assert PERST# without pci_root_bus Since CB:84118 / 3d5ff65b27 (mb/google/cherry: Complete PCIe reset in romstage) google-cherry mainboards do an early PERST# de-assert in romstage. Since cherry does not have a pci_domain, `pci_root_bus()` will return null, causing an assertion failure later in `find_dev_path()`. Return if `pci_root_bus()` is NULL. TEST=Successful boot on google/tomato Change-Id: Icc35a53e38eef0088371592d8216ac74f9542166 Signed-off-by: Ingo Reitz <9l@9lo.re> Reviewed-on: https://review.coreboot.org/c/coreboot/+/88035 Tested-by: build bot (Jenkins) Reviewed-by: Yidi Lin Reviewed-by: Yu-Ping Wu Reviewed-by: Paul Menzel --- src/soc/mediatek/common/pcie.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/soc/mediatek/common/pcie.c b/src/soc/mediatek/common/pcie.c index 9269fbd7d3..339b3d7411 100644 --- a/src/soc/mediatek/common/pcie.c +++ b/src/soc/mediatek/common/pcie.c @@ -333,6 +333,9 @@ static void wait_perst_done(uintptr_t base) void mtk_pcie_deassert_perst(void) { + if (!pci_root_bus()) + return; + uintptr_t base = mtk_pcie_get_controller_base(0); wait_perst_done(base);