summaryrefslogtreecommitdiff
path: root/src/southbridge/intel/i82801gx
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2012-07-26 19:48:23 +0200
committerPatrick Georgi <patrick@georgi-clan.de>2012-07-26 22:25:10 +0200
commitefff733ad83acf8502561a9cadc9202c6974e510 (patch)
treeb81785cd64f750ac790c5b4306dc4b0b16ca641c /src/southbridge/intel/i82801gx
parent8730bf8aad995bf105454ac1a93dee4c7b5565d5 (diff)
downloadcoreboot-efff733ad83acf8502561a9cadc9202c6974e510.tar.xz
Refactor driver structs
Our driver infrastructure became more flexible recently. Make use of it. These are the low hanging fruits (files with 5 device variants or more), but there are still lots of files with less potential for deduplication. Change-Id: If6b7be5046581f81485a511b150f99b029b95c3b Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/1358 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/southbridge/intel/i82801gx')
-rw-r--r--src/southbridge/intel/i82801gx/pcie.c46
-rw-r--r--src/southbridge/intel/i82801gx/sata.c56
2 files changed, 21 insertions, 81 deletions
diff --git a/src/southbridge/intel/i82801gx/pcie.c b/src/southbridge/intel/i82801gx/pcie.c
index d69bc6d07d..73bc69d5c9 100644
--- a/src/southbridge/intel/i82801gx/pcie.c
+++ b/src/southbridge/intel/i82801gx/pcie.c
@@ -121,44 +121,18 @@ static struct device_operations device_ops = {
.ops_pci = &pci_ops,
};
-/* 82801GB/GR/GDH/GBM/GHM (ICH7/ICH7R/ICH7DH/ICH7-M/ICH7-M DH) */
-static const struct pci_driver i82801gx_pcie_port1 __pci_driver = {
- .ops = &device_ops,
- .vendor = PCI_VENDOR_ID_INTEL,
- .device = 0x27d0,
-};
-
-/* 82801GB/GR/GDH/GBM/GHM (ICH7/ICH7R/ICH7DH/ICH7-M/ICH7-M DH) */
-static const struct pci_driver i82801gx_pcie_port2 __pci_driver = {
- .ops = &device_ops,
- .vendor = PCI_VENDOR_ID_INTEL,
- .device = 0x27d2,
-};
-
-/* 82801GB/GR/GDH/GBM/GHM (ICH7/ICH7R/ICH7DH/ICH7-M/ICH7-M DH) */
-static const struct pci_driver i82801gx_pcie_port3 __pci_driver = {
- .ops = &device_ops,
- .vendor = PCI_VENDOR_ID_INTEL,
- .device = 0x27d4,
-};
-
-/* 82801GB/GR/GDH/GBM/GHM (ICH7/ICH7R/ICH7DH/ICH7-M/ICH7-M DH) */
-static const struct pci_driver i82801gx_pcie_port4 __pci_driver = {
- .ops = &device_ops,
- .vendor = PCI_VENDOR_ID_INTEL,
- .device = 0x27d6,
-};
-
-/* 82801GR/GDH/GHM (ICH7R/ICH7DH/ICH7-M DH) */
-static const struct pci_driver i82801gx_pcie_port5 __pci_driver = {
- .ops = &device_ops,
- .vendor = PCI_VENDOR_ID_INTEL,
- .device = 0x27e0,
+static const unsigned short i82801gx_pcie_ids[] = {
+ 0x27d0, /* 82801GB/GR/GDH/GBM/GHM (ICH7/ICH7R/ICH7DH/ICH7-M/ICH7-M DH) */
+ 0x27d2, /* 82801GB/GR/GDH/GBM/GHM (ICH7/ICH7R/ICH7DH/ICH7-M/ICH7-M DH) */
+ 0x27d4, /* 82801GB/GR/GDH/GBM/GHM (ICH7/ICH7R/ICH7DH/ICH7-M/ICH7-M DH) */
+ 0x27d6, /* 82801GB/GR/GDH/GBM/GHM (ICH7/ICH7R/ICH7DH/ICH7-M/ICH7-M DH) */
+ 0x27e0, /* 82801GR/GDH/GHM (ICH7R/ICH7DH/ICH7-M DH) */
+ 0x27e2, /* 82801GR/GDH/GHM (ICH7R/ICH7DH/ICH7-M DH) */
+ 0
};
-/* 82801GR/GDH/GHM (ICH7R/ICH7DH/ICH7-M DH) */
-static const struct pci_driver i82801gx_pcie_port6 __pci_driver = {
+static const struct pci_driver i82801gx_pcie __pci_driver = {
.ops = &device_ops,
.vendor = PCI_VENDOR_ID_INTEL,
- .device = 0x27e2,
+ .devices= i82801gx_pcie_ids,
};
diff --git a/src/southbridge/intel/i82801gx/sata.c b/src/southbridge/intel/i82801gx/sata.c
index 0e7a1a740c..a8d6f30362 100644
--- a/src/southbridge/intel/i82801gx/sata.c
+++ b/src/southbridge/intel/i82801gx/sata.c
@@ -213,53 +213,19 @@ static struct device_operations sata_ops = {
.ops_pci = &sata_pci_ops,
};
-/* Desktop Non-AHCI and Non-RAID Mode */
-/* 82801GB/GR/GDH (ICH7/ICH7R/ICH7DH) */
-static const struct pci_driver i82801gx_sata_normal_driver __pci_driver = {
- .ops = &sata_ops,
- .vendor = PCI_VENDOR_ID_INTEL,
- .device = 0x27c0,
-};
-
-/* Mobile Non-AHCI and Non-RAID Mode */
-/* 82801GBM/GHM (ICH7-M/ICH7-M DH) */
-static const struct pci_driver i82801gx_sata_mobile_normal_driver __pci_driver = {
- .ops = &sata_ops,
- .vendor = PCI_VENDOR_ID_INTEL,
- .device = 0x27c4,
-};
-
-
-/* NOTE: Any of the below are not properly supported yet. */
-
-/* Desktop AHCI Mode */
-/* 82801GB/GR/GDH (ICH7/ICH7R/ICH7DH) */
-static const struct pci_driver i82801gx_sata_ahci_driver __pci_driver = {
- .ops = &sata_ops,
- .vendor = PCI_VENDOR_ID_INTEL,
- .device = 0x27c1,
-};
-
-/* Desktop RAID mode */
-/* 82801GB/GR/GDH (ICH7/ICH7R/ICH7DH) */
-static const struct pci_driver i82801gx_sata_raid_driver __pci_driver = {
- .ops = &sata_ops,
- .vendor = PCI_VENDOR_ID_INTEL,
- .device = 0x27c3,
-};
-
-/* Mobile AHCI Mode */
-/* 82801GBM/GHM (ICH7-M/ICH7-M DH) */
-static const struct pci_driver i82801gx_sata_mobile_ahci_driver __pci_driver = {
- .ops = &sata_ops,
- .vendor = PCI_VENDOR_ID_INTEL,
- .device = 0x27c5,
+static const unsigned short sata_ids[] = {
+ 0x27c0, /* Desktop Non-AHCI and Non-RAID Mode: 82801GB/GR/GDH (ICH7/ICH7R/ICH7DH) */
+ 0x27c4, /* Mobile Non-AHCI and Non-RAID Mode: 82801GBM/GHM (ICH7-M/ICH7-M DH) */
+ /* NOTE: Any of the below are not properly supported yet. */
+ 0x27c1, /* Desktop AHCI Mode: 82801GB/GR/GDH (ICH7/ICH7R/ICH7DH) */
+ 0x27c3, /* Desktop RAID mode: 82801GB/GR/GDH (ICH7/ICH7R/ICH7DH) */
+ 0x27c5, /* Mobile AHCI Mode: 82801GBM/GHM (ICH7-M/ICH7-M DH) */
+ 0x27c6, /* ICH7M DH Raid Mode: 82801GHM (ICH7-M DH) */
+ 0
};
-/* ICH7M DH Raid Mode */
-/* 82801GHM (ICH7-M DH) */
-static const struct pci_driver i82801gx_sata_ich7dh_raid_driver __pci_driver = {
+static const struct pci_driver i82801gx_sata_driver __pci_driver = {
.ops = &sata_ops,
.vendor = PCI_VENDOR_ID_INTEL,
- .device = 0x27c6,
+ .devices= sata_ids,
};