From 0750412241b256d653d555cdda3e51ddb49a884c Mon Sep 17 00:00:00 2001 From: Yu-Ping Wu Date: Wed, 21 Jan 2026 17:25:06 +0800 Subject: [PATCH] soc/mediatek/mt8196: Fix missing read_resources for non-NVMe SKUs The following error will be shown on non-NVMe SKUs. [ERROR] DOMAIN: 00000000 missing read_resources That's because when mainboard_needs_pcie_init() returns false, dev->ops will be NULL, causing the '!curdev->ops || !curdev->ops->read_resources' check to fail in device/device.c read_resources(). To prevent the misleading error message from showing up, for non-NVMe SKUs, assign 'noop_domain_ops' to dev->ops. BUG=none TEST=emerge-tanjiro coreboot BRANCH=rauru Change-Id: If0f81aadda3fbde99f4df794cbdd885a607c9625 Signed-off-by: Yu-Ping Wu Reviewed-on: https://review.coreboot.org/c/coreboot/+/90843 Reviewed-by: Yidi Lin Reviewed-by: Chen-Tsung Hsieh Tested-by: build bot (Jenkins) --- src/soc/mediatek/mt8196/soc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/soc/mediatek/mt8196/soc.c b/src/soc/mediatek/mt8196/soc.c index e988a76926..c739998383 100644 --- a/src/soc/mediatek/mt8196/soc.c +++ b/src/soc/mediatek/mt8196/soc.c @@ -104,15 +104,22 @@ static struct device_operations pci_domain_ops = { .enable = &mtk_pcie_domain_enable, }; +static struct device_operations noop_domain_ops = { + .read_resources = &noop_read_resources, + .set_resources = &noop_set_resources, +}; + static void enable_soc_dev(struct device *dev) { if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { dev->ops = &soc_ops; } else if (dev->path.type == DEVICE_PATH_DOMAIN) { - if (mainboard_needs_pcie_init()) + if (mainboard_needs_pcie_init()) { dev->ops = &pci_domain_ops; - else + } else { printk(BIOS_DEBUG, "Skip setting PCIe ops\n"); + dev->ops = &noop_domain_ops; + } } }