]> mj.ucw.cz Git - pciutils.git/blobdiff - lspci.c
Add device-tree node path to the verbose output
[pciutils.git] / lspci.c
diff --git a/lspci.c b/lspci.c
index 3aeaf46e4b431a0ea92117520ae392c1cb2d3b19..e207e03e366e4d4a8bd46042a4e4ef7425dfe1e3 100644 (file)
--- a/lspci.c
+++ b/lspci.c
@@ -315,6 +315,8 @@ show_terse(struct device *d)
       word subsys_v, subsys_d;
       char ssnamebuf[256];
 
+      pci_fill_info(p, PCI_FILL_LABEL);
+
       if (p->label)
         printf("\tDeviceName: %s", p->label);
       get_subid(d, &subsys_v, &subsys_d);
@@ -359,7 +361,7 @@ show_range(char *prefix, u64 base, u64 limit, int is_64bit)
 
   printf("%s: ", prefix);
   if (is_64bit)
-    printf("%016" PCI_U64_FMT "x-%016" PCI_U64_FMT "x", base, limit);
+    printf("%016" PCI_U64_FMT_X "-%016" PCI_U64_FMT_X, base, limit);
   else
     printf("%08x-%08x", (unsigned) base, (unsigned) limit);
   if (base <= limit)
@@ -393,8 +395,9 @@ show_bases(struct device *d, int cnt)
        putchar('\t');
       if (ioflg & PCI_IORESOURCE_PCI_EA_BEI)
          printf("[enhanced] ");
-      else if (pos && !flg)    /* Reported by the OS, but not by the device */
+      else if (pos && !(flg & ((flg & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK)))
        {
+         /* Reported by the OS, but not by the device */
          printf("[virtual] ");
          flg = pos;
          virtual = 1;
@@ -578,11 +581,12 @@ show_htype1(struct device *d)
 
   if (verbose > 1)
     {
-      printf("\tBridgeCtl: Parity%c SERR%c NoISA%c VGA%c MAbort%c >Reset%c FastB2B%c\n",
+      printf("\tBridgeCtl: Parity%c SERR%c NoISA%c VGA%c VGA16%c MAbort%c >Reset%c FastB2B%c\n",
        FLAG(brc, PCI_BRIDGE_CTL_PARITY),
        FLAG(brc, PCI_BRIDGE_CTL_SERR),
        FLAG(brc, PCI_BRIDGE_CTL_NO_ISA),
        FLAG(brc, PCI_BRIDGE_CTL_VGA),
+       FLAG(brc, PCI_BRIDGE_CTL_VGA_16BIT),
        FLAG(brc, PCI_BRIDGE_CTL_MASTER_ABORT),
        FLAG(brc, PCI_BRIDGE_CTL_BUS_RESET),
        FLAG(brc, PCI_BRIDGE_CTL_FAST_BACK));
@@ -682,7 +686,7 @@ show_verbose(struct device *d)
   show_terse(d);
 
   pci_fill_info(p, PCI_FILL_IRQ | PCI_FILL_BASES | PCI_FILL_ROM_BASE | PCI_FILL_SIZES |
-    PCI_FILL_PHYS_SLOT | PCI_FILL_LABEL | PCI_FILL_NUMA_NODE);
+    PCI_FILL_PHYS_SLOT | PCI_FILL_NUMA_NODE | PCI_FILL_DT_NODE);
   irq = p->irq;
 
   switch (htype)
@@ -713,6 +717,8 @@ show_verbose(struct device *d)
 
   if (verbose > 1)
     {
+      if (p->dt_node)
+        printf("\tDT Node: %s\n", p->dt_node);
       printf("\tControl: I/O%c Mem%c BusMaster%c SpecCycle%c MemWINV%c VGASnoop%c ParErr%c Stepping%c SERR%c FastB2B%c DisINTx%c\n",
             FLAG(cmd, PCI_COMMAND_IO),
             FLAG(cmd, PCI_COMMAND_MEMORY),
@@ -766,6 +772,8 @@ show_verbose(struct device *d)
     }
   else
     {
+      if (p->dt_node)
+        printf("\tDT Node: %s\n", p->dt_node);
       printf("\tFlags: ");
       if (cmd & PCI_COMMAND_MASTER)
        printf("bus master, ");
@@ -864,7 +872,7 @@ show_machine(struct device *d)
 
   if (verbose)
     {
-      pci_fill_info(p, PCI_FILL_PHYS_SLOT | PCI_FILL_NUMA_NODE);
+      pci_fill_info(p, PCI_FILL_PHYS_SLOT | PCI_FILL_NUMA_NODE | PCI_FILL_DT_NODE);
       printf((opt_machine >= 2) ? "Slot:\t" : "Device:\t");
       show_slot_name(d);
       putchar('\n');
@@ -891,6 +899,8 @@ show_machine(struct device *d)
        show_kernel_machine(d);
       if (p->numa_node != -1)
        printf("NUMANode:\t%d\n", p->numa_node);
+      if (p->dt_node)
+        printf("DTNode:\t%s\n", p->dt_node);
     }
   else
     {