summaryrefslogtreecommitdiffstats
path: root/src/drivers/bus/mca.c
diff options
context:
space:
mode:
authorMichael Brown2005-04-16 12:19:13 +0200
committerMichael Brown2005-04-16 12:19:13 +0200
commite1a9798af47429a358702248513b7ebb6fbeb064 (patch)
tree51ddf3a357b1fa0b7a9a9ce79510c73644fe10dd /src/drivers/bus/mca.c
parentMade debug messages more consistent. (diff)
downloadipxe-e1a9798af47429a358702248513b7ebb6fbeb064.tar.gz
ipxe-e1a9798af47429a358702248513b7ebb6fbeb064.tar.xz
ipxe-e1a9798af47429a358702248513b7ebb6fbeb064.zip
Improved debugging output
Diffstat (limited to 'src/drivers/bus/mca.c')
-rw-r--r--src/drivers/bus/mca.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/drivers/bus/mca.c b/src/drivers/bus/mca.c
index cc091efa1..eb40fdca8 100644
--- a/src/drivers/bus/mca.c
+++ b/src/drivers/bus/mca.c
@@ -22,7 +22,7 @@ static char mca_magic[0]; /* guaranteed unique symbol */
*
*/
static int fill_mca_device ( struct mca_device *mca ) {
- unsigned int i;
+ unsigned int i, seen_non_ff;
/* Make sure motherboard setup is off */
outb_p ( 0xff, MCA_MOTHERBOARD_SETUP_REG );
@@ -31,10 +31,19 @@ static int fill_mca_device ( struct mca_device *mca ) {
outb_p ( 0x8 | ( mca->slot & 0xf ), MCA_ADAPTER_SETUP_REG );
/* Read the POS registers */
+ seen_non_ff = 0;
for ( i = 0 ; i < ( sizeof ( mca->pos ) / sizeof ( mca->pos[0] ) ) ;
i++ ) {
mca->pos[i] = inb_p ( MCA_POS_REG ( i ) );
+ if ( mca->pos[i] != 0xff )
+ seen_non_ff = 1;
}
+
+ /* If all POS registers are 0xff, this means there's no device
+ * present
+ */
+ if ( ! seen_non_ff )
+ return 0;
/* Kill all setup modes */
outb_p ( 0, MCA_ADAPTER_SETUP_REG );
@@ -64,6 +73,7 @@ int find_mca_device ( struct mca_device *mca, struct mca_driver *driver ) {
/* Iterate through all possible MCA slots, starting where we
* left off
*/
+ DBG ( "MCA searching for device matching driver %s\n", driver->name );
for ( ; mca->slot < MCA_MAX_SLOT_NR ; mca->slot++ ) {
/* If we've already used this device, skip it */
if ( mca->already_tried ) {
@@ -81,8 +91,9 @@ int find_mca_device ( struct mca_device *mca, struct mca_driver *driver ) {
struct mca_id *id = &driver->ids[i];
if ( MCA_ID ( mca ) == id->id ) {
- DBG ( "Device %s (driver %s) matches ID %hx\n",
- id->name, driver->name, id->id );
+ DBG ( "MCA found ID %hx (device %s) "
+ "matching driver %s\n",
+ id->name, id->id, driver->name );
mca->name = id->name;
mca->already_tried = 1;
return 1;
@@ -91,6 +102,7 @@ int find_mca_device ( struct mca_device *mca, struct mca_driver *driver ) {
}
/* No device found */
+ DBG ( "MCA found no device matching driver %s\n", driver->name );
mca->slot = 0;
return 0;
}