blob: ee2c7cc913f1e2902580d2717658789448fb2010 [file] [log] [blame]
Martin Roth1a3de8e2022-10-06 15:57:21 -06001/* SPDX-License-Identifier: GPL-2.0-only */
2
Martin Roth20646cd2023-01-04 21:27:06 -07003/* TODO: Update for Phoenix */
Martin Roth1a3de8e2022-10-06 15:57:21 -06004
Fred Reitberger31e62982022-10-31 14:18:20 -04005#include <amdblocks/data_fabric.h>
Martin Roth1a3de8e2022-10-06 15:57:21 -06006#include <console/console.h>
7#include <device/device.h>
8#include <device/pci.h>
9#include <fsp/api.h>
10#include <soc/acpi.h>
Martin Roth1a3de8e2022-10-06 15:57:21 -060011#include <soc/cpu.h>
Martin Roth1a3de8e2022-10-06 15:57:21 -060012#include <soc/pci_devs.h>
13#include <soc/southbridge.h>
14#include <types.h>
15#include "chip.h"
16
Martin Roth1a3de8e2022-10-06 15:57:21 -060017static const char *soc_acpi_name(const struct device *dev)
18{
19 if (dev->path.type == DEVICE_PATH_DOMAIN)
20 return "PCI0";
21
22 if (dev->path.type != DEVICE_PATH_PCI)
23 return NULL;
24
25 printk(BIOS_WARNING, "Unknown PCI device: dev: %d, fn: %d\n",
26 PCI_SLOT(dev->path.pci.devfn), PCI_FUNC(dev->path.pci.devfn));
27 return NULL;
28};
29
Martin Roth20646cd2023-01-04 21:27:06 -070030struct device_operations phoenix_pci_domain_ops = {
Martin Roth1a3de8e2022-10-06 15:57:21 -060031 .read_resources = pci_domain_read_resources,
32 .set_resources = pci_domain_set_resources,
33 .scan_bus = pci_domain_scan_bus,
34 .acpi_name = soc_acpi_name,
35};
36
Martin Roth1a3de8e2022-10-06 15:57:21 -060037static void soc_init(void *chip_info)
38{
39 default_dev_ops_root.write_acpi_tables = agesa_write_acpi_tables;
40
41 fsp_silicon_init();
42
43 data_fabric_set_mmio_np();
44
45 fch_init(chip_info);
46}
47
48static void soc_final(void *chip_info)
49{
50 fch_final(chip_info);
51}
52
Martin Roth20646cd2023-01-04 21:27:06 -070053struct chip_operations soc_amd_phoenix_ops = {
54 CHIP_NAME("AMD Phoenix SoC")
Martin Roth1a3de8e2022-10-06 15:57:21 -060055 .init = soc_init,
56 .final = soc_final
57};