• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 /* TODO: Update for Phoenix */
4 
5 #include <acpi/acpigen_pci.h>
6 #include <amdblocks/acpi.h>
7 #include <amdblocks/data_fabric.h>
8 #include <amdblocks/fsp.h>
9 #include <amdblocks/root_complex.h>
10 #include <console/console.h>
11 #include <device/device.h>
12 #include <device/pci.h>
13 #include <soc/cpu.h>
14 #include <soc/pci_devs.h>
15 #include <soc/southbridge.h>
16 #include <types.h>
17 #include <vendorcode/amd/opensil/stub/opensil.h>
18 #include "chip.h"
19 
soc_acpi_name(const struct device * dev)20 static const char *soc_acpi_name(const struct device *dev)
21 {
22 	if (dev->path.type == DEVICE_PATH_DOMAIN)
23 		return "PCI0";
24 
25 	if (dev->path.type != DEVICE_PATH_PCI)
26 		return NULL;
27 
28 	printk(BIOS_WARNING, "Unknown PCI device: dev: %d, fn: %d\n",
29 	       PCI_SLOT(dev->path.pci.devfn), PCI_FUNC(dev->path.pci.devfn));
30 	return NULL;
31 };
32 
33 struct device_operations phoenix_pci_domain_ops = {
34 	.read_resources	= amd_pci_domain_read_resources,
35 	.set_resources	= pci_domain_set_resources,
36 	.scan_bus	= amd_pci_domain_scan_bus,
37 	.init		= amd_pci_domain_init,
38 	.acpi_name	= soc_acpi_name,
39 	.acpi_fill_ssdt	= pci_domain_fill_ssdt,
40 };
41 
soc_init(void * chip_info)42 static void soc_init(void *chip_info)
43 {
44 	default_dev_ops_root.write_acpi_tables = soc_acpi_write_tables;
45 
46 	if (CONFIG(PLATFORM_USES_FSP2_0)) {
47 		amd_fsp_silicon_init();
48 	} else {
49 		setup_opensil();
50 		opensil_xSIM_timepoint_1();
51 	}
52 
53 	data_fabric_print_mmio_conf();
54 
55 	fch_init(chip_info);
56 }
57 
soc_final(void * chip_info)58 static void soc_final(void *chip_info)
59 {
60 	fch_final(chip_info);
61 }
62 
63 struct chip_operations soc_amd_phoenix_ops = {
64 	.name = "AMD Phoenix SoC",
65 	.init = soc_init,
66 	.final = soc_final
67 };
68