diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ec/google/chromeec/Makefile.inc | 5 | ||||
-rw-r--r-- | src/ec/google/chromeec/ec_skuid.c | 36 | ||||
-rw-r--r-- | src/ec/google/chromeec/ec_smbios.c | 39 |
3 files changed, 44 insertions, 36 deletions
diff --git a/src/ec/google/chromeec/Makefile.inc b/src/ec/google/chromeec/Makefile.inc index a37d673b33..cb3b97e610 100644 --- a/src/ec/google/chromeec/Makefile.inc +++ b/src/ec/google/chromeec/Makefile.inc @@ -13,6 +13,11 @@ smm-$(CONFIG_EC_GOOGLE_CHROMEEC_SKUID) += ec_skuid.c romstage-$(CONFIG_EC_GOOGLE_CHROMEEC_SKUID) += ec_skuid.c ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC_SKUID) += ec_skuid.c +ifeq ($(CONFIG_GENERATE_SMBIOS_TABLES),y) +romstage-$(CONFIG_EC_GOOGLE_CHROMEEC_SKUID) += ec_smbios.c +ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC_SKUID) += ec_smbios.c +endif + bootblock-y += ec.c bootblock-$(CONFIG_EC_GOOGLE_CHROMEEC_LPC) += ec_lpc.c ramstage-y += ec.c crosec_proto.c vstore.c diff --git a/src/ec/google/chromeec/ec_skuid.c b/src/ec/google/chromeec/ec_skuid.c index 39a1c0be82..874324497f 100644 --- a/src/ec/google/chromeec/ec_skuid.c +++ b/src/ec/google/chromeec/ec_skuid.c @@ -1,11 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ #include <stddef.h> -#include <boardid.h> #include <ec/google/chromeec/ec.h> -#include <console/console.h> -#include <string.h> -#include <smbios.h> uint32_t google_chromeec_get_board_sku(void) { @@ -19,35 +15,3 @@ uint32_t google_chromeec_get_board_sku(void) return sku_id; } - -const char *google_chromeec_smbios_system_sku(void) -{ - static char sku_str[14]; /* sku{0..2147483647} */ - uint32_t sku_id = google_chromeec_get_board_sku(); - snprintf(sku_str, sizeof(sku_str), "sku%u", sku_id); - return sku_str; -} - -const char *smbios_system_sku(void) -{ - return google_chromeec_smbios_system_sku(); -} - -const char *smbios_mainboard_manufacturer(void) -{ - static char oem_name[32]; - static const char *manuf; - - if (manuf) - return manuf; - - if (google_chromeec_cbi_get_oem_name(&oem_name[0], - ARRAY_SIZE(oem_name)) < 0) { - printk(BIOS_ERR, "Couldn't obtain OEM name from CBI\n"); - manuf = CONFIG_MAINBOARD_SMBIOS_MANUFACTURER; - } else { - manuf = &oem_name[0]; - } - - return manuf; -} diff --git a/src/ec/google/chromeec/ec_smbios.c b/src/ec/google/chromeec/ec_smbios.c new file mode 100644 index 0000000000..1ee7283dc1 --- /dev/null +++ b/src/ec/google/chromeec/ec_smbios.c @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <stddef.h> +#include <ec/google/chromeec/ec.h> +#include <console/console.h> +#include <string.h> +#include <smbios.h> + +const char *google_chromeec_smbios_system_sku(void) +{ + static char sku_str[14]; /* sku{0..2147483647} */ + uint32_t sku_id = google_chromeec_get_board_sku(); + snprintf(sku_str, sizeof(sku_str), "sku%u", sku_id); + return sku_str; +} + +const char *smbios_system_sku(void) +{ + return google_chromeec_smbios_system_sku(); +} + +const char *smbios_mainboard_manufacturer(void) +{ + static char oem_name[32]; + static const char *manuf; + + if (manuf) + return manuf; + + if (google_chromeec_cbi_get_oem_name(&oem_name[0], + ARRAY_SIZE(oem_name)) < 0) { + printk(BIOS_ERR, "Couldn't obtain OEM name from CBI\n"); + manuf = CONFIG_MAINBOARD_SMBIOS_MANUFACTURER; + } else { + manuf = &oem_name[0]; + } + + return manuf; +} |