bd82x6x: Convert all PCI ID lists to new scheme

- Convert all PCI ID lists to new scheme
- Unify code (variable names)
- add missing PCI IDs for Panther Point PCIe root ports.

Change-Id: I6357f6ebce7ddffe45a3ec642b0c594147f6134c
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1301
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
diff --git a/src/southbridge/intel/bd82x6x/azalia.c b/src/southbridge/intel/bd82x6x/azalia.c
index 5a83e38..e40bbe3 100644
--- a/src/southbridge/intel/bd82x6x/azalia.c
+++ b/src/southbridge/intel/bd82x6x/azalia.c
@@ -353,15 +353,11 @@
 	.ops_pci		= &azalia_pci_ops,
 };
 
-static const struct pci_driver azalia_0 __pci_driver = {
-	.ops	= &azalia_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c20,
-};
+static const unsigned short pci_device_ids[] = { 0x1c20, 0x1e20, 0 };
 
-static const struct pci_driver azalia_1 __pci_driver = {
-	.ops	= &azalia_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1e20,
+static const struct pci_driver pch_azalia __pci_driver = {
+	.ops	 = &azalia_ops,
+	.vendor	 = PCI_VENDOR_ID_INTEL,
+	.devices = pci_device_ids,
 };
 
diff --git a/src/southbridge/intel/bd82x6x/lpc.c b/src/southbridge/intel/bd82x6x/lpc.c
index 703fc8a..37f9290 100644
--- a/src/southbridge/intel/bd82x6x/lpc.c
+++ b/src/southbridge/intel/bd82x6x/lpc.c
@@ -604,93 +604,17 @@
  * update from August 2011
  */
 
-static const struct pci_driver q67_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c4e,
+static const unsigned short pci_device_ids[] = { 0x1c46, 0x1c47, 0x1c49, 0x1c4a,
+						 0x1c4b, 0x1c4c, 0x1c4d, 0x1c4e,
+						 0x1c4f, 0x1c50, 0x1c52, 0x1c54,
+						 0x1e55, 0x1c56, 0x1c5c, 0x1e5d,
+						 0x1e5e, 0x1e5f,
+						 0 };
+
+static const struct pci_driver pch_lpc __pci_driver = {
+	.ops	 = &device_ops,
+	.vendor	 = PCI_VENDOR_ID_INTEL,
+	.devices = pci_device_ids,
 };
-static const struct pci_driver q65_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c4c,
-};
-static const struct pci_driver b65_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c50,
-};
-static const struct pci_driver h67_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c4a,
-};
-static const struct pci_driver z68_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c46,
-};
-static const struct pci_driver h61_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c5c,
-};
-static const struct pci_driver c202_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c52,
-};
-static const struct pci_driver c204_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c54,
-};
-static const struct pci_driver c206_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c56,
-};
-static const struct pci_driver qm67_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c4f,
-};
-static const struct pci_driver um67_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c47,
-};
-static const struct pci_driver hm67_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c4b,
-};
-static const struct pci_driver hm65_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c49,
-};
-static const struct pci_driver qs67_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c4d,
-};
-static const struct pci_driver c216_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1e55,
-};
-static const struct pci_driver hm75_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1e5d,
-};
-static const struct pci_driver hm70_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1e5e,
-};
-static const struct pci_driver nm70_lpc __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1e5f,
-};
+
+
diff --git a/src/southbridge/intel/bd82x6x/pch.c b/src/southbridge/intel/bd82x6x/pch.c
index 5f440e6..0913e1d 100644
--- a/src/southbridge/intel/bd82x6x/pch.c
+++ b/src/southbridge/intel/bd82x6x/pch.c
@@ -403,6 +403,6 @@
 }
 
 struct chip_operations southbridge_intel_bd82x6x_ops = {
-	CHIP_NAME("Intel Series 6 (" CONFIG_PCH_CHIP_NAME ") Southbridge")
+	CHIP_NAME("Intel Series 6/7 (" CONFIG_PCH_CHIP_NAME ") Southbridge")
 	.enable_dev = pch_enable,
 };
diff --git a/src/southbridge/intel/bd82x6x/pcie.c b/src/southbridge/intel/bd82x6x/pcie.c
index 5ab18f6..00d1de2 100644
--- a/src/southbridge/intel/bd82x6x/pcie.c
+++ b/src/southbridge/intel/bd82x6x/pcie.c
@@ -257,68 +257,14 @@
 	.ops_pci		= &pci_ops,
 };
 
-static const struct pci_driver pch_pcie_port1 __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c10,	/* D28:F0 */
-};
+static const unsigned short pci_device_ids[] = { 0x1c10, 0x1c12, 0x1c14, 0x1c16,
+						 0x1c18, 0x1c1a, 0x1c1c, 0x1c1e,
+						 0x1e10, 0x1e12, 0x1e14, 0x1e16,
+						 0x1e18, 0x1e1a, 0x1e1c, 0x1e1e,
+						 0 };
 
