soc/amd/*: Hook up SMBus ops to devicetree

This removes the need for a PCI driver.

Change-Id: Iab75f8c28a247f1370f4425e19cc215678bfa3e5
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68140
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
This commit is contained in:
Arthur Heymans 2022-10-05 14:36:55 +02:00 committed by Felix Held
parent 65d73cc457
commit fd2bb9b6bc
8 changed files with 8 additions and 16 deletions

View File

@ -94,7 +94,7 @@ chip soc/amd/cezanne
device pci 0.2 alias i2s_ac97 off end # I2S/AC'97 Audio device pci 0.2 alias i2s_ac97 off end # I2S/AC'97 Audio
end end
device pci 14.0 alias smbus on end # primary FCH function 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 14.3 alias lpc_bridge on end
device pci 18.0 alias data_fabric_0 on ops cezanne_data_fabric_ops end device pci 18.0 alias data_fabric_0 on ops cezanne_data_fabric_ops end

View File

@ -3,7 +3,6 @@
#include <amdblocks/acpimmio.h> #include <amdblocks/acpimmio.h>
#include <device/device.h> #include <device/device.h>
#include <device/pci.h> #include <device/pci.h>
#include <device/pci_ids.h>
#include <device/smbus.h> #include <device/smbus.h>
#include <device/smbus_host.h> #include <device/smbus_host.h>
@ -64,7 +63,7 @@ static const char *smbus_acpi_name(const struct device *dev)
} }
#endif #endif
static struct device_operations smbus_ops = { struct device_operations amd_smbus_ops = {
.read_resources = noop_read_resources, .read_resources = noop_read_resources,
.set_resources = noop_set_resources, .set_resources = noop_set_resources,
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
@ -75,10 +74,3 @@ static struct device_operations smbus_ops = {
.acpi_name = smbus_acpi_name, .acpi_name = smbus_acpi_name,
#endif #endif
}; };
static const struct pci_driver smbus_driver __pci_driver = {
.ops = &smbus_ops,
.vendor = PCI_VID_AMD,
/* PCI device ID is used on all integrated FCHs except Family 16h Models 00h-3Fh */
.device = PCI_DID_AMD_CZ_SMBUS,
};

View File

@ -71,7 +71,7 @@ chip soc/amd/mendocino
device pci 0.0 alias xhci_2 off end # Might also be a dummy device with different PCI DID device pci 0.0 alias xhci_2 off end # Might also be a dummy device with different PCI DID
end end
device pci 14.0 alias smbus on end # primary FCH function 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 14.3 alias lpc_bridge on end
device pci 18.0 alias data_fabric_0 on ops mendocino_data_fabric_ops end device pci 18.0 alias data_fabric_0 on ops mendocino_data_fabric_ops end

View File

@ -71,7 +71,7 @@ chip soc/amd/mendocino
device pci 0.0 alias xhci_2 off end # Might also be a dummy device with different PCI DID device pci 0.0 alias xhci_2 off end # Might also be a dummy device with different PCI DID
end end
device pci 14.0 alias smbus on end # primary FCH function 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 14.3 alias lpc_bridge on end
device pci 18.0 alias data_fabric_0 on ops mendocino_data_fabric_ops end device pci 18.0 alias data_fabric_0 on ops mendocino_data_fabric_ops end

View File

@ -73,7 +73,7 @@ chip soc/amd/morgana
device pci 0.0 alias xhci_2 off end # Might also be a dummy device with different PCI DID device pci 0.0 alias xhci_2 off end # Might also be a dummy device with different PCI DID
end end
device pci 14.0 alias smbus on end # primary FCH function 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 14.3 alias lpc_bridge on end
device pci 18.0 alias data_fabric_0 on ops morgana_data_fabric_ops end device pci 18.0 alias data_fabric_0 on ops morgana_data_fabric_ops end

View File

@ -34,7 +34,7 @@ chip soc/amd/picasso
device pci 0.1 alias xgbe_0 off end device pci 0.1 alias xgbe_0 off end
device pci 0.2 alias xgbe_1 off end device pci 0.2 alias xgbe_1 off end
end end
device pci 14.0 alias smbus on end # primary FCH function 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 14.3 alias lpc_bridge on end
device pci 14.6 alias sdhci off end device pci 14.6 alias sdhci off end
device pci 18.0 alias data_fabric_0 on ops picasso_data_fabric_ops end device pci 18.0 alias data_fabric_0 on ops picasso_data_fabric_ops end

View File

@ -28,7 +28,7 @@ chip soc/amd/stoneyridge
device pci 10.0 alias xhci off ops stoneyridge_usb_ops end device pci 10.0 alias xhci off ops stoneyridge_usb_ops end
device pci 11.0 alias sata off end device pci 11.0 alias sata off end
device pci 12.0 alias ehci off ops stoneyridge_usb_ops end device pci 12.0 alias ehci off ops stoneyridge_usb_ops end
device pci 14.0 alias smbus on end # primary FCH function 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 14.3 alias lpc_bridge on end
device pci 14.7 alias sdhci off end device pci 14.7 alias sdhci off end
device pci 18.0 alias ht_0 on end device pci 18.0 alias ht_0 on end

View File

@ -22,7 +22,7 @@ chip soc/amd/stoneyridge
device pci 10.0 alias xhci off ops stoneyridge_usb_ops end device pci 10.0 alias xhci off ops stoneyridge_usb_ops end
device pci 11.0 alias sata off end device pci 11.0 alias sata off end
device pci 12.0 alias ehci off ops stoneyridge_usb_ops end device pci 12.0 alias ehci off ops stoneyridge_usb_ops end
device pci 14.0 alias smbus on end # primary FCH function 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 14.3 alias lpc_bridge on end
device pci 14.7 alias sdhci off end device pci 14.7 alias sdhci off end
device pci 18.0 alias ht_0 on end device pci 18.0 alias ht_0 on end