From 4f2c5b94b9bf101b08fa327e886b5883855f6091 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Tue, 14 Aug 2007 14:29:02 +0200 Subject: [PATCH] Added decoding of HT MSI capability. --- ChangeLog | 8 ++++++++ lspci.c | 13 ++++++++++++- tests/cap-MSI-mapping | 17 +++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 tests/cap-MSI-mapping diff --git a/ChangeLog b/ChangeLog index ca07312..72176f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-08-14 Martin Mares + + * lspci.c (show_ht): Added decoding of Hypertransport MSI mapping capability, + based on a patch by Jason Gunthorpe. + + * tests/cap-MSI-mapping: Added a test case. I plan to add test cases + (which are dumps of config space) for all new features. + 2007-06-20 Martin Mares * Released as 2.2.6. diff --git a/lspci.c b/lspci.c index 192ef57..db5a8bd 100644 --- a/lspci.c +++ b/lspci.c @@ -941,7 +941,18 @@ show_ht(struct device *d, int where, int cmd) printf("HyperTransport: Address Mapping\n"); break; case PCI_HT_CMD_TYP_MSIM: - printf("HyperTransport: MSI Mapping\n"); + printf("HyperTransport: MSI Mapping Enable%c Fixed%c\n", + FLAG(cmd, PCI_HT_MSIM_CMD_EN), + FLAG(cmd, PCI_HT_MSIM_CMD_FIXD)); + if (verbose >= 2 && !(cmd & PCI_HT_MSIM_CMD_FIXD)) + { + u32 offl, offh; + if (!config_fetch(d, where + PCI_HT_MSIM_ADDR_LO, 8)) + break; + offl = get_conf_long(d, where + PCI_HT_MSIM_ADDR_LO); + offh = get_conf_long(d, where + PCI_HT_MSIM_ADDR_HI); + printf("\t\tMapping Address Base: %016llx\n", ((unsigned long long)offh << 32) | (offl & ~0xfffff)); + } break; case PCI_HT_CMD_TYP_DR: printf("HyperTransport: DirectRoute\n"); diff --git a/tests/cap-MSI-mapping b/tests/cap-MSI-mapping new file mode 100644 index 0000000..30bd01d --- /dev/null +++ b/tests/cap-MSI-mapping @@ -0,0 +1,17 @@ +0a:01.0 PCI bridge: Broadcom HT2100 PCI-Express Bridge (rev a2) (prog-if 01 [Subtractive decode]) +00: 66 11 40 01 47 00 10 00 a2 01 04 06 40 00 01 00 +10: 00 00 00 00 00 00 00 00 0a 0b 0b 00 51 51 00 20 +20: 60 ff 60 ff f1 ff 01 00 ff ff ff ff 00 00 00 00 +30: 00 00 00 00 a0 00 00 00 00 00 00 00 00 01 01 00 +40: 00 00 00 00 01 00 01 00 01 00 00 00 00 00 01 00 +50: 08 00 a1 00 20 00 11 11 40 00 11 77 40 05 75 00 +60: 02 00 75 00 00 00 00 00 00 00 00 00 0c 05 03 03 +70: 00 00 00 00 00 00 00 00 0d 50 00 00 00 00 00 00 +80: 05 78 82 00 00 00 00 00 00 00 00 00 00 00 00 00 +90: 00 00 00 00 00 00 00 00 01 80 03 c8 08 00 00 00 +a0: 08 b0 01 a8 00 00 e0 fe 0f 00 00 00 00 00 00 00 +b0: 10 98 41 00 02 80 00 00 10 08 00 00 01 6d 1a 01 +c0: 08 00 81 20 00 00 08 00 c0 03 48 01 00 00 00 00 +d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +f0: 01 00 08 01 00 00 00 00 00 00 00 00 00 00 00 03 -- 2.39.2