drivers/wifi: Remove unnecessary data structure copy
[coreboot2.git] / src / soc / mediatek / mt8196 / soc.c
blobeb72fca3657727ab3c1d68abfa6e3a9500eb7b3a
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/device.h>
4 #include <device/pci.h>
5 #include <soc/emi.h>
6 #include <soc/mmu_operations.h>
7 #include <soc/pcie.h>
8 #include <symbols.h>
10 static void soc_read_resources(struct device *dev)
12 ram_range(dev, 0, (uintptr_t)_dram, sdram_size());
15 static void soc_init(struct device *dev)
17 mtk_mmu_disable_l2c_sram();
20 static struct device_operations soc_ops = {
21 .read_resources = soc_read_resources,
22 .set_resources = noop_set_resources,
23 .init = soc_init,
26 static struct device_operations pci_domain_ops = {
27 .read_resources = &mtk_pcie_domain_read_resources,
28 .set_resources = &mtk_pcie_domain_set_resources,
29 .scan_bus = &pci_host_bridge_scan_bus,
30 .enable = &mtk_pcie_domain_enable,
33 static void enable_soc_dev(struct device *dev)
35 if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
36 dev->ops = &soc_ops;
37 } else if (dev->path.type == DEVICE_PATH_DOMAIN) {
38 if (mainboard_needs_pcie_init())
39 dev->ops = &pci_domain_ops;
40 else
41 printk(BIOS_DEBUG, "Skip setting PCIe ops\n");
45 struct chip_operations soc_mediatek_mt8196_ops = {
46 .name = "SOC Mediatek MT8196",
47 .enable_dev = enable_soc_dev,