From 6a73b2466f388b34086a941572d0af7d0614da3f Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Fri, 3 Sep 2021 12:18:10 +0200 Subject: SMBIOS: Allow skipping default SMBIOS generation The call to the `get_smbios_data` device operation is followed by calls to unconditional default functions, which lacks flexibility. Instead, have devices that implement `get_smbios_data` call these default functions as needed. Most `get_smbios_data` implementations are in mainboard code, and are bound to the root device. The default functions only operate with PCI devices because of the `dev->path.type != DEVICE_PATH_PCI` checks, so calling these functions for non-PCI devices is unnecessary. QEMU also implements `get_smbios_data` but binds it to the domain device, which isn't PCI either. Change-Id: Iefbf072b1203d04a98c9d26a30f22cfebe769eb4 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/57366 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber Reviewed-by: Tim Wawrzynczak Reviewed-by: Felix Held --- src/include/smbios.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/include') diff --git a/src/include/smbios.h b/src/include/smbios.h index 0f1386a963..0b24c15413 100644 --- a/src/include/smbios.h +++ b/src/include/smbios.h @@ -35,6 +35,9 @@ int smbios_write_type41(unsigned long *current, int *handle, const char *name, u8 instance, u16 segment, u8 bus, u8 device, u8 function, u8 device_type); +struct device; +int get_smbios_data(struct device *dev, int *handle, unsigned long *current); + const char *smbios_system_manufacturer(void); const char *smbios_system_product_name(void); const char *smbios_system_serial_number(void); -- cgit v1.2.3