Angel Pons | a15dea9 | 2021-06-07 18:08:23 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <smbios.h> |
Elyes Haouas | bdd03c2 | 2024-05-27 11:20:07 +0200 | [diff] [blame^] | 4 | #include <stdio.h> |
Patrick Rudolph | 7b45920 | 2021-06-21 10:57:58 +0200 | [diff] [blame] | 5 | #include <string.h> |
Angel Pons | 0b697a24 | 2021-11-25 13:34:11 +0100 | [diff] [blame] | 6 | #include <types.h> |
Angel Pons | a15dea9 | 2021-06-07 18:08:23 +0200 | [diff] [blame] | 7 | |
Angel Pons | e81560c | 2021-11-25 13:15:07 +0100 | [diff] [blame] | 8 | #include "eeprom.h" |
Angel Pons | a15dea9 | 2021-06-07 18:08:23 +0200 | [diff] [blame] | 9 | |
| 10 | const char *smbios_system_serial_number(void) |
| 11 | { |
| 12 | const size_t offset = offsetof(struct eeprom_layout, system_serial_number); |
Angel Pons | b9af513 | 2022-09-01 15:21:34 +0200 | [diff] [blame] | 13 | return eeprom_read_serial(offset, CONFIG_MAINBOARD_SERIAL_NUMBER); |
Angel Pons | a15dea9 | 2021-06-07 18:08:23 +0200 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | const char *smbios_mainboard_serial_number(void) |
| 17 | { |
| 18 | const size_t offset = offsetof(struct eeprom_layout, board_serial_number); |
Angel Pons | b9af513 | 2022-09-01 15:21:34 +0200 | [diff] [blame] | 19 | return eeprom_read_serial(offset, CONFIG_MAINBOARD_SERIAL_NUMBER); |
Angel Pons | a15dea9 | 2021-06-07 18:08:23 +0200 | [diff] [blame] | 20 | } |
Patrick Rudolph | 7b45920 | 2021-06-21 10:57:58 +0200 | [diff] [blame] | 21 | |
| 22 | const char *smbios_mainboard_version(void) |
| 23 | { |
| 24 | static char version_str[8] = { 0 }; |
| 25 | |
| 26 | snprintf(version_str, sizeof(version_str), "HSI %u", get_bmc_hsi()); |
| 27 | |
| 28 | return version_str; |
| 29 | } |