diff options
Diffstat (limited to 'src/soc/mediatek/mt8196/soc.c')
-rw-r--r-- | src/soc/mediatek/mt8196/soc.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/soc/mediatek/mt8196/soc.c b/src/soc/mediatek/mt8196/soc.c index b62c055426..eb72fca365 100644 --- a/src/soc/mediatek/mt8196/soc.c +++ b/src/soc/mediatek/mt8196/soc.c @@ -1,8 +1,10 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include <device/device.h> +#include <device/pci.h> #include <soc/emi.h> #include <soc/mmu_operations.h> +#include <soc/pcie.h> #include <symbols.h> static void soc_read_resources(struct device *dev) @@ -21,9 +23,23 @@ static struct device_operations soc_ops = { .init = soc_init, }; +static struct device_operations pci_domain_ops = { + .read_resources = &mtk_pcie_domain_read_resources, + .set_resources = &mtk_pcie_domain_set_resources, + .scan_bus = &pci_host_bridge_scan_bus, + .enable = &mtk_pcie_domain_enable, +}; + static void enable_soc_dev(struct device *dev) { - dev->ops = &soc_ops; + 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()) + dev->ops = &pci_domain_ops; + else + printk(BIOS_DEBUG, "Skip setting PCIe ops\n"); + } } struct chip_operations soc_mediatek_mt8196_ops = { |