X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lspci.c;h=943c1cdc71066fb12bff247fd87db29b9b6560c0;hb=087e22e7bfdfc3eb0664ac9cca571c3858d838c9;hp=dec904d4ccbdc5c840e5633197fae904c4cecb30;hpb=ec25b52dd43e5fc877f6a04e920ac862afe66b16;p=pciutils.git diff --git a/lspci.c b/lspci.c index dec904d..943c1cd 100644 --- a/lspci.c +++ b/lspci.c @@ -573,21 +573,34 @@ show_ht_pri(struct device *d, int where, int cmd) { u16 lctr0, lcnf0, lctr1, lcnf1, eh; u8 rid, lfrer0, lfcap0, ftr, lfrer1, lfcap1, mbu, mlu, bn; + char *fmt; printf("HyperTransport: Slave or Primary Interface\n"); if (verbose < 2) return; - printf("\t\tCommand: BaseUnitID=%u UnitCnt=%u MastHost%c DefDir%c DUL%c\n", + if (!config_fetch(d, where + PCI_HT_PRI_LCTR0, PCI_HT_PRI_SIZEOF - PCI_HT_PRI_LCTR0)) + return; + rid = get_conf_byte(d, where + PCI_HT_PRI_RID); + if (rid < 0x23 && rid > 0x11) + printf("\t!!! Possibly incomplete decoding\n"); + + if (rid >= 0x23) + fmt = "\t\tCommand: BaseUnitID=%u UnitCnt=%u MastHost%c DefDir%c DUL%c\n"; + else + fmt = "\t\tCommand: BaseUnitID=%u UnitCnt=%u MastHost%c DefDir%c\n"; + printf(fmt, (cmd & PCI_HT_PRI_CMD_BUID), (cmd & PCI_HT_PRI_CMD_UC) >> 5, FLAG(cmd, PCI_HT_PRI_CMD_MH), FLAG(cmd, PCI_HT_PRI_CMD_DD), FLAG(cmd, PCI_HT_PRI_CMD_DUL)); - if (!config_fetch(d, where + PCI_HT_PRI_LCTR0, PCI_HT_PRI_SIZEOF - PCI_HT_PRI_LCTR0)) - return; lctr0 = get_conf_word(d, where + PCI_HT_PRI_LCTR0); - printf("\t\tLink Control 0: CFlE%c CST%c CFE%c = 0x23) + fmt = "\t\tLink Control 0: CFlE%c CST%c CFE%c = 0x23) + fmt = "\t\tLink Config 0: MLWI=%1$s DwFcIn%5$c MLWO=%2$s DwFcOut%6$c LWI=%3$s DwFcInEn%7$c LWO=%4$s DwFcOutEn%8$c\n"; + else + fmt = "\t\tLink Config 0: MLWI=%s MLWO=%s LWI=%s LWO=%s\n"; + printf(fmt, ht_link_width(lcnf0 & PCI_HT_LCNF_MLWI), - FLAG(lcnf0, PCI_HT_LCNF_DFI), ht_link_width((lcnf0 & PCI_HT_LCNF_MLWO) >> 4), - FLAG(lcnf0, PCI_HT_LCNF_DFO), ht_link_width((lcnf0 & PCI_HT_LCNF_LWI) >> 8), - FLAG(lcnf0, PCI_HT_LCNF_DFIE), ht_link_width((lcnf0 & PCI_HT_LCNF_LWO) >> 12), + FLAG(lcnf0, PCI_HT_LCNF_DFI), + FLAG(lcnf0, PCI_HT_LCNF_DFO), + FLAG(lcnf0, PCI_HT_LCNF_DFIE), FLAG(lcnf0, PCI_HT_LCNF_DFOE)); lctr1 = get_conf_word(d, where + PCI_HT_PRI_LCTR1); - printf("\t\tLink Control 1: CFlE%c CST%c CFE%c = 0x23) + fmt = "\t\tLink Control 1: CFlE%c CST%c CFE%c = 0x23) + fmt = "\t\tLink Config 1: MLWI=%1$s DwFcIn%5$c MLWO=%2$s DwFcOut%6$c LWI=%3$s DwFcInEn%7$c LWO=%4$s DwFcOutEn%8$c\n"; + else + fmt = "\t\tLink Config 1: MLWI=%s MLWO=%s LWI=%s LWO=%s\n"; + printf(fmt, ht_link_width(lcnf1 & PCI_HT_LCNF_MLWI), - FLAG(lcnf1, PCI_HT_LCNF_DFI), ht_link_width((lcnf1 & PCI_HT_LCNF_MLWO) >> 4), - FLAG(lcnf1, PCI_HT_LCNF_DFO), ht_link_width((lcnf1 & PCI_HT_LCNF_LWI) >> 8), - FLAG(lcnf1, PCI_HT_LCNF_DFIE), ht_link_width((lcnf1 & PCI_HT_LCNF_LWO) >> 12), + FLAG(lcnf1, PCI_HT_LCNF_DFI), + FLAG(lcnf1, PCI_HT_LCNF_DFO), + FLAG(lcnf1, PCI_HT_LCNF_DFIE), FLAG(lcnf1, PCI_HT_LCNF_DFOE)); - rid = get_conf_byte(d, where + PCI_HT_PRI_RID); printf("\t\tRevision ID: %u.%02u\n", (rid & PCI_HT_RID_MAJ) >> 5, (rid & PCI_HT_RID_MIN)); + if (rid < 0x23) + return; lfrer0 = get_conf_byte(d, where + PCI_HT_PRI_LFRER0); printf("\t\tLink Frequency 0: %s\n", ht_link_freq(lfrer0 & PCI_HT_LFRER_FREQ)); printf("\t\tLink Error 0: 0x11) + printf("\t!!! Possibly incomplete decoding\n"); + + if (rid >= 0x23) + fmt = "\t\tCommand: WarmRst%c DblEnd%c DevNum=%u ChainSide%c HostHide%c Slave%c > 2, @@ -729,10 +766,12 @@ show_ht_sec(struct device *d, int where, int cmd) FLAG(cmd, PCI_HT_SEC_CMD_AS), FLAG(cmd, PCI_HT_SEC_CMD_HIECE), FLAG(cmd, PCI_HT_SEC_CMD_DUL)); - if (!config_fetch(d, where + PCI_HT_SEC_LCTR, PCI_HT_SEC_SIZEOF - PCI_HT_SEC_LCTR)) - return; lctr = get_conf_word(d, where + PCI_HT_SEC_LCTR); - printf("\t\tLink Control: CFlE%c CST%c CFE%c = 0x23) + fmt = "\t\tLink Control: CFlE%c CST%c CFE%c = 0x23) + fmt = "\t\tLink Config: MLWI=%1$s DwFcIn%5$c MLWO=%2$s DwFcOut%6$c LWI=%3$s DwFcInEn%7$c LWO=%4$s DwFcOutEn%8$c\n"; + else + fmt = "\t\tLink Config: MLWI=%s MLWO=%s LWI=%s LWO=%s\n"; + printf(fmt, ht_link_width(lcnf & PCI_HT_LCNF_MLWI), - FLAG(lcnf, PCI_HT_LCNF_DFI), ht_link_width((lcnf & PCI_HT_LCNF_MLWO) >> 4), - FLAG(lcnf, PCI_HT_LCNF_DFO), ht_link_width((lcnf & PCI_HT_LCNF_LWI) >> 8), - FLAG(lcnf, PCI_HT_LCNF_DFIE), ht_link_width((lcnf & PCI_HT_LCNF_LWO) >> 12), + FLAG(lcnf, PCI_HT_LCNF_DFI), + FLAG(lcnf, PCI_HT_LCNF_DFO), + FLAG(lcnf, PCI_HT_LCNF_DFIE), FLAG(lcnf, PCI_HT_LCNF_DFOE)); - rid = get_conf_byte(d, where + PCI_HT_SEC_RID); printf("\t\tRevision ID: %u.%02u\n", (rid & PCI_HT_RID_MAJ) >> 5, (rid & PCI_HT_RID_MIN)); + if (rid < 0x23) + return; lfrer = get_conf_byte(d, where + PCI_HT_SEC_LFRER); printf("\t\tLink Frequency: %s\n", ht_link_freq(lfrer & PCI_HT_LFRER_FREQ)); printf("\t\tLink Error: dev; pciaddr_t rom = p->rom_base_addr; pciaddr_t len = (p->known_fields & PCI_FILL_SIZES) ? p->rom_size : 0; + u32 flg = get_conf_long(d, reg); + word cmd = get_conf_word(d, PCI_COMMAND); - if (!rom && !len) + if (!rom && !flg && !len) return; - printf("\tExpansion ROM at "); + putchar('\t'); + if ((rom & PCI_ROM_ADDRESS_MASK) && !(flg & PCI_ROM_ADDRESS_MASK)) + { + printf("[virtual] "); + flg = rom; + } + printf("Expansion ROM at "); if (rom & PCI_ROM_ADDRESS_MASK) printf(PCIADDR_T_FMT, rom & PCI_ROM_ADDRESS_MASK); + else if (flg & PCI_ROM_ADDRESS_MASK) + printf(""); else printf(""); - if (!(rom & PCI_ROM_ADDRESS_ENABLE)) + if (!(flg & PCI_ROM_ADDRESS_ENABLE)) printf(" [disabled]"); + else if (!(cmd & PCI_COMMAND_MEMORY)) + printf(" [disabled by cmd]"); show_size(len); putchar('\n'); } @@ -1319,7 +1375,7 @@ static void show_htype0(struct device *d) { show_bases(d, 6); - show_rom(d); + show_rom(d, PCI_ROM_ADDRESS); show_caps(d); } @@ -1407,7 +1463,7 @@ show_htype1(struct device *d) FLAG(sec_stat, PCI_STATUS_SIG_SYSTEM_ERROR), FLAG(sec_stat, PCI_STATUS_DETECTED_PARITY)); - show_rom(d); + show_rom(d, PCI_ROM_ADDRESS1); if (verbose > 1) printf("\tBridgeCtl: Parity%c SERR%c NoISA%c VGA%c MAbort%c >Reset%c FastB2B%c\n",