Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32308
Change subject: [WIP]smbios: Walk over PCI devicetree to fill type 9 ......................................................................
[WIP]smbios: Walk over PCI devicetree to fill type 9
Use the devicetree values for type 9 slots.
Change-Id: I1961d8af2d21f755ff52ad58804ea9b31d2a5b9b Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/arch/x86/smbios.c 1 file changed, 13 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/08/32308/1
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 10feb15..c565462 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -996,6 +996,19 @@ dev_name(dev)); len += dev->ops->get_smbios_data(dev, handle, current); } + if (dev->path.type == DEVICE_PATH_PCI) { + if (dev->smbios_slot_type || + dev->smbios_slot_data_width || + dev->smbios_slot_designation) { + len += smbios_write_type9(current, handle, + dev->smbios_slot_designation, + dev->smbios_slot_type, + 1, + 0, + dev->bus->secondary, + dev->path.pci.devfn); + } + } } return len; }
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32308
to look at the new patch set (#3).
Change subject: [WIP]smbios: Walk over PCI devicetree to fill type 9 ......................................................................
[WIP]smbios: Walk over PCI devicetree to fill type 9
Use the devicetree values for type 9 slots.
Tested on Lenovo T520.
Change-Id: I1961d8af2d21f755ff52ad58804ea9b31d2a5b9b Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/arch/x86/smbios.c 1 file changed, 46 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/08/32308/3
Lijian Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32308 )
Change subject: [WIP]smbios: Walk over PCI devicetree to fill type 9 ......................................................................
Patch Set 3: Code-Review+1
Hello Lijian Zhao, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32308
to look at the new patch set (#4).
Change subject: smbios: Walk over PCI devicetree to fill type 9 ......................................................................
smbios: Walk over PCI devicetree to fill type 9
Use the devicetree values for type 9 slots.
Tested on Lenovo T520.
Change-Id: I1961d8af2d21f755ff52ad58804ea9b31d2a5b9b Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/arch/x86/smbios.c 1 file changed, 44 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/08/32308/4
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32308 )
Change subject: smbios: Walk over PCI devicetree to fill type 9 ......................................................................
Patch Set 4: Code-Review+1
Does this have a noticeable effect on the boot time?
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32308 )
Change subject: smbios: Walk over PCI devicetree to fill type 9 ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/#/c/32308/4/src/arch/x86/smbios.c File src/arch/x86/smbios.c:
https://review.coreboot.org/#/c/32308/4/src/arch/x86/smbios.c@1057 PS4, Line 1057: dev->path.pci.devfn); Maybe move it into its own function? You'd just call it here with `current`, `handle` and `dev` and a `continue;` would become an early `return;`.
Hello Paul Menzel, build bot (Jenkins), Lijian Zhao,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32308
to look at the new patch set (#5).
Change subject: smbios: Walk over PCI devicetree to fill type 9 ......................................................................
smbios: Walk over PCI devicetree to fill type 9
Use the devicetree values for type 9 slots.
Tested on Lenovo T520.
Change-Id: I1961d8af2d21f755ff52ad58804ea9b31d2a5b9b Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/arch/x86/smbios.c 1 file changed, 51 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/08/32308/5
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32308 )
Change subject: smbios: Walk over PCI devicetree to fill type 9 ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/#/c/32308/4/src/arch/x86/smbios.c File src/arch/x86/smbios.c:
https://review.coreboot.org/#/c/32308/4/src/arch/x86/smbios.c@1057 PS4, Line 1057: dev->path.pci.devfn);
Maybe move it into its own function? You'd just call it here with […]
Done
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32308 )
Change subject: smbios: Walk over PCI devicetree to fill type 9 ......................................................................
Patch Set 5: Code-Review+1
Philipp Deppenwiese has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32308 )
Change subject: smbios: Walk over PCI devicetree to fill type 9 ......................................................................
Patch Set 5: Code-Review+2
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/32308 )
Change subject: smbios: Walk over PCI devicetree to fill type 9 ......................................................................
smbios: Walk over PCI devicetree to fill type 9
Use the devicetree values for type 9 slots.
Tested on Lenovo T520.
Change-Id: I1961d8af2d21f755ff52ad58804ea9b31d2a5b9b Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/32308 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: HAOUAS Elyes ehaouas@noos.fr Reviewed-by: Philipp Deppenwiese zaolin.daisuki@gmail.com --- M src/arch/x86/smbios.c 1 file changed, 51 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Philipp Deppenwiese: Looks good to me, approved HAOUAS Elyes: Looks good to me, but someone else must approve
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 7c87c69..589f4f0 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -999,6 +999,56 @@ return len; }
+/* Generate Type9 entries from devicetree */ +static int smbios_walk_device_tree_type9(struct device *dev, int *handle, + unsigned long *current) +{ + enum misc_slot_usage usage; + enum slot_data_bus_bandwidth bandwidth; + enum misc_slot_type type; + enum misc_slot_length length; + + if (dev->path.type != DEVICE_PATH_PCI) + return 0; + + if (!dev->smbios_slot_type && !dev->smbios_slot_data_width && + !dev->smbios_slot_designation && !dev->smbios_slot_length) + return 0; + + if (dev_is_active_bridge(dev)) + usage = SlotUsageInUse; + else if (dev->enabled) + usage = SlotUsageAvailable; + else + usage = SlotUsageUnknown; + + if (dev->smbios_slot_data_width) + bandwidth = dev->smbios_slot_data_width; + else + bandwidth = SlotDataBusWidthUnknown; + + if (dev->smbios_slot_type) + type = dev->smbios_slot_type; + else + type = SlotTypeUnknown; + + if (dev->smbios_slot_length) + length = dev->smbios_slot_length; + else + length = SlotLengthUnknown; + + return smbios_write_type9(current, handle, + dev->smbios_slot_designation, + type, + bandwidth, + usage, + length, + 1, + 0, + dev->bus->secondary, + dev->path.pci.devfn); +} + static int smbios_walk_device_tree(struct device *tree, int *handle, unsigned long *current) { @@ -1011,6 +1061,7 @@ dev_name(dev)); len += dev->ops->get_smbios_data(dev, handle, current); } + len += smbios_walk_device_tree_type9(dev, handle, current); } return len; }