Attention is currently required from: Jason Glenesk, Raul Rangel, Matt DeVillier, Fred Reitberger, Felix Held.
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/68143 )
Change subject: soc/amd/cezanne: Use devicetree ops over pci driver ......................................................................
soc/amd/cezanne: Use devicetree ops over pci driver
Picasso is a SoC so it makes sense to statically use ops instead of matching them to PCI DID/VID at runtime.
Change-Id: If535221335217cee53bca956747e7f17f0a5fd8d Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/soc/amd/cezanne/chipset.cb M src/soc/amd/cezanne/data_fabric.c M src/soc/amd/cezanne/root_complex.c 3 files changed, 24 insertions(+), 47 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/68143/1
diff --git a/src/soc/amd/cezanne/chipset.cb b/src/soc/amd/cezanne/chipset.cb index d975fcf..8271d24 100644 --- a/src/soc/amd/cezanne/chipset.cb +++ b/src/soc/amd/cezanne/chipset.cb @@ -4,7 +4,7 @@ end device domain 0 on ops cezanne_pci_domain_ops - device pci 00.0 alias gnb on end + device pci 00.0 alias gnb on ops cezanne_root_complex_operations end device pci 00.2 alias iommu off end
device pci 01.0 on end # Dummy Host Bridge, do not disable @@ -94,14 +94,14 @@ device pci 14.0 alias smbus on ops amd_smbus_ops end # primary FCH function device pci 14.3 alias lpc_bridge on end
- device pci 18.0 alias data_fabric_0 on end - device pci 18.1 alias data_fabric_1 on end - device pci 18.2 alias data_fabric_2 on end - device pci 18.3 alias data_fabric_3 on end - device pci 18.4 alias data_fabric_4 on end - device pci 18.5 alias data_fabric_5 on end - device pci 18.6 alias data_fabric_6 on end - device pci 18.7 alias data_fabric_7 on end + device pci 18.0 alias data_fabric_0 on ops cezanne_data_fabric_ops end + device pci 18.1 alias data_fabric_1 on ops cezanne_data_fabric_ops end + device pci 18.2 alias data_fabric_2 on ops cezanne_data_fabric_ops end + device pci 18.3 alias data_fabric_3 on ops cezanne_data_fabric_ops end + device pci 18.4 alias data_fabric_4 on ops cezanne_data_fabric_ops end + device pci 18.5 alias data_fabric_5 on ops cezanne_data_fabric_ops end + device pci 18.6 alias data_fabric_6 on ops cezanne_data_fabric_ops end + device pci 18.7 alias data_fabric_7 on ops cezanne_data_fabric_ops end end
device mmio 0xfedc2000 alias i2c_0 off ops soc_amd_i2c_mmio_ops end diff --git a/src/soc/amd/cezanne/data_fabric.c b/src/soc/amd/cezanne/data_fabric.c index 43894e9..336b7eb 100644 --- a/src/soc/amd/cezanne/data_fabric.c +++ b/src/soc/amd/cezanne/data_fabric.c @@ -7,7 +7,6 @@ #include <cpu/x86/lapic_def.h> #include <device/device.h> #include <device/pci.h> -#include <device/pci_ids.h> #include <soc/data_fabric.h> #include <soc/iomap.h> #include <types.h> @@ -132,37 +131,9 @@ return NULL; }
-static struct device_operations data_fabric_ops = { +struct device_operations cezanne_data_fabric_ops = { .read_resources = noop_read_resources, .set_resources = noop_set_resources, .acpi_name = data_fabric_acpi_name, .acpi_fill_ssdt = acpi_device_write_pci_dev, }; - -static const unsigned short pci_device_ids[] = { - /* Renoir DF devices */ - PCI_DID_AMD_FAM17H_MODEL60H_DF0, - PCI_DID_AMD_FAM17H_MODEL60H_DF1, - PCI_DID_AMD_FAM17H_MODEL60H_DF2, - PCI_DID_AMD_FAM17H_MODEL60H_DF3, - PCI_DID_AMD_FAM17H_MODEL60H_DF4, - PCI_DID_AMD_FAM17H_MODEL60H_DF5, - PCI_DID_AMD_FAM17H_MODEL60H_DF6, - PCI_DID_AMD_FAM17H_MODEL60H_DF7, - /* Cezanne DF devices */ - PCI_DID_AMD_FAM19H_MODEL51H_DF0, - PCI_DID_AMD_FAM19H_MODEL51H_DF1, - PCI_DID_AMD_FAM19H_MODEL51H_DF2, - PCI_DID_AMD_FAM19H_MODEL51H_DF3, - PCI_DID_AMD_FAM19H_MODEL51H_DF4, - PCI_DID_AMD_FAM19H_MODEL51H_DF5, - PCI_DID_AMD_FAM19H_MODEL51H_DF6, - PCI_DID_AMD_FAM19H_MODEL51H_DF7, - 0 -}; - -static const struct pci_driver data_fabric_driver __pci_driver = { - .ops = &data_fabric_ops, - .vendor = PCI_VID_AMD, - .devices = pci_device_ids, -}; diff --git a/src/soc/amd/cezanne/root_complex.c b/src/soc/amd/cezanne/root_complex.c index 8ea5c9f..ed919b1 100644 --- a/src/soc/amd/cezanne/root_complex.c +++ b/src/soc/amd/cezanne/root_complex.c @@ -11,7 +11,6 @@ #include <cpu/amd/msr.h> #include <device/device.h> #include <device/pci.h> -#include <device/pci_ids.h> #include <fsp/util.h> #include <soc/iomap.h> #include <stdint.h> @@ -206,7 +205,7 @@ return "GNB"; }
-static struct device_operations root_complex_operations = { +struct device_operations cezanne_root_complex_operations = { .read_resources = read_resources, .set_resources = noop_set_resources, .enable_resources = pci_dev_enable_resources, @@ -214,9 +213,3 @@ .acpi_name = gnb_acpi_name, .acpi_fill_ssdt = root_complex_fill_ssdt, }; - -static const struct pci_driver family17_root_complex __pci_driver = { - .ops = &root_complex_operations, - .vendor = PCI_VID_AMD, - .device = PCI_DID_AMD_17H_MODEL_606F_NB, -};