summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2022-09-20 17:26:30 +0200
committerFelix Held <felix-coreboot@felixheld.de>2022-10-13 19:40:28 +0000
commit826955d36557619d1e9d3995d61e721f8382c5f0 (patch)
tree91f33b32d0e6a9c26faaa0fedf4241c4ebb0535e /src/soc/amd
parent7f3807728bdbf2a9a6e9a6177748ff383c47d43d (diff)
soc/amd/picasso: 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: Ide747c9d386731af89b27630b200676c6e439910 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/67743 Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com> Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/picasso/chipset.cb18
-rw-r--r--src/soc/amd/picasso/data_fabric.c20
-rw-r--r--src/soc/amd/picasso/root_complex.c9
3 files changed, 11 insertions, 36 deletions
diff --git a/src/soc/amd/picasso/chipset.cb b/src/soc/amd/picasso/chipset.cb
index 76953c73ae..0ed7c732ad 100644
--- a/src/soc/amd/picasso/chipset.cb
+++ b/src/soc/amd/picasso/chipset.cb
@@ -6,7 +6,7 @@ chip soc/amd/picasso
end
device domain 0 on
ops picasso_pci_domain_ops
- device pci 00.0 alias gnb on end
+ device pci 00.0 alias gnb on ops picasso_root_complex_operations end
device pci 00.2 alias iommu off end
device pci 01.0 on end # Dummy Host Bridge, do not disable
device pci 01.1 alias gpp_bridge_0 off end
@@ -35,14 +35,14 @@ chip soc/amd/picasso
device pci 14.0 alias smbus on end # primary FCH function
device pci 14.3 alias lpc_bridge on end
device pci 14.6 alias sdhci off 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 picasso_data_fabric_ops end
+ device pci 18.1 alias data_fabric_1 on ops picasso_data_fabric_ops end
+ device pci 18.2 alias data_fabric_2 on ops picasso_data_fabric_ops end
+ device pci 18.3 alias data_fabric_3 on ops picasso_data_fabric_ops end
+ device pci 18.4 alias data_fabric_4 on ops picasso_data_fabric_ops end
+ device pci 18.5 alias data_fabric_5 on ops picasso_data_fabric_ops end
+ device pci 18.6 alias data_fabric_6 on ops picasso_data_fabric_ops end
+ device pci 18.7 alias data_fabric_7 on ops picasso_data_fabric_ops end
end
device mmio 0xfedc4000 alias i2c_2 off ops soc_amd_i2c_mmio_ops end
diff --git a/src/soc/amd/picasso/data_fabric.c b/src/soc/amd/picasso/data_fabric.c
index 50f75bc46a..ddc280bc67 100644
--- a/src/soc/amd/picasso/data_fabric.c
+++ b/src/soc/amd/picasso/data_fabric.c
@@ -124,27 +124,9 @@ static const char *data_fabric_acpi_name(const struct device *dev)
return NULL;
}
-static struct device_operations data_fabric_ops = {
+struct device_operations picasso_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[] = {
- PCI_DID_AMD_FAM17H_MODEL18H_DF0,
- PCI_DID_AMD_FAM17H_MODEL18H_DF1,
- PCI_DID_AMD_FAM17H_MODEL18H_DF2,
- PCI_DID_AMD_FAM17H_MODEL18H_DF3,
- PCI_DID_AMD_FAM17H_MODEL18H_DF4,
- PCI_DID_AMD_FAM17H_MODEL18H_DF5,
- PCI_DID_AMD_FAM17H_MODEL18H_DF6,
- PCI_DID_AMD_FAM17H_MODEL18H_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/picasso/root_complex.c b/src/soc/amd/picasso/root_complex.c
index 2fe8a217a6..d53643ec76 100644
--- a/src/soc/amd/picasso/root_complex.c
+++ b/src/soc/amd/picasso/root_complex.c
@@ -12,7 +12,6 @@
#include <cpu/amd/msr.h>
#include <device/device.h>
#include <device/pci.h>
-#include <device/pci_ids.h>
#include <fsp/util.h>
#include <stdint.h>
#include <soc/iomap.h>
@@ -213,7 +212,7 @@ static const char *gnb_acpi_name(const struct device *dev)
return "GNB";
}
-static struct device_operations root_complex_operations = {
+struct device_operations picasso_root_complex_operations = {
.read_resources = read_resources,
.set_resources = noop_set_resources,
.enable_resources = pci_dev_enable_resources,
@@ -221,9 +220,3 @@ static struct device_operations root_complex_operations = {
.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_101F_NB,
-};