[coreboot-gerrit] Change in coreboot[master]: mainboard/google/kahlee: Only read a single vendor from oem.bin

Martin Roth (Code Review) gerrit at coreboot.org
Tue Sep 25 00:07:00 CEST 2018


Martin Roth has uploaded this change for review. ( https://review.coreboot.org/28729


Change subject: mainboard/google/kahlee: Only read a single vendor from oem.bin
......................................................................

mainboard/google/kahlee: Only read a single vendor from oem.bin

Since each variant has a separate build, we don't need to support
multiple manufacturers in a single file.

BUG=b:79874904
TEST=Build, boot, see updated mainboard manufacturer

Change-Id: I0ccf207ba8d5e5200aa4b19c46784bbda82f7b6e
Signed-off-by: Martin Roth <martinroth at chromium.org>
---
M src/mainboard/google/kahlee/variants/baseboard/mainboard.c
1 file changed, 5 insertions(+), 30 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/29/28729/1

diff --git a/src/mainboard/google/kahlee/variants/baseboard/mainboard.c b/src/mainboard/google/kahlee/variants/baseboard/mainboard.c
index ad5fb2b..b963953 100644
--- a/src/mainboard/google/kahlee/variants/baseboard/mainboard.c
+++ b/src/mainboard/google/kahlee/variants/baseboard/mainboard.c
@@ -76,26 +76,10 @@
 	write32((void *)(sdbar + BH720_MEM_ACCESS_EN), 0x80000000);
 }
 
-static uint8_t calc_oem_id(void)
-{
-	return variant_board_sku() / 0x10;
-}
-
-/* "oem.bin" in cbfs contains an array of records using the following structure. */
-struct oem_mapping {
-	uint8_t oem_id;
-	char oem_name[10];
-} __packed;
-
-/* Local buffer to read "oem.bin" */
-static char oem_bin_data[200];
 
 const char *smbios_mainboard_manufacturer(void)
 {
-	uint8_t oem_id;
-	const struct oem_mapping *oem_entry = (void *)&oem_bin_data;
-	size_t oem_data_size;
-	unsigned int i, oem_entries_count;
+	static char oem_bin_data[10];
 	static const char *manuf;
 
 	if (!IS_ENABLED(CONFIG_USE_OEM_BIN))
@@ -104,20 +88,11 @@
 	if (manuf)
 		return manuf;
 
-	oem_data_size = cbfs_boot_load_file("oem.bin", oem_bin_data,
+	if (cbfs_boot_load_file("oem.bin", oem_bin_data,
 					    sizeof(oem_bin_data),
-					    CBFS_TYPE_RAW);
-	oem_id = calc_oem_id();
-	oem_entries_count = oem_data_size / sizeof(*oem_entry);
-	for (i = 0; i < oem_entries_count; i++) {
-		if (oem_id == oem_entry->oem_id) {
-			manuf = oem_entry->oem_name;
-			break;
-		}
-		oem_entry++;
-	}
-
-	if (manuf == NULL)
+					    CBFS_TYPE_RAW))
+		manuf = &oem_bin_data[0];
+	else
 		manuf = CONFIG_MAINBOARD_SMBIOS_MANUFACTURER;
 
 	return manuf;

-- 
To view, visit https://review.coreboot.org/28729
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ccf207ba8d5e5200aa4b19c46784bbda82f7b6e
Gerrit-Change-Number: 28729
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180924/c843a7ec/attachment.html>


More information about the coreboot-gerrit mailing list