Angel Pons | ae59387 | 2020-04-04 18:50:57 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 2 | |
Fred Reitberger | 31e6298 | 2022-10-31 14:18:20 -0400 | [diff] [blame] | 3 | #include <amdblocks/data_fabric.h> |
Furquan Shaikh | 5df9a04 | 2020-04-15 22:52:35 -0700 | [diff] [blame] | 4 | #include <console/console.h> |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 5 | #include <device/device.h> |
| 6 | #include <device/pci.h> |
| 7 | #include <drivers/i2c/designware/dw_i2c.h> |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 8 | #include <soc/acpi.h> |
| 9 | #include <soc/cpu.h> |
Furquan Shaikh | 4663749 | 2020-06-03 16:22:20 -0700 | [diff] [blame] | 10 | #include <soc/iomap.h> |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 11 | #include <soc/pci_devs.h> |
| 12 | #include <soc/southbridge.h> |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 13 | #include "chip.h" |
Marshall Dawson | 00a2208 | 2020-01-20 23:05:31 -0700 | [diff] [blame] | 14 | #include <fsp/api.h> |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 15 | |
Felix Held | 61e60d1 | 2021-02-16 23:23:00 +0100 | [diff] [blame] | 16 | static const char *soc_acpi_name(const struct device *dev) |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 17 | { |
| 18 | if (dev->path.type == DEVICE_PATH_DOMAIN) |
| 19 | return "PCI0"; |
| 20 | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 21 | if (dev->path.type != DEVICE_PATH_PCI) |
| 22 | return NULL; |
| 23 | |
Furquan Shaikh | 5df9a04 | 2020-04-15 22:52:35 -0700 | [diff] [blame] | 24 | printk(BIOS_WARNING, "Unknown PCI device: dev: %d, fn: %d\n", |
| 25 | PCI_SLOT(dev->path.pci.devfn), PCI_FUNC(dev->path.pci.devfn)); |
| 26 | return NULL; |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 27 | }; |
| 28 | |
Arthur Heymans | 7f38077 | 2022-09-20 14:03:28 +0200 | [diff] [blame] | 29 | struct device_operations picasso_pci_domain_ops = { |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 30 | .read_resources = pci_domain_read_resources, |
Raul E Rangel | 5cb34e2 | 2020-05-04 16:41:22 -0600 | [diff] [blame] | 31 | .set_resources = pci_domain_set_resources, |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 32 | .scan_bus = pci_domain_scan_bus, |
| 33 | .acpi_name = soc_acpi_name, |
| 34 | }; |
| 35 | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 36 | static void soc_init(void *chip_info) |
| 37 | { |
Matt Papageorge | a21eae0 | 2019-11-13 17:00:12 -0600 | [diff] [blame] | 38 | default_dev_ops_root.write_acpi_tables = agesa_write_acpi_tables; |
| 39 | |
Kyösti Mälkki | cc93c6e | 2021-01-09 22:53:52 +0200 | [diff] [blame] | 40 | fsp_silicon_init(); |
Marshall Dawson | 00a2208 | 2020-01-20 23:05:31 -0700 | [diff] [blame] | 41 | |
Raul E Rangel | 789aefc | 2020-05-11 16:26:35 -0600 | [diff] [blame] | 42 | data_fabric_set_mmio_np(); |
Felix Held | faaafb4 | 2021-01-28 23:19:40 +0100 | [diff] [blame] | 43 | fch_init(chip_info); |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | static void soc_final(void *chip_info) |
| 47 | { |
Felix Held | faaafb4 | 2021-01-28 23:19:40 +0100 | [diff] [blame] | 48 | fch_final(chip_info); |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 49 | } |
| 50 | |
Marshall Dawson | bc4c903 | 2019-06-11 12:18:20 -0600 | [diff] [blame] | 51 | struct chip_operations soc_amd_picasso_ops = { |
| 52 | CHIP_NAME("AMD Picasso SOC") |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 53 | .init = soc_init, |
| 54 | .final = soc_final |
| 55 | }; |