]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
Verbose display of CardBus bridge headers (type 2) added. Requires <linux/pci.h>
authorMartin Mares <mj@ucw.cz>
Wed, 15 Jul 1998 20:37:09 +0000 (20:37 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 5 May 2006 12:09:54 +0000 (14:09 +0200)
I've just commited.

ChangeLog
README
lspci.c
pciutils.h

index 869415c7c6c84ed892e1177a3c263fd5ee230a6a..358ee4825383166982cdff337a29f84b5d51a96b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Wed Jul 15 15:37:21 1998  Martin Mares  <mj@albireo.ucw.cz>
+
+       * lspci.c (show_htype2 etc.): Displaying of CardBus headers.
+       (show_bases): Honor the `cnt' argument.
+       (grow_tree): Parse CardBus headers in tree mode as well.
+
+       * pci.h: Updated CardBus header field description. I still don't
+       have the CardBus standard available, but OZ6832 specs contain
+       full description of all header fields supported by the chip.
+
 Tue Jun  9 22:53:59 1998  Martin Mares  <mj@albireo.ucw.cz>
 
        * Released as 1.06.
diff --git a/README b/README
index 2307c2608b2b03eb2cb63c91a1034bb45debe935..3faa01c53b1d621900336ce8a8f41f5aa91c20bd 100644 (file)
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-This package contains the Linux PCI Utilities, version 1.06.
+This package contains the Linux PCI Utilities, version 1.07.
 
 Copyright (c) 1998 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
 
@@ -37,7 +37,4 @@ TODO:
 
        - Better displaying of IRQ's generated by both PCI and CardBus bridges.
 
-       - Full displaying of CardBus bridge configuration. (Has anyone seen
-         full specs of the CardBus bridge / header type 2?)
-
        - Subsystem vendor and device ID?
diff --git a/lspci.c b/lspci.c
index 41a7e01c23dd7c5a3759b4e11e3ea2fe48ebe4a1..7517896aada3e15855cc144300f219611bb1c084 100644 (file)
--- a/lspci.c
+++ b/lspci.c
@@ -1,5 +1,5 @@
 /*
- *     $Id: lspci.c,v 1.12 1998/06/08 07:54:37 mj Exp $
+ *     $Id: lspci.c,v 1.13 1998/07/15 20:37:12 mj Exp $
  *
  *     Linux PCI Utilities -- List All PCI Devices
  *
@@ -262,7 +262,7 @@ show_bases(struct device *d, int cnt)
   word cmd = get_conf_word(d, PCI_COMMAND);
   int i;
 
-  for(i=0; i<6; i++)
+  for(i=0; i<cnt; i++)
     {
       unsigned long pos;
       unsigned int flg = get_conf_long(d, PCI_BASE_ADDRESS_0 + 4*i);
@@ -410,6 +410,59 @@ show_htype1(struct device *d)
 static void
 show_htype2(struct device *d)
 {
+  int i;
+  word cmd = get_conf_word(d, PCI_COMMAND);
+  word brc = get_conf_word(d, PCI_CB_BRIDGE_CONTROL);
+  word exca = get_conf_word(d, PCI_CB_LEGACY_MODE_BASE);
+
+  show_bases(d, 1);
+  printf("\tBus: primary=%02x, secondary=%02x, subordinate=%02x, sec-latency=%d\n",
+        get_conf_byte(d, PCI_CB_PRIMARY_BUS),
+        get_conf_byte(d, PCI_CB_CARD_BUS),
+        get_conf_byte(d, PCI_CB_SUBORDINATE_BUS),
+        get_conf_byte(d, PCI_CB_LATENCY_TIMER));
+  for(i=0; i<2; i++)
+    {
+      int p = 8*i;
+      u32 base = get_conf_long(d, PCI_CB_MEMORY_BASE_0 + p);
+      u32 limit = get_conf_long(d, PCI_CB_MEMORY_LIMIT_0 + p);
+      if (limit > base)
+       printf("Memory window %d: %08x-%08x%s%s\n", i, base, limit,
+              (cmd & PCI_COMMAND_MEMORY) ? "" : " [disabled]",
+              (brc & (PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 << i)) ? " (prefetchable)" : "");
+    }
+  for(i=0; i<2; i++)
+    {
+      int p = 8*i;
+      u32 base = get_conf_long(d, PCI_CB_IO_BASE_0 + p);
+      u32 limit = get_conf_long(d, PCI_CB_IO_LIMIT_0 + p);
+      if (!(base & PCI_IO_RANGE_TYPE_32))
+       {
+         base &= 0xffff;
+         limit &= 0xffff;
+       }
+      base &= PCI_CB_IO_RANGE_MASK;
+      if (!base)
+       continue;
+      limit = (limit & PCI_CB_IO_RANGE_MASK) + 3;
+      printf("I/O window %d: %08x-%08x%s\n", i, base, limit,
+            (cmd & PCI_COMMAND_IO) ? "" : " [disabled]");
+    }
+
+  if (get_conf_word(d, PCI_CB_SEC_STATUS) & PCI_STATUS_SIG_SYSTEM_ERROR)
+    printf("\tSecondary status: SERR\n");
+  if (verbose > 1)
+    printf("\tBridgeCtl: Parity%c SERR%c ISA%c VGA%c MAbort%c >Reset%c 16bInt%c PostWrite%c\n",
+          (brc & PCI_CB_BRIDGE_CTL_PARITY) ? '+' : '-',
+          (brc & PCI_CB_BRIDGE_CTL_SERR) ? '+' : '-',
+          (brc & PCI_CB_BRIDGE_CTL_ISA) ? '+' : '-',
+          (brc & PCI_CB_BRIDGE_CTL_VGA) ? '+' : '-',
+          (brc & PCI_CB_BRIDGE_CTL_MASTER_ABORT) ? '+' : '-',
+          (brc & PCI_CB_BRIDGE_CTL_CB_RESET) ? '+' : '-',
+          (brc & PCI_CB_BRIDGE_CTL_16BIT_INT) ? '+' : '-',
+          (brc & PCI_CB_BRIDGE_CTL_POST_WRITES) ? '+' : '-');
+  if (exca)
+    printf("\t16-bit legacy interface ports at %04x\n", exca);
 }
 
 static void
@@ -453,8 +506,9 @@ show_verbose(struct device *d)
     case PCI_HEADER_TYPE_CARDBUS:
       if ((class >> 8) != PCI_BASE_CLASS_BRIDGE)
        goto badhdr;
-      irq = int_line = int_pin = min_gnt = max_lat = 0;
-      subsys_v = subsys_d = 0;
+      min_gnt = max_lat = 0;
+      subsys_v = get_conf_word(d, PCI_CB_SUBSYSTEM_VENDOR_ID);
+      subsys_d = get_conf_word(d, PCI_CB_SUBSYSTEM_ID);
       break;
     default:
       printf("\t!!! Unknown header type %02x\n", htype);
@@ -704,12 +758,23 @@ grow_tree(void)
   for(d=first_dev; d; d=d->next)
     {
       word class = get_conf_word(d, PCI_CLASS_DEVICE);
-      if (class == PCI_CLASS_BRIDGE_PCI && (get_conf_byte(d, PCI_HEADER_TYPE) & 0x7f) == 1)
+      byte ht = get_conf_byte(d, PCI_HEADER_TYPE) & 0x7f;
+      if (class == PCI_CLASS_BRIDGE_PCI &&
+         (ht == PCI_HEADER_TYPE_BRIDGE || ht == PCI_HEADER_TYPE_CARDBUS))
        {
          b = xmalloc(sizeof(struct bridge));
-         b->primary = get_conf_byte(d, PCI_PRIMARY_BUS);
-         b->secondary = get_conf_byte(d, PCI_SECONDARY_BUS);
-         b->subordinate = get_conf_byte(d, PCI_SUBORDINATE_BUS);
+         if (ht == PCI_HEADER_TYPE_BRIDGE)
+           {
+             b->primary = get_conf_byte(d, PCI_CB_PRIMARY_BUS);
+             b->secondary = get_conf_byte(d, PCI_CB_CARD_BUS);
+             b->subordinate = get_conf_byte(d, PCI_CB_SUBORDINATE_BUS);
+           }
+         else
+           {
+             b->primary = get_conf_byte(d, PCI_PRIMARY_BUS);
+             b->secondary = get_conf_byte(d, PCI_SECONDARY_BUS);
+             b->subordinate = get_conf_byte(d, PCI_SUBORDINATE_BUS);
+           }
          *last_br = b;
          last_br = &b->chain;
          b->next = b->child = NULL;
index 347289cb3ce9ac78f27e3c99e37135f3a64a7fd1..666dafe558b4fd9ffc225bc85ca4a04e1968ca86 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     $Id: pciutils.h,v 1.6 1998/06/12 09:48:36 mj Exp $
+ *     $Id: pciutils.h,v 1.7 1998/07/15 20:37:15 mj Exp $
  *
  *     Linux PCI Utilities -- Declarations
  *
@@ -16,7 +16,7 @@
 #include "pci.h"
 #endif
 
-#define PCIUTILS_VERSION "1.06"
+#define PCIUTILS_VERSION "1.07"
 
 #define PROC_BUS_PCI "/proc/bus/pci"
 #define ETC_PCI_IDS "/etc/pci.ids"