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 <yupingso@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/90843 Reviewed-by: Yidi Lin <yidilin@google.com> Reviewed-by: Chen-Tsung Hsieh <chentsung@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
e8e3fc9cf7
commit
0750412241
1 changed files with 9 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue