Amanda Hwang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30150
Change subject: arch/x86/smbios: Add SMBIOS type for QCA6174A ......................................................................
arch/x86/smbios: Add SMBIOS type for QCA6174A
BUG=b:118656705 TEST=dmidecode -t 0xf8 and make sure that the correct SMBIOS type information gets returned.
Change-Id: I0d1f84898bb4130b55508cc29fa2412ec8bad658 Signed-off-by: Amanda Huang amanda_hwang@compal.corp-partner.google.com --- M src/arch/x86/smbios.c M src/include/smbios.h M src/mainboard/google/kahlee/variants/baseboard/mainboard.c 3 files changed, 75 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/30150/1
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index c0545ce..5e7e696 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -450,6 +450,21 @@ return ""; }
+const char *__weak smbios_bdf_extension(void) +{ + return ""; +} + +u8 __weak smbios_country_flag(void) +{ + return 0; +} + +u16 __weak smbios_country_value(void) +{ + return 0; +} + #ifdef CONFIG_MAINBOARD_FAMILY const char *smbios_mainboard_family(void) { @@ -457,6 +472,28 @@ } #endif /* CONFIG_MAINBOARD_FAMILY */
+static int smbios_write_typef8(unsigned long *current, int handle) +{ + struct smbios_typef8 *t = (struct smbios_typef8 *)*current; + int len = sizeof(struct smbios_typef8); + + printk(BIOS_INFO, "Create SMBIOS type 0xf8\n"); + + memset(t, 0, sizeof(struct smbios_typef8)); + t->type = SMBIOS_QCT_WLAN_CONFIGURATION; + t->handle = handle; + t->length = len - 2; + t->disable_11ac = 0; + t->country_code_flag = smbios_country_flag(); + t->country_code_value = smbios_country_value(); + t->board_file_extension = smbios_add_string(t->eos, smbios_bdf_extension()); + + len = t->length + smbios_string_table_len(t->eos); + *current += len; + return len; +} + + static int smbios_write_type1(unsigned long *current, int handle) { struct smbios_type1 *t = (struct smbios_type1 *)*current; @@ -736,6 +773,9 @@ current = ALIGN(current, 16);
tables = current; + update_max(len, max_struct_size, smbios_write_typef8(¤t, + handle++)); + update_max(len, max_struct_size, smbios_write_type0(¤t, handle++)); update_max(len, max_struct_size, smbios_write_type1(¤t, diff --git a/src/include/smbios.h b/src/include/smbios.h index 14badbc..4614897 100644 --- a/src/include/smbios.h +++ b/src/include/smbios.h @@ -52,6 +52,10 @@ const char *smbios_mainboard_family(void); #endif
+const char *smbios_bdf_extension(void); +u8 smbios_country_flag(void); +u16 smbios_country_value(void); + #define BIOS_CHARACTERISTICS_PCI_SUPPORTED (1 << 7) #define BIOS_CHARACTERISTICS_PC_CARD (1 << 8) #define BIOS_CHARACTERISTICS_PNP (1 << 9) @@ -199,7 +203,8 @@ SMBIOS_SYSTEM_BOOT_INFORMATION = 32, SMBIOS_IPMI_DEVICE_INFORMATION = 38, SMBIOS_ONBOARD_DEVICES_EXTENDED_INFORMATION = 41, - SMBIOS_END_OF_TABLE = 127, + SMBIOS_QCT_WLAN_CONFIGURATION = 0xf8, + SMBIOS_END_OF_TABLE = 127, } smbios_struct_type_t;
struct smbios_entry { @@ -521,6 +526,17 @@ u8 eos[2]; } __packed;
+struct smbios_typef8 { + u8 type; + u8 length; + u16 handle; + u8 disable_11ac; + u8 country_code_flag; + u16 country_code_value; + u8 board_file_extension; + u8 eos[2]; +} __packed; + void smbios_fill_dimm_manufacturer_from_id(uint16_t mod_id, struct smbios_type17 *t);
diff --git a/src/mainboard/google/kahlee/variants/baseboard/mainboard.c b/src/mainboard/google/kahlee/variants/baseboard/mainboard.c index d1a3492..7f2ff54 100644 --- a/src/mainboard/google/kahlee/variants/baseboard/mainboard.c +++ b/src/mainboard/google/kahlee/variants/baseboard/mainboard.c @@ -97,3 +97,21 @@
return manuf; } + +const char *smbios_bdf_extension(void) +{ + return "BDF_GO_LIARA"; +} + +u8 smbios_country_flag(void) +{ + return 0x00; +} + +u16 smbios_country_value(void) +{ + return 0x00; +} + + +