summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMyles Watson <mylesgw@gmail.com>2009-01-05 22:57:45 +0000
committerMyles Watson <mylesgw@gmail.com>2009-01-05 22:57:45 +0000
commitd2f540f35ea5ca91af0b1fba8d3a9e5e5bfd24be (patch)
treeb1519cc4b60794c030219c312606b01cf6bb28b5
parentd4eca0446f5803596068b4bca090bbbb7bf24ab4 (diff)
downloadcoreboot-d2f540f35ea5ca91af0b1fba8d3a9e5e5bfd24be.tar.gz
coreboot-d2f540f35ea5ca91af0b1fba8d3a9e5e5bfd24be.tar.bz2
coreboot-d2f540f35ea5ca91af0b1fba8d3a9e5e5bfd24be.zip
This patch introduces {PCIX,PCIE,AGP...}_SUPPORT config variables.
Kconfig: Add *_SUPPORT variables. Add select statements for the hardware that needs them. device/Makefile: Test *_SUPPORT variables instead of chip names. device/Kconfig: Add *_PLUGIN_SUPPORT variables. device/pci_device.c: Conditionally include headers if *_PLUGIN_SUPPORT. Update default drivers to depend on CONFIG_*_PLUGIN_SUPPORT. Signed-off-by: Myles Watson <mylesgw@gmail.com> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://coreboot.org/repository/coreboot-v3@1097 f3766cd6-281f-0410-b1cd-43a5c92072e9
-rw-r--r--Kconfig16
-rw-r--r--device/Kconfig39
-rw-r--r--device/Makefile14
-rw-r--r--device/pci_device.c26
4 files changed, 81 insertions, 14 deletions
diff --git a/Kconfig b/Kconfig
index 49a9af99a736..4b4669c3165a 100644
--- a/Kconfig
+++ b/Kconfig
@@ -93,10 +93,23 @@ source device/Kconfig
# These are used for internal purposes only:
+# Buses:
+config PCIX_SUPPORT
+ boolean
+config PCIE_SUPPORT
+ boolean
+config HYPERTRANSPORT_SUPPORT
+ boolean
+config AGP_SUPPORT
+ boolean
+config CARDBUS_SUPPORT
+ boolean
+
# Northbridges:
config NORTHBRIDGE_AMD_GEODELX
boolean
config NORTHBRIDGE_AMD_K8
+ select HYPERTRANSPORT_SUPPORT
boolean
config NORTHBRIDGE_INTEL_I440BXEMULATION
boolean
@@ -111,10 +124,13 @@ config SOUTHBRIDGE_AMD_CS5536
config SOUTHBRIDGE_INTEL_I82371EB
boolean
config SOUTHBRIDGE_NVIDIA_MCP55
+ select PCIE_SUPPORT
boolean
config SOUTHBRIDGE_AMD_AMD8151
+ select AGP_SUPPORT
boolean
config SOUTHBRIDGE_AMD_AMD8132
+ select PCIX_SUPPORT
boolean
config SOUTHBRIDGE_AMD_AMD8111
boolean
diff --git a/device/Kconfig b/device/Kconfig
index 00c3b07105cf..41faaa2e2c71 100644
--- a/device/Kconfig
+++ b/device/Kconfig
@@ -125,6 +125,45 @@ config INITIALIZE_ONBOARD_VGA_FIRST
endmenu
+menu "Plugin Support"
+
+config PCIX_PLUGIN_SUPPORT
+ bool "Support for devices that provide PCI-X and aren't in the dts."
+ select PCIX_SUPPORT
+ default false
+ help
+ Compile in the drivers for cards that provide PCI-X.
+
+config PCIE_PLUGIN_SUPPORT
+ bool "Support for devices that provide PCI-e and aren't in the dts."
+ select PCIE_SUPPORT
+ default false
+ help
+ Compile in the drivers for cards that provide PCI-e.
+
+config HYPERTRANSPORT_PLUGIN_SUPPORT
+ bool "Support for devices that provide HT and aren't in the dts."
+ select HYPERTRANSPORT_SUPPORT
+ default false
+ help
+ Compile in the drivers for cards that provide HT.
+
+config AGP_PLUGIN_SUPPORT
+ bool "Support for devices that provide AGP and aren't in the dts."
+ select AGP_SUPPORT
+ default false
+ help
+ Compile in the drivers for cards that provide AGP.
+
+config CARDBUS_PLUGIN_SUPPORT
+ bool "Support for devices that provide Cardbus and aren't in the dts."
+ select CARDBUS_SUPPORT
+ default false
+ help
+ Compile in the drivers for cards that provide Cardbus.
+
+endmenu
+
menu "Power management"
config SUSPEND_TO_RAM
diff --git a/device/Makefile b/device/Makefile
index 5aaf22945026..727ad36af67f 100644
--- a/device/Makefile
+++ b/device/Makefile
@@ -28,27 +28,23 @@ STAGE2_DEVICE_SRC = device.c device_util.c root_device.c \
pci_device.c pci_ops.c pci_rom.c pnp_device.c pnp_raw.c \
smbus_ops.c
-# this is only needed on the K8
-# This could also check for CONFIG_HYPERTRANSPORT_PLUGIN_SUPPORT
-ifeq ($(CONFIG_NORTHBRIDGE_AMD_K8),y)
+ifeq ($(CONFIG_HYPERTRANSPORT_SUPPORT),y)
STAGE2_DEVICE_SRC += hypertransport.c
endif
-# this is only needed for pcix devices
-# This should also check for CONFIG_PCIX_PLUGIN_SUPPORT
-ifeq ($(CONFIG_SOUTHBRIDGE_AMD_AMD8132),y)
+ifeq ($(CONFIG_PCIX_SUPPORT),y)
STAGE2_DEVICE_SRC += pcix_device.c
endif
-ifeq ($(CONFIG_PCIE_PLUGIN_SUPPORT),y)
+ifeq ($(CONFIG_PCIE_SUPPORT),y)
STAGE2_DEVICE_SRC += pcie_device.c
endif
-ifeq ($(CONFIG_CARDBUS_PLUGIN_SUPPORT),y)
+ifeq ($(CONFIG_CARDBUS_SUPPORT),y)
STAGE2_DEVICE_SRC += cardbus_device.c
endif
-ifeq ($(CONFIG_AGP_PLUGIN_SUPPORT),y)
+ifeq ($(CONFIG_AGP_SUPPORT),y)
STAGE2_DEVICE_SRC += agp_device.c
endif
diff --git a/device/pci_device.c b/device/pci_device.c
index ffa5685f9b4c..044ee20b23f3 100644
--- a/device/pci_device.c
+++ b/device/pci_device.c
@@ -32,6 +32,22 @@
#include <device/pci.h>
#include <device/pci_ids.h>
+#ifdef CONFIG_PCIX_PLUGIN_SUPPORT
+#include <device/pcix.h>
+#endif
+#ifdef CONFIG_AGP_PLUGIN_SUPPORT
+#include <device/agp.h>
+#endif
+#ifdef CONFIG_HYPERTRANSPORT_PLUGIN_SUPPORT
+#include <device/hypertransport.h>
+#endif
+#ifdef CONFIG_PCIE_PLUGIN_SUPPORT
+#include <device/pcie.h>
+#endif
+#ifdef CONFIG_CARDBUS_PLUGIN_SUPPORT
+#include <device/cardbus.h>
+#endif
+
#include <statictree.h>
u8 pci_moving_config8(struct device *dev, unsigned int reg)
@@ -776,7 +792,7 @@ const struct device_operations default_pci_ops_bus = {
*/
static const struct device_operations *get_pci_bridge_ops(struct device *dev)
{
-#ifdef DEVICE_PCIX_H
+#ifdef CONFIG_PCIX_PLUGIN_SUPPORT
unsigned int pcix_pos;
pcix_pos = pci_find_capability(dev, PCI_CAP_ID_PCIX);
if (pcix_pos) {
@@ -785,12 +801,12 @@ static const struct device_operations *get_pci_bridge_ops(struct device *dev)
return &default_pcix_ops_bus;
}
#endif
-#ifdef DEVICE_AGP_H
+#ifdef CONFIG_AGP_PLUGIN_SUPPORT
/* How do I detect an PCI to AGP bridge? */
#warning AGP detection not implemented, so AGP bridge plugin not supported.
#endif
-#ifdef DEVICE_HYPERTRANSPORT_H
+#ifdef CONFIG_HYPERTRANSPORT_PLUGIN_SUPPORT
unsigned int ht_pos;
ht_pos = 0;
while ((ht_pos = pci_find_next_capability(dev, PCI_CAP_ID_HT, ht_pos))) {
@@ -805,7 +821,7 @@ static const struct device_operations *get_pci_bridge_ops(struct device *dev)
}
}
#endif
-#ifdef DEVICE_PCIE_H
+#ifdef CONFIG_PCIE_PLUGIN_SUPPORT
unsigned int pcie_pos;
pcie_pos = pci_find_capability(dev, PCI_CAP_ID_PCIE);
if (pcie_pos) {
@@ -881,7 +897,7 @@ static void set_pci_ops(struct device *dev)
else
dev->ops = get_pci_bridge_ops(dev);
break;
-#ifdef DEVICE_CARDBUS_H
+#ifdef CONFIG_CARDBUS_PLUGIN_SUPPORT
case PCI_HEADER_TYPE_CARDBUS:
dev->ops = &default_cardbus_ops_bus;
break;