soc/mediatek/mt8196: Enable PCIe support

Enable PCIe support for mt8196.

TEST=Build pass, show pcie init pass log:
mtk_pcie_domain_enable: PCIe link up success (1)
BUG=b:317009620

Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
Change-Id: I9c0aaa1c6da8c247b319e7ed2317dd871e276461
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84698
Reviewed-by: Yidi Lin <yidilin@google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Jianjun Wang 2024-04-17 11:19:50 +08:00 committed by Yu-Ping Wu
commit 61e3815a25
2 changed files with 18 additions and 1 deletions

View file

@ -11,6 +11,7 @@ config SOC_MEDIATEK_MT8196
select SOC_MEDIATEK_COMMON
select FLASH_DUAL_IO_READ
select ARM64_USE_ARCH_TIMER
select PCI
if SOC_MEDIATEK_MT8196

View file

@ -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 = {