diff options
author | Erik van den Bogaert <ebogaert@eltan.com> | 2022-09-28 12:35:51 +0200 |
---|---|---|
committer | Martin Roth <martin.roth@amd.corp-partner.google.com> | 2022-10-06 18:36:03 +0000 |
commit | 93781523a5291bed1faf9f2d9cc5965f22f6c605 (patch) | |
tree | 7f9a9e0625a225831ab0fdc0e0e3d800b3e76e3c /src/arch | |
parent | 61ed4ef5d50137886449086f7bf2052468f99f29 (diff) |
smbios: Add API to generate SMBIOS type 28 Temperature Probe
Based on DMTF SMBIOS Specification 3.5.0
Signed-off-by: Erik van den Bogaert <ebogaert@eltan.com>
Change-Id: I710124ca88dac9edb68aab98cf5950aa16c695d3
Reviewed-on: https://review.coreboot.org/c/coreboot/+/67926
Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/x86/smbios.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 0c1a877899..2a2a6af07c 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -1052,6 +1052,35 @@ static int smbios_write_type20(unsigned long *current, int *handle, return totallen; } +int smbios_write_type28(unsigned long *current, int *handle, + const char *name, + const enum smbios_temp_location location, + const enum smbios_temp_status status, + u16 max_value, u16 min_value, + u16 resolution, u16 tolerance, + u16 accuracy, + u32 oem, + u16 nominal_value) +{ + struct smbios_type28 *t = smbios_carve_table(*current, SMBIOS_TEMPERATURE_PROBE, + sizeof(*t), *handle); + + t->description = smbios_add_string(t->eos, name ? name : "Temperature"); + t->location_and_status = location | (status << 5); + t->maximum_value = max_value; + t->minimum_value = min_value; + t->resolution = resolution; + t->tolerance = tolerance; + t->accuracy = accuracy; + t->oem_defined = oem; + t->nominal_value = nominal_value; + + const int len = smbios_full_table_len(&t->header, t->eos); + *current += len; + *handle += 1; + return len; +} + static int smbios_write_type32(unsigned long *current, int handle) { struct smbios_type32 *t = smbios_carve_table(*current, SMBIOS_SYSTEM_BOOT_INFORMATION, |