Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
Martin Roth | 20646cd | 2023-01-04 21:27:06 -0700 | [diff] [blame] | 3 | /* TODO: Update for Phoenix */ |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 4 | |
Fred Reitberger | 31e6298 | 2022-10-31 14:18:20 -0400 | [diff] [blame] | 5 | #include <amdblocks/data_fabric.h> |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 6 | #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 Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 11 | #include <soc/cpu.h> |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 12 | #include <soc/pci_devs.h> |
| 13 | #include <soc/southbridge.h> |
| 14 | #include <types.h> |
| 15 | #include "chip.h" |
| 16 | |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 17 | static 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 Roth | 20646cd | 2023-01-04 21:27:06 -0700 | [diff] [blame] | 30 | struct device_operations phoenix_pci_domain_ops = { |
Felix Held | 268dadb | 2023-05-31 16:23:38 +0200 | [diff] [blame] | 31 | .read_resources = amd_pci_domain_read_resources, |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 32 | .set_resources = pci_domain_set_resources, |
Felix Held | 268dadb | 2023-05-31 16:23:38 +0200 | [diff] [blame] | 33 | .scan_bus = amd_pci_domain_scan_bus, |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 34 | .acpi_name = soc_acpi_name, |
Felix Held | 268dadb | 2023-05-31 16:23:38 +0200 | [diff] [blame] | 35 | .acpi_fill_ssdt = amd_pci_domain_fill_ssdt, |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 36 | }; |
| 37 | |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 38 | static void soc_init(void *chip_info) |
| 39 | { |
| 40 | default_dev_ops_root.write_acpi_tables = agesa_write_acpi_tables; |
| 41 | |
| 42 | fsp_silicon_init(); |
| 43 | |
| 44 | data_fabric_set_mmio_np(); |
| 45 | |
| 46 | fch_init(chip_info); |
| 47 | } |
| 48 | |
| 49 | static void soc_final(void *chip_info) |
| 50 | { |
| 51 | fch_final(chip_info); |
| 52 | } |
| 53 | |
Martin Roth | 20646cd | 2023-01-04 21:27:06 -0700 | [diff] [blame] | 54 | struct chip_operations soc_amd_phoenix_ops = { |
| 55 | CHIP_NAME("AMD Phoenix SoC") |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 56 | .init = soc_init, |
| 57 | .final = soc_final |
| 58 | }; |