From 7b7250dfaec967fd16dee641e1eb7943bf54a2c3 Mon Sep 17 00:00:00 2001 From: Yu-Ping Wu Date: Tue, 19 Jul 2022 17:43:29 +0800 Subject: mb/google/cherry: Introduce mainboard_needs_pcie_init Implement mainboard_needs_pcie_init() for cherry as a callback for mt8195 SoC to determine whether to initialize PCIe. When the SKU id is unknown or unprovisioned (for example at the beginning of the factory flow), we should still initialize PCIe. Otherwise the devices with NVMe will fail to boot. BUG=b:238850212 TEST=emerge-cherry coreboot BRANCH=cherry Change-Id: I2ed0ceeb37d2924ca16485fb2d130959a7eff102 Signed-off-by: Yu-Ping Wu Reviewed-on: https://review.coreboot.org/c/coreboot/+/65992 Tested-by: build bot (Jenkins) Reviewed-by: Hung-Te Lin --- src/mainboard/google/cherry/mainboard.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/mainboard/google/cherry') diff --git a/src/mainboard/google/cherry/mainboard.c b/src/mainboard/google/cherry/mainboard.c index 3fb599b5c8..b69403eb1e 100644 --- a/src/mainboard/google/cherry/mainboard.c +++ b/src/mainboard/google/cherry/mainboard.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include #include #include #include @@ -16,6 +17,7 @@ #include #include #include +#include #include #include @@ -29,6 +31,32 @@ #define GPIO_EDP_HPD_1V8 GPIO(GPIO_07) #define GPIO_EN_PP3300_DISP_X GPIO(I2SO1_D2) +bool mainboard_needs_pcie_init(void) +{ + uint32_t sku; + + if (!CONFIG(BOARD_GOOGLE_DOJO)) + return false; + + sku = sku_id(); + switch (sku) { + case 0: + case 1: + case 4: + case 5: + return false; + case 2: + case 3: + case 6: + case 7: + return true; + default: + /* For example CROS_SKU_UNPROVISIONED */ + printk(BIOS_WARNING, "Unexpected sku %#x; assuming PCIe", sku); + return true; + } +} + static void register_reset_to_bl31(void) { static struct bl_aux_param_gpio param_reset = { -- cgit v1.2.3