blob: e4aa7040e610da85bb850abb641efccd4319d6a7 [file] [log] [blame]
Felix Helddc2d3562020-12-02 14:38:53 +01001/* SPDX-License-Identifier: GPL-2.0-only */
2
Felix Held51c4d682021-02-16 23:14:42 +01003#include <console/console.h>
Felix Helddc2d3562020-12-02 14:38:53 +01004#include <device/device.h>
Felix Held51c4d682021-02-16 23:14:42 +01005#include <device/pci.h>
Felix Held86c24a22021-01-28 23:07:48 +01006#include <fsp/api.h>
Felix Held144c7aa2021-05-04 21:06:04 +02007#include <soc/acpi.h>
Jason Glenesk79542fa2021-03-10 03:50:57 -08008#include <soc/cpu.h>
Felix Heldea32c522021-02-13 01:42:44 +01009#include <soc/data_fabric.h>
Felix Held51c4d682021-02-16 23:14:42 +010010#include <soc/pci_devs.h>
Felix Held230dbd62021-01-28 23:40:52 +010011#include <soc/southbridge.h>
Felix Held86c24a22021-01-28 23:07:48 +010012#include <types.h>
Felix Heldc8272782020-12-05 01:39:28 +010013#include "chip.h"
Felix Helddc2d3562020-12-02 14:38:53 +010014
Arthur Heymans7f380772022-09-20 14:03:28 +020015struct device_operations cezanne_cpu_bus_ops = {
Felix Heldb2d8a5c2021-02-10 16:17:13 +010016 .read_resources = noop_read_resources,
17 .set_resources = noop_set_resources,
18 .init = mp_cpu_bus_init,
Jason Glenesk79542fa2021-03-10 03:50:57 -080019 .acpi_fill_ssdt = generate_cpu_entries,
Felix Heldfd056012021-02-09 16:55:47 +010020};
21
Felix Held51c4d682021-02-16 23:14:42 +010022static const char *soc_acpi_name(const struct device *dev)
23{
24 if (dev->path.type == DEVICE_PATH_DOMAIN)
25 return "PCI0";
26
27 if (dev->path.type != DEVICE_PATH_PCI)
28 return NULL;
29
30 printk(BIOS_WARNING, "Unknown PCI device: dev: %d, fn: %d\n",
31 PCI_SLOT(dev->path.pci.devfn), PCI_FUNC(dev->path.pci.devfn));
32 return NULL;
33};
34
Arthur Heymans7f380772022-09-20 14:03:28 +020035struct device_operations cezanne_pci_domain_ops = {
Felix Held5a7e4a52021-02-05 21:46:53 +010036 .read_resources = pci_domain_read_resources,
37 .set_resources = pci_domain_set_resources,
38 .scan_bus = pci_domain_scan_bus,
Felix Held51c4d682021-02-16 23:14:42 +010039 .acpi_name = soc_acpi_name,
Felix Held5a7e4a52021-02-05 21:46:53 +010040};
41
Felix Held613f9fc2021-01-26 18:09:46 +010042static void soc_init(void *chip_info)
43{
Felix Held144c7aa2021-05-04 21:06:04 +020044 default_dev_ops_root.write_acpi_tables = agesa_write_acpi_tables;
45
Kyösti Mälkkicc93c6e2021-01-09 22:53:52 +020046 fsp_silicon_init();
Felix Held230dbd62021-01-28 23:40:52 +010047
Felix Heldea32c522021-02-13 01:42:44 +010048 data_fabric_set_mmio_np();
49
Felix Held230dbd62021-01-28 23:40:52 +010050 fch_init(chip_info);
Felix Held613f9fc2021-01-26 18:09:46 +010051}
52
53static void soc_final(void *chip_info)
54{
Felix Held230dbd62021-01-28 23:40:52 +010055 fch_final(chip_info);
Felix Held613f9fc2021-01-26 18:09:46 +010056}
57
58struct chip_operations soc_amd_cezanne_ops = {
59 CHIP_NAME("AMD Cezanne SoC")
Felix Held613f9fc2021-01-26 18:09:46 +010060 .init = soc_init,
61 .final = soc_final
62};