Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
Felix Held | d9e8263 | 2024-01-26 14:22:31 +0100 | [diff] [blame] | 3 | #include <amdblocks/acpi.h> |
Fred Reitberger | 31e6298 | 2022-10-31 14:18:20 -0400 | [diff] [blame] | 4 | #include <amdblocks/data_fabric.h> |
Felix Held | 4e818c5 | 2024-01-18 21:43:30 +0100 | [diff] [blame] | 5 | #include <amdblocks/fsp.h> |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 6 | #include <console/console.h> |
| 7 | #include <device/device.h> |
| 8 | #include <device/pci.h> |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 9 | #include <soc/cpu.h> |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 10 | #include <soc/pci_devs.h> |
| 11 | #include <soc/southbridge.h> |
| 12 | #include <types.h> |
| 13 | #include "chip.h" |
| 14 | |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 15 | static 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 Heymans | 7f38077 | 2022-09-20 14:03:28 +0200 | [diff] [blame] | 28 | struct device_operations mendocino_pci_domain_ops = { |
Felix Held | a4f4b0a | 2023-05-31 16:21:35 +0200 | [diff] [blame] | 29 | .read_resources = amd_pci_domain_read_resources, |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 30 | .set_resources = pci_domain_set_resources, |
Felix Held | a4f4b0a | 2023-05-31 16:21:35 +0200 | [diff] [blame] | 31 | .scan_bus = amd_pci_domain_scan_bus, |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 32 | .acpi_name = soc_acpi_name, |
Felix Held | a4f4b0a | 2023-05-31 16:21:35 +0200 | [diff] [blame] | 33 | .acpi_fill_ssdt = amd_pci_domain_fill_ssdt, |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 34 | }; |
| 35 | |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 36 | static void soc_init(void *chip_info) |
| 37 | { |
Felix Held | 1b410d9 | 2024-01-26 14:05:58 +0100 | [diff] [blame] | 38 | default_dev_ops_root.write_acpi_tables = soc_acpi_write_tables; |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 39 | |
Felix Held | 4e818c5 | 2024-01-18 21:43:30 +0100 | [diff] [blame] | 40 | amd_fsp_silicon_init(); |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 41 | |
| 42 | data_fabric_set_mmio_np(); |
| 43 | |
| 44 | fch_init(chip_info); |
| 45 | } |
| 46 | |
| 47 | static void soc_final(void *chip_info) |
| 48 | { |
| 49 | fch_final(chip_info); |
| 50 | } |
| 51 | |
Jon Murphy | 4f73242 | 2022-08-05 15:43:44 -0600 | [diff] [blame] | 52 | struct chip_operations soc_amd_mendocino_ops = { |
Nicholas Sudsgaard | bfb11be | 2024-01-30 09:53:46 +0900 | [diff] [blame] | 53 | .name = "AMD Mendocino SoC", |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 54 | .init = soc_init, |
| 55 | .final = soc_final |
| 56 | }; |