-static const struct pci_driver pch_pcie_port1_a __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1e10,	/* D28:F0 */
-};
-
-static const struct pci_driver pch_pcie_port2 __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c12,	/* D28:F1 */
-};
-
-static const struct pci_driver pch_pcie_port3 __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c14,	/* D28:F2 */
-};
-
-static const struct pci_driver pch_pcie_port3_a __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1e14,	/* D28:F2 */
-};
-
-static const struct pci_driver pch_pcie_port4 __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c16,	/* D28:F3 */
-};
-
-static const struct pci_driver pch_pcie_port4_a __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1e16,	/* D28:F3 */
-};
-
-static const struct pci_driver pch_pcie_port5 __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c18,	/* D28:F4 */
-};
-
-static const struct pci_driver pch_pcie_port6 __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c1a,	/* D28:F5 */
-};
-
-static const struct pci_driver pch_pcie_port7 __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c1c,	/* D28:F6 */
-};
-
-static const struct pci_driver pch_pcie_port8 __pci_driver = {
-	.ops	= &device_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c1e,	/* D28:F7 */
+static const struct pci_driver pch_pcie __pci_driver = {
+	.ops	 = &device_ops,
+	.vendor	 = PCI_VENDOR_ID_INTEL,
+	.devices = pci_device_ids,
 };
diff --git a/src/southbridge/intel/bd82x6x/sata.c b/src/southbridge/intel/bd82x6x/sata.c
index 431a29b..c0eb232 100644
--- a/src/southbridge/intel/bd82x6x/sata.c
+++ b/src/southbridge/intel/bd82x6x/sata.c
@@ -230,13 +230,13 @@
 	.ops_pci		= &sata_pci_ops,
 };
 
-static const unsigned short all_dev_ids[] = { 0x1c00, 0x1c01, 0x1c02, 0x1c03,
-					      0x1e00, 0x1e01, 0x1e02, 0x1e03,
-					      0 };
-/* Non-AHCI and Non-RAID Mode */
-static const struct pci_driver pch_sata_normal_driver __pci_driver = {
-	.ops	= &sata_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.devices = all_dev_ids,
+static const unsigned short pci_device_ids[] = { 0x1c00, 0x1c01, 0x1c02, 0x1c03,
+						 0x1e00, 0x1e01, 0x1e02, 0x1e03,
+						 0 };
+
+static const struct pci_driver pch_sata __pci_driver = {
+	.ops	 = &sata_ops,
+	.vendor	 = PCI_VENDOR_ID_INTEL,
+	.devices = pci_device_ids,
 };
 
diff --git a/src/southbridge/intel/bd82x6x/smbus.c b/src/southbridge/intel/bd82x6x/smbus.c
index baa3cfb..4930685 100644
--- a/src/southbridge/intel/bd82x6x/smbus.c
+++ b/src/southbridge/intel/bd82x6x/smbus.c
@@ -100,14 +100,10 @@
 	.ops_pci		= &smbus_pci_ops,
 };
 
-static const struct pci_driver pch_smbus __pci_driver = {
-	.ops	= &smbus_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c22,
-};
+static const unsigned short pci_device_ids[] = { 0x1c22, 0x1e22, 0 };
 
-static const struct pci_driver pch_smbus_a __pci_driver = {
-	.ops	= &smbus_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1e22,
+static const struct pci_driver pch_smbus __pci_driver = {
+	.ops	 = &smbus_ops,
+	.vendor	 = PCI_VENDOR_ID_INTEL,
+	.devices = pci_device_ids,
 };
diff --git a/src/southbridge/intel/bd82x6x/usb_ehci.c b/src/southbridge/intel/bd82x6x/usb_ehci.c
index c299535..76e8338 100644
--- a/src/southbridge/intel/bd82x6x/usb_ehci.c
+++ b/src/southbridge/intel/bd82x6x/usb_ehci.c
@@ -102,23 +102,11 @@
 	.ops_pci		= &lops_pci,
 };
 
-static const struct pci_driver pch_usb_ehci1 __pci_driver = {
-	.ops	= &usb_ehci_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c26,
-};
-static const struct pci_driver pch_usb_ehci2 __pci_driver = {
-	.ops	= &usb_ehci_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1c2d,
-};
-static const struct pci_driver pch_usb_ehci3 __pci_driver = {
-	.ops	= &usb_ehci_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1e26,
-};
-static const struct pci_driver pch_usb_ehci4 __pci_driver = {
-	.ops	= &usb_ehci_ops,
-	.vendor	= PCI_VENDOR_ID_INTEL,
-	.device	= 0x1e2d,
+static const unsigned short pci_device_ids[] = { 0x1c26, 0x1c2d, 0x1e26, 0x1e2d,
+						 0 };
+
+static const struct pci_driver pch_usb_ehci __pci_driver = {
+	.ops	 = &usb_ehci_ops,
+	.vendor	 = PCI_VENDOR_ID_INTEL,
+	.devices = pci_device_ids,
 };