blob: b3cbc74ad26643b158e736d1769d9ec2feadb6ef [file] [log] [blame]
Felix Held3c44c622022-01-10 20:57:29 +01001/* SPDX-License-Identifier: GPL-2.0-only */
2
Fred Reitberger31e62982022-10-31 14:18:20 -04003#include <amdblocks/data_fabric.h>
Felix Held3c44c622022-01-10 20:57:29 +01004#include <console/console.h>
5#include <device/device.h>
6#include <device/pci.h>
7#include <fsp/api.h>
8#include <soc/acpi.h>
Felix Held3c44c622022-01-10 20:57:29 +01009#include <soc/cpu.h>
Felix Held3c44c622022-01-10 20:57:29 +010010#include <soc/pci_devs.h>
11#include <soc/southbridge.h>
12#include <types.h>
13#include "chip.h"
14
Felix Held3c44c622022-01-10 20:57:29 +010015static const char *soc_acpi_name(const struct device *dev)
16{
17 if (dev->path.type == DEVICE_PATH_DOMAIN)
18 return "PCI0";
19
20 if (dev->path.type != DEVICE_PATH_PCI)
21 return NULL;
22
23 printk(BIOS_WARNING, "Unknown PCI device: dev: %d, fn: %d\n",
24 PCI_SLOT(dev->path.pci.devfn), PCI_FUNC(dev->path.pci.devfn));
25 return NULL;
26};
27
Arthur Heymans7f380772022-09-20 14:03:28 +020028struct device_operations mendocino_pci_domain_ops = {
Felix Helda4f4b0a2023-05-31 16:21:35 +020029 .read_resources = amd_pci_domain_read_resources,
Felix Held3c44c622022-01-10 20:57:29 +010030 .set_resources = pci_domain_set_resources,
Felix Helda4f4b0a2023-05-31 16:21:35 +020031 .scan_bus = amd_pci_domain_scan_bus,
Felix Held3c44c622022-01-10 20:57:29 +010032 .acpi_name = soc_acpi_name,
Felix Helda4f4b0a2023-05-31 16:21:35 +020033 .acpi_fill_ssdt = amd_pci_domain_fill_ssdt,
Felix Held3c44c622022-01-10 20:57:29 +010034};
35
Felix Held3c44c622022-01-10 20:57:29 +010036static void soc_init(void *chip_info)
37{
38 default_dev_ops_root.write_acpi_tables = agesa_write_acpi_tables;
39
40 fsp_silicon_init();
41
42 data_fabric_set_mmio_np();
43
44 fch_init(chip_info);
45}
46
47static void soc_final(void *chip_info)
48{
49 fch_final(chip_info);
50}
51
Jon Murphy4f732422022-08-05 15:43:44 -060052struct chip_operations soc_amd_mendocino_ops = {
53 CHIP_NAME("AMD Mendocino SoC")
Felix Held3c44c622022-01-10 20:57:29 +010054 .init = soc_init,
55 .final = soc_final
56};