Felix Singer has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/46347 )
Change subject: libpayload/libpci: Store device class in pci_dev ......................................................................
libpayload/libpci: Store device class in pci_dev
Change-Id: I5d56be96f3f0da471246f031ea619e3df8e54cfb Signed-off-by: Felix Singer felix.singer@secunet.com --- M payloads/libpayload/include/pci/pci.h M payloads/libpayload/libpci/libpci.c 2 files changed, 2 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/47/46347/1
diff --git a/payloads/libpayload/include/pci/pci.h b/payloads/libpayload/include/pci/pci.h index 37aeafa..ea11a05 100644 --- a/payloads/libpayload/include/pci/pci.h +++ b/payloads/libpayload/include/pci/pci.h @@ -74,6 +74,7 @@ u16 domain; u8 bus, dev, func; u16 vendor_id, device_id; + u16 device_class; struct pci_dev *parent; struct pci_dev *next; }; diff --git a/payloads/libpayload/libpci/libpci.c b/payloads/libpayload/libpci/libpci.c index 50cd228..b8188a1 100644 --- a/payloads/libpayload/libpci/libpci.c +++ b/payloads/libpayload/libpci/libpci.c @@ -182,6 +182,7 @@ dev->func = func; dev->vendor_id = val & 0xffff; dev->device_id = (uint16_t)(val >> 16); + dev->device_class = pci_read_config16(PCI_DEV(bus, slot, func), 0xa); dev->next = 0;
hdr = pci_read_config8(PCI_DEV(bus, slot, func),
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46347 )
Change subject: libpayload/libpci: Store device class in pci_dev ......................................................................
Patch Set 1: Code-Review+1
Hello build bot (Jenkins), Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46347
to look at the new patch set (#2).
Change subject: libpayload/libpci: Store device class in pci_dev ......................................................................
libpayload/libpci: Store device class in pci_dev
Change-Id: I5d56be96f3f0da471246f031ea619e3df8e54cfb Signed-off-by: Felix Singer felix.singer@secunet.com --- M payloads/libpayload/include/pci/pci.h M payloads/libpayload/libpci/libpci.c 2 files changed, 2 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/47/46347/2
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46347 )
Change subject: libpayload/libpci: Store device class in pci_dev ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/46347/2/payloads/libpayload/libpci/... File payloads/libpayload/libpci/libpci.c:
https://review.coreboot.org/c/coreboot/+/46347/2/payloads/libpayload/libpci/... PS2, Line 185: dev->device_class = pci_read_config16(PCI_DEV(bus, slot, func), PCI_CLASS_DEVICE); line over 96 characters
Felix Singer has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46347 )
Change subject: libpayload/libpci: Introduce device class attribute in pci_dev ......................................................................
Set Ready For Review
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46347 )
Change subject: libpayload/libpci: Introduce device class attribute in pci_dev ......................................................................
Patch Set 6: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/46347/6//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/46347/6//COMMIT_MSG@10 PS6, Line 10: preperation preparation
Hello build bot (Jenkins), Nico Huber, Angel Pons, Michael Niewöhner,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46347
to look at the new patch set (#7).
Change subject: libpayload/libpci: Introduce device class attribute in pci_dev ......................................................................
libpayload/libpci: Introduce device class attribute in pci_dev
The device class is read at different places and it is read from the hardware directly. Therefore, and in preparation to CB:46416, introduce the device class attribute in the pci_dev struct. With this, there is only one interaction with the hardware and it's also more user friendly.
Change-Id: I5d56be96f3f0da471246f031ea619e3df8e54cfb Signed-off-by: Felix Singer felix.singer@secunet.com --- M payloads/libpayload/include/pci/pci.h M payloads/libpayload/libpci/libpci.c 2 files changed, 2 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/47/46347/7
Felix Singer has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46347 )
Change subject: libpayload/libpci: Introduce device class attribute in pci_dev ......................................................................
Patch Set 7:
(1 comment)
https://review.coreboot.org/c/coreboot/+/46347/6//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/46347/6//COMMIT_MSG@10 PS6, Line 10: preperation
preparation
Done
Nico Huber has submitted this change. ( https://review.coreboot.org/c/coreboot/+/46347 )
Change subject: libpayload/libpci: Introduce device class attribute in pci_dev ......................................................................
libpayload/libpci: Introduce device class attribute in pci_dev
The device class is read at different places and it is read from the hardware directly. Therefore, and in preparation to CB:46416, introduce the device class attribute in the pci_dev struct. With this, there is only one interaction with the hardware and it's also more user friendly.
Change-Id: I5d56be96f3f0da471246f031ea619e3df8e54cfb Signed-off-by: Felix Singer felix.singer@secunet.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/46347 Reviewed-by: Nico Huber nico.h@gmx.de Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M payloads/libpayload/include/pci/pci.h M payloads/libpayload/libpci/libpci.c 2 files changed, 2 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved
diff --git a/payloads/libpayload/include/pci/pci.h b/payloads/libpayload/include/pci/pci.h index 8c11d6b..7ec9491 100644 --- a/payloads/libpayload/include/pci/pci.h +++ b/payloads/libpayload/include/pci/pci.h @@ -74,6 +74,7 @@ u16 domain; u8 bus, dev, func; u16 vendor_id, device_id; + u16 device_class; struct pci_dev *next; };
diff --git a/payloads/libpayload/libpci/libpci.c b/payloads/libpayload/libpci/libpci.c index 3e3513c..200ae18 100644 --- a/payloads/libpayload/libpci/libpci.c +++ b/payloads/libpayload/libpci/libpci.c @@ -178,6 +178,7 @@ dev->func = func; dev->vendor_id = val & 0xffff; dev->device_id = (uint16_t)(val >> 16); + dev->device_class = pci_read_config16(PCI_DEV(bus, slot, func), PCI_CLASS_DEVICE); dev->next = 0;
hdr = pci_read_config8(PCI_DEV(bus, slot, func),