coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ec_smbios.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include <stddef.h>
5 #include <console/console.h>
6 #include <string.h>
7 #include <smbios.h>
8 
10 {
11  static char sku_str[14]; /* sku{0..2147483647} */
13  snprintf(sku_str, sizeof(sku_str), "sku%u", sku_id);
14  return sku_str;
15 }
16 
17 const char *smbios_system_sku(void)
18 {
20 }
21 
23 {
24  static char oem_name[32];
25  static const char *manuf;
26 
27  if (manuf)
28  return manuf;
29 
30  manuf = CONFIG_MAINBOARD_SMBIOS_MANUFACTURER;
31  if (google_chromeec_cbi_get_oem_name(&oem_name[0], ARRAY_SIZE(oem_name)) < 0)
32  printk(BIOS_INFO, "Couldn't obtain OEM name from CBI\n");
33  else if (strlen(oem_name) > 0)
34  manuf = &oem_name[0];
35  else
36  printk(BIOS_INFO, "OEM name from CBI is empty, use default\n");
37 
38  return manuf;
39 }
40 
41 const char *smbios_system_manufacturer(void)
42 {
43  return "Google";
44 }
uint32_t sku_id(void)
#define ARRAY_SIZE(a)
Definition: helpers.h:12
#define printk(level,...)
Definition: stdlib.h:16
int google_chromeec_cbi_get_oem_name(char *buf, size_t bufsize)
Definition: ec.c:910
uint32_t google_chromeec_get_board_sku(void)
Definition: ec_skuid.c:6
const char * smbios_system_sku(void)
Definition: ec_smbios.c:17
const char * google_chromeec_smbios_system_sku(void)
Definition: ec_smbios.c:9
const char * smbios_mainboard_manufacturer(void)
Definition: ec_smbios.c:22
const char * smbios_system_manufacturer(void)
Definition: ec_smbios.c:41
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
unsigned int uint32_t
Definition: stdint.h:14
size_t strlen(const char *src)
Definition: string.c:42
int snprintf(char *buf, size_t size, const char *fmt,...)
Note: This file is only for POSIX compatibility, and is meant to be chain-included via string....
Definition: vsprintf.c:35