patch-2.4.21 linux-2.4.21/drivers/hotplug/cpqphp_core.c
Next file: linux-2.4.21/drivers/hotplug/cpqphp_ctrl.c
Previous file: linux-2.4.21/drivers/hotplug/cpqphp.h
Back to the patch index
Back to the overall index
- Lines: 110
- Date:
2003-06-13 07:51:33.000000000 -0700
- Orig file:
linux-2.4.20/drivers/hotplug/cpqphp_core.c
- Orig date:
2002-11-28 15:53:12.000000000 -0800
diff -urN linux-2.4.20/drivers/hotplug/cpqphp_core.c linux-2.4.21/drivers/hotplug/cpqphp_core.c
@@ -24,6 +24,9 @@
*
* Send feedback to <greg@kroah.com>
*
+ * Jan 12, 2003 - Added 66/100/133MHz PCI-X support,
+ * Torben Mathiasen <torben.mathiasen@hp.com>
+ *
*/
#include <linux/config.h>
@@ -53,7 +56,7 @@
static u8 power_mode;
static int debug;
-#define DRIVER_VERSION "0.9.6"
+#define DRIVER_VERSION "0.9.7"
#define DRIVER_AUTHOR "Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>"
#define DRIVER_DESC "Compaq Hot Plug PCI Controller Driver"
@@ -829,6 +832,7 @@
u8 hp_slot = 0;
u8 device;
u8 rev;
+ u8 bus_cap;
u16 temp_word;
u16 vendor_id;
u16 subsystem_vid;
@@ -890,6 +894,39 @@
switch (subsystem_vid) {
case PCI_VENDOR_ID_COMPAQ:
+ if (rev >= 0x13) { /* CIOBX */
+ ctrl->push_flag = 1;
+ ctrl->slot_switch_type = 1; // Switch is present
+ ctrl->push_button = 1; // Pushbutton is present
+ ctrl->pci_config_space = 1; // Index/data access to working registers 0 = not supported, 1 = supported
+ ctrl->defeature_PHP = 1; // PHP is supported
+ ctrl->pcix_support = 1; // PCI-X supported
+ ctrl->pcix_speed_capability = 1;
+ pci_read_config_byte(pdev, 0x41, &bus_cap);
+ if (bus_cap & 0x80) {
+ dbg("bus max supports 133MHz PCI-X\n");
+ ctrl->speed_capability = PCI_SPEED_133MHz_PCIX;
+ break;
+ }
+ if (bus_cap & 0x40) {
+ dbg("bus max supports 100MHz PCI-X\n");
+ ctrl->speed_capability = PCI_SPEED_100MHz_PCIX;
+ break;
+ }
+ if (bus_cap & 20) {
+ dbg("bus max supports 66MHz PCI-X\n");
+ ctrl->speed_capability = PCI_SPEED_66MHz_PCIX;
+ break;
+ }
+ if (bus_cap & 10) {
+ dbg("bus max supports 66MHz PCI\n");
+ ctrl->speed_capability = PCI_SPEED_66MHz;
+ break;
+ }
+
+ break;
+ }
+
switch (subsystem_deviceid) {
case PCI_SUB_HPC_ID:
/* Original 6500/7000 implementation */
@@ -933,8 +970,18 @@
ctrl->pcix_support = 0; // PCI-X not supported
ctrl->pcix_speed_capability = 0; // N/A since PCI-X not supported
break;
+ case PCI_SUB_HPC_ID4:
+ /* First PCI-X implementation, 100MHz */
+ ctrl->push_flag = 1;
+ ctrl->slot_switch_type = 1; // Switch is present
+ ctrl->speed_capability = PCI_SPEED_100MHz_PCIX;
+ ctrl->push_button = 1; // Pushbutton is present
+ ctrl->pci_config_space = 1; // Index/data access to working registers 0 = not supported, 1 = supported
+ ctrl->defeature_PHP = 1; // PHP is supported
+ ctrl->pcix_support = 1; // PCI-X supported
+ ctrl->pcix_speed_capability = 0;
+ break;
default:
- // TODO: Add SSIDs for CPQ systems that support PCI-X
err(msg_HPC_not_supported);
rc = -ENODEV;
goto err_free_ctrl;
@@ -1023,7 +1070,7 @@
info("Initializing the PCI hot plug controller residing on PCI bus %d\n", pdev->bus->number);
dbg ("Hotplug controller capabilities:\n");
- dbg (" speed_capability %s\n", ctrl->speed_capability == PCI_SPEED_33MHz ? "33MHz" : "66Mhz");
+ dbg (" speed_capability %d\n", ctrl->speed_capability);
dbg (" slot_switch_type %s\n", ctrl->slot_switch_type == 0 ? "no switch" : "switch present");
dbg (" defeature_PHP %s\n", ctrl->defeature_PHP == 0 ? "PHP not supported" : "PHP supported");
dbg (" alternate_base_address %s\n", ctrl->alternate_base_address == 0 ? "not supported" : "supported");
@@ -1066,11 +1113,9 @@
goto err_free_mem_region;
}
- // Check for 66Mhz operation
- // TODO: Add PCI-X support
+ // Check for 66Mhz and/or PCI-X operation
ctrl->speed = get_controller_speed(ctrl);
-
-
+
//**************************************************
//
// Save configuration headers for this and
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)