Felix Held | dc2d356 | 2020-12-02 14:38:53 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
Felix Held | 51c4d68 | 2021-02-16 23:14:42 +0100 | [diff] [blame] | 3 | #include <console/console.h> |
Felix Held | dc2d356 | 2020-12-02 14:38:53 +0100 | [diff] [blame] | 4 | #include <device/device.h> |
Felix Held | 51c4d68 | 2021-02-16 23:14:42 +0100 | [diff] [blame] | 5 | #include <device/pci.h> |
Felix Held | 86c24a2 | 2021-01-28 23:07:48 +0100 | [diff] [blame] | 6 | #include <fsp/api.h> |
Felix Held | 144c7aa | 2021-05-04 21:06:04 +0200 | [diff] [blame] | 7 | #include <soc/acpi.h> |
Jason Glenesk | 79542fa | 2021-03-10 03:50:57 -0800 | [diff] [blame] | 8 | #include <soc/cpu.h> |
Felix Held | ea32c52 | 2021-02-13 01:42:44 +0100 | [diff] [blame] | 9 | #include <soc/data_fabric.h> |
Felix Held | 51c4d68 | 2021-02-16 23:14:42 +0100 | [diff] [blame] | 10 | #include <soc/pci_devs.h> |
Felix Held | 230dbd6 | 2021-01-28 23:40:52 +0100 | [diff] [blame] | 11 | #include <soc/southbridge.h> |
Felix Held | 86c24a2 | 2021-01-28 23:07:48 +0100 | [diff] [blame] | 12 | #include <types.h> |
Felix Held | c827278 | 2020-12-05 01:39:28 +0100 | [diff] [blame] | 13 | #include "chip.h" |
Felix Held | dc2d356 | 2020-12-02 14:38:53 +0100 | [diff] [blame] | 14 | |
Arthur Heymans | 7f38077 | 2022-09-20 14:03:28 +0200 | [diff] [blame^] | 15 | struct device_operations cezanne_cpu_bus_ops = { |
Felix Held | b2d8a5c | 2021-02-10 16:17:13 +0100 | [diff] [blame] | 16 | .read_resources = noop_read_resources, |
| 17 | .set_resources = noop_set_resources, |
| 18 | .init = mp_cpu_bus_init, |
Jason Glenesk | 79542fa | 2021-03-10 03:50:57 -0800 | [diff] [blame] | 19 | .acpi_fill_ssdt = generate_cpu_entries, |
Felix Held | fd05601 | 2021-02-09 16:55:47 +0100 | [diff] [blame] | 20 | }; |
| 21 | |
Felix Held | 51c4d68 | 2021-02-16 23:14:42 +0100 | [diff] [blame] | 22 | static const char *soc_acpi_name(const struct device *dev) |
| 23 | { |
| 24 | if (dev->path.type == DEVICE_PATH_DOMAIN) |
| 25 | return "PCI0"; |
| 26 | |
| 27 | if (dev->path.type != DEVICE_PATH_PCI) |
| 28 | return NULL; |
| 29 | |
| 30 | printk(BIOS_WARNING, "Unknown PCI device: dev: %d, fn: %d\n", |
| 31 | PCI_SLOT(dev->path.pci.devfn), PCI_FUNC(dev->path.pci.devfn)); |
| 32 | return NULL; |
| 33 | }; |
| 34 | |
Arthur Heymans | 7f38077 | 2022-09-20 14:03:28 +0200 | [diff] [blame^] | 35 | struct device_operations cezanne_pci_domain_ops = { |
Felix Held | 5a7e4a5 | 2021-02-05 21:46:53 +0100 | [diff] [blame] | 36 | .read_resources = pci_domain_read_resources, |
| 37 | .set_resources = pci_domain_set_resources, |
| 38 | .scan_bus = pci_domain_scan_bus, |
Felix Held | 51c4d68 | 2021-02-16 23:14:42 +0100 | [diff] [blame] | 39 | .acpi_name = soc_acpi_name, |
Felix Held | 5a7e4a5 | 2021-02-05 21:46:53 +0100 | [diff] [blame] | 40 | }; |
| 41 | |
Felix Held | 613f9fc | 2021-01-26 18:09:46 +0100 | [diff] [blame] | 42 | static void soc_init(void *chip_info) |
| 43 | { |
Felix Held | 144c7aa | 2021-05-04 21:06:04 +0200 | [diff] [blame] | 44 | default_dev_ops_root.write_acpi_tables = agesa_write_acpi_tables; |
| 45 | |
Kyösti Mälkki | cc93c6e | 2021-01-09 22:53:52 +0200 | [diff] [blame] | 46 | fsp_silicon_init(); |
Felix Held | 230dbd6 | 2021-01-28 23:40:52 +0100 | [diff] [blame] | 47 | |
Felix Held | ea32c52 | 2021-02-13 01:42:44 +0100 | [diff] [blame] | 48 | data_fabric_set_mmio_np(); |
| 49 | |
Felix Held | 230dbd6 | 2021-01-28 23:40:52 +0100 | [diff] [blame] | 50 | fch_init(chip_info); |
Felix Held | 613f9fc | 2021-01-26 18:09:46 +0100 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | static void soc_final(void *chip_info) |
| 54 | { |
Felix Held | 230dbd6 | 2021-01-28 23:40:52 +0100 | [diff] [blame] | 55 | fch_final(chip_info); |
Felix Held | 613f9fc | 2021-01-26 18:09:46 +0100 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | struct chip_operations soc_amd_cezanne_ops = { |
| 59 | CHIP_NAME("AMD Cezanne SoC") |
Felix Held | 613f9fc | 2021-01-26 18:09:46 +0100 | [diff] [blame] | 60 | .init = soc_init, |
| 61 | .final = soc_final |
| 62 | }; |