diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2018-05-15 15:39:05 +1000 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2018-06-26 11:31:42 +0200 |
commit | 6d701ce33eb2a420ce196be731ddf11d2d1fcc7f (patch) | |
tree | 67bd54a4f52bae97e041eb1deb03b44b28665cf9 /lspci.c | |
parent | e7b120d034bf725fac695aa61799251a862ae994 (diff) | |
download | pciutils-6d701ce33eb2a420ce196be731ddf11d2d1fcc7f.tar.gz |
Add device-tree node path to the verbose output
Adds the path of the device-tree node of a PCI device to the lspci -v
output, like so:
0021:00:00.0 PCI bridge: IBM Device 03dc (prog-if 00 [Normal decode])
DT Node: /sys/firmware/devicetree/base/pciex@3fffe41100000/pci@0
This is added as a generic property to struct pci_device and populated
by the sysfs backend. Other platforms may find it useful though.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'lspci.c')
-rw-r--r-- | lspci.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -686,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_NUMA_NODE); + PCI_FILL_PHYS_SLOT | PCI_FILL_NUMA_NODE | PCI_FILL_DT_NODE); irq = p->irq; switch (htype) @@ -717,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), @@ -770,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, "); @@ -868,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'); @@ -895,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 { |