2020-04-05 15:46:41 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2013-09-07 07:41:48 +02:00
|
|
|
|
|
|
|
#include <device/device.h>
|
|
|
|
#include <device/pci.h>
|
|
|
|
#include <arch/pci_ops.h>
|
|
|
|
|
2014-10-08 01:42:17 +02:00
|
|
|
#include <soc/pci_devs.h>
|
|
|
|
#include <soc/ramstage.h>
|
2013-09-07 07:41:48 +02:00
|
|
|
#include "chip.h"
|
|
|
|
|
|
|
|
static struct device_operations pci_domain_ops = {
|
|
|
|
.read_resources = pci_domain_read_resources,
|
|
|
|
.set_resources = pci_domain_set_resources,
|
|
|
|
.scan_bus = pci_domain_scan_bus,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct device_operations cpu_bus_ops = {
|
2020-04-05 14:05:24 +02:00
|
|
|
.read_resources = noop_read_resources,
|
|
|
|
.set_resources = noop_set_resources,
|
2013-10-21 19:36:17 +02:00
|
|
|
.init = baytrail_init_cpus,
|
2013-09-07 07:41:48 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-05-22 10:42:28 +02:00
|
|
|
static void enable_dev(struct device *dev)
|
2013-09-07 07:41:48 +02:00
|
|
|
{
|
|
|
|
/* Set the operations if it is a special bus type */
|
|
|
|
if (dev->path.type == DEVICE_PATH_DOMAIN) {
|
|
|
|
dev->ops = &pci_domain_ops;
|
|
|
|
} else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
|
|
|
|
dev->ops = &cpu_bus_ops;
|
2013-10-29 22:37:10 +01:00
|
|
|
} else if (dev->path.type == DEVICE_PATH_PCI) {
|
|
|
|
/* Handle south cluster enablement. */
|
|
|
|
if (PCI_SLOT(dev->path.pci.devfn) > GFX_DEV &&
|
|
|
|
(dev->ops == NULL || dev->ops->enable == NULL)) {
|
|
|
|
southcluster_enable_dev(dev);
|
|
|
|
}
|
2013-09-07 07:41:48 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-24 23:47:49 +02:00
|
|
|
/* Called at BS_DEV_INIT_CHIPS time -- very early. Just after BS_PRE_DEVICE. */
|
|
|
|
static void soc_init(void *chip_info)
|
|
|
|
{
|
2014-02-22 21:26:55 +01:00
|
|
|
baytrail_init_pre_device(chip_info);
|
2013-09-24 23:47:49 +02:00
|
|
|
}
|
|
|
|
|
2013-09-07 07:41:48 +02:00
|
|
|
struct chip_operations soc_intel_baytrail_ops = {
|
|
|
|
CHIP_NAME("Intel BayTrail SoC")
|
|
|
|
.enable_dev = enable_dev,
|
2013-09-24 23:47:49 +02:00
|
|
|
.init = soc_init,
|
2013-09-07 07:41:48 +02:00
|
|
|
};
|
2013-09-24 19:29:57 +02:00
|
|
|
|
|
|
|
struct pci_operations soc_pci_ops = {
|
2019-03-20 09:59:47 +01:00
|
|
|
.set_subsystem = &pci_dev_set_subsystem,
|
2013-09-24 19:29:57 +02:00
|
|
|
};
|