Enhancing /proc/pci

- Adding missing fields for PCI device lookup
 - Adding the domain (for now set to zero) as part of the slot name

Change-Id: Iebaf3b21f6ab5024738cbc1dea66d5ad3ada175d
This commit is contained in:
Lionel Sambuc 2014-10-17 18:33:00 +02:00
parent 5d8311761a
commit 9e77ef5013
3 changed files with 11 additions and 7 deletions

View file

@ -208,7 +208,7 @@ start|autoboot)
then then
up -n printer -dev /dev/lp -period 10HZ up -n printer -dev /dev/lp -period 10HZ
# start VirtualBox time sync driver if the device is there # start VirtualBox time sync driver if the device is there
if grep '^[^ ]* [^ ]* 80EE:CAFE ' /proc/pci >/dev/null; then if grep '^[^ ]* [^ ]* 80EE:CAFE[^ ]* ' /proc/pci >/dev/null; then
up -n vbox -period 10HZ up -n vbox -period 10HZ
fi fi
fi fi

View file

@ -25,7 +25,7 @@ then if [ -e $ACPI -a -n "`sysenv acpi`" ]
# If not specified, default to yes if the device is found. # If not specified, default to yes if the device is found.
if /bin/sysenv virtio_blk >/dev/null if /bin/sysenv virtio_blk >/dev/null
then virtio_blk="`/bin/sysenv virtio_blk`" then virtio_blk="`/bin/sysenv virtio_blk`"
elif grep '^[^ ]* [^ ]* 1AF4:1001 ' /proc/pci >/dev/null elif grep '^[^ ]* [^ ]* 1AF4:1001[^ ]* ' /proc/pci >/dev/null
then echo "virtio_blk not set, defaulting to using found virtio device." then echo "virtio_blk not set, defaulting to using found virtio device."
virtio_blk=yes virtio_blk=yes
fi fi

View file

@ -127,8 +127,8 @@ static void root_pci(void)
{ {
/* Print information about PCI devices present in the system. /* Print information about PCI devices present in the system.
*/ */
u16_t vid, did; u16_t vid, did, subvid, subdid;
u8_t bcr, scr, pifr; u8_t bcr, scr, pifr, rev;
char *slot_name, *dev_name; char *slot_name, *dev_name;
int r, devind; int r, devind;
static int first = TRUE; static int first = TRUE;
@ -148,10 +148,14 @@ static void root_pci(void)
bcr = pci_attr_r8(devind, PCI_BCR); bcr = pci_attr_r8(devind, PCI_BCR);
scr = pci_attr_r8(devind, PCI_SCR); scr = pci_attr_r8(devind, PCI_SCR);
pifr = pci_attr_r8(devind, PCI_PIFR); pifr = pci_attr_r8(devind, PCI_PIFR);
rev = pci_attr_r8(devind, PCI_REV);
subvid = pci_attr_r16(devind, PCI_SUBVID);
subdid = pci_attr_r16(devind, PCI_SUBDID);
buf_printf("%s %x/%x/%x %04X:%04X %s\n", buf_printf("%s %x/%x/%x/%x %04X:%04X:%04X:%04X %s\n",
slot_name ? slot_name : "-", slot_name ? slot_name : "-1.-1.-1.-1",
bcr, scr, pifr, vid, did, bcr, scr, pifr, rev,
vid, did, subvid, subdid,
dev_name ? dev_name : ""); dev_name ? dev_name : "");
r = pci_next_dev(&devind, &vid, &did); r = pci_next_dev(&devind, &vid, &did);