From 96e4f295b9c241e41cb89e2e4e80b0a9d84081f2 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 15 Jul 1998 20:37:09 +0000 Subject: [PATCH] Verbose display of CardBus bridge headers (type 2) added. Requires I've just commited. --- ChangeLog | 10 +++++++ README | 5 +--- lspci.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++------ pciutils.h | 4 +-- 4 files changed, 86 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 869415c..358ee48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Wed Jul 15 15:37:21 1998 Martin Mares + + * 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 * Released as 1.06. diff --git a/README b/README index 2307c26..3faa01c 100644 --- 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 @@ -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 41a7e01..7517896 100644 --- 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 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; diff --git a/pciutils.h b/pciutils.h index 347289c..666dafe 100644 --- a/pciutils.h +++ b/pciutils.h @@ -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" -- 2.39.2