blob: 72652bac60aabb98a819edbd0675c6d2a76d926b [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
Felix Heldd9e82632024-01-26 14:22:31 +01005#include <amdblocks/acpi.h>
Fred Reitberger31e62982022-10-31 14:18:20 -04006#include <amdblocks/data_fabric.h>
Felix Held4e818c52024-01-18 21:43:30 +01007#include <amdblocks/fsp.h>
Martin Roth1a3de8e2022-10-06 15:57:21 -06008#include <console/console.h>
9#include <device/device.h>
10#include <device/pci.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 = {
Felix Held268dadb2023-05-31 16:23:38 +020031 .read_resources = amd_pci_domain_read_resources,
Martin Roth1a3de8e2022-10-06 15:57:21 -060032 .set_resources = pci_domain_set_resources,
Felix Held268dadb2023-05-31 16:23:38 +020033 .scan_bus = amd_pci_domain_scan_bus,
Martin Roth1a3de8e2022-10-06 15:57:21 -060034 .acpi_name = soc_acpi_name,
Felix Held268dadb2023-05-31 16:23:38 +020035 .acpi_fill_ssdt = amd_pci_domain_fill_ssdt,
Martin Roth1a3de8e2022-10-06 15:57:21 -060036};
37
Martin Roth1a3de8e2022-10-06 15:57:21 -060038static void soc_init(void *chip_info)
39{
Felix Held1b410d92024-01-26 14:05:58 +010040 default_dev_ops_root.write_acpi_tables = soc_acpi_write_tables;
Martin Roth1a3de8e2022-10-06 15:57:21 -060041
Felix Held4e818c52024-01-18 21:43:30 +010042 amd_fsp_silicon_init();
Martin Roth1a3de8e2022-10-06 15:57:21 -060043
44 data_fabric_set_mmio_np();
45
46 fch_init(chip_info);
47}
48
49static void soc_final(void *chip_info)
50{
51 fch_final(chip_info);
52}
53
Martin Roth20646cd2023-01-04 21:27:06 -070054struct chip_operations soc_amd_phoenix_ops = {
Nicholas Sudsgaardbfb11be2024-01-30 09:53:46 +090055 .name = "AMD Phoenix SoC",
Martin Roth1a3de8e2022-10-06 15:57:21 -060056 .init = soc_init,
57 .final = soc_final
58};