[coreboot-gerrit] Change in ...coreboot[master]: WIP: google: add support for multiple SAR filenames

Justin TerAvest (Code Review) gerrit at coreboot.org
Fri Dec 14 19:28:54 CET 2018


Justin TerAvest has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30222


Change subject: WIP: google: add support for multiple SAR filenames
......................................................................

WIP: google: add support for multiple SAR filenames

Using a fixed filename only allows for one SAR configuration to be
checked into CBFS. However, we have devices with shared firmware that
would desire separate SAR configurations. This change allows boards to
define a function to select one of multiple files stored in CBFS to be
used.

Change-Id: Ib852aaaff39f1e9149fa43bf8dc25b2400737ea5
---
M src/drivers/intel/wifi/wifi.c
M src/include/sar.h
M src/vendorcode/google/chromeos/sar.c
3 files changed, 13 insertions(+), 1 deletion(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/30222/1

diff --git a/src/drivers/intel/wifi/wifi.c b/src/drivers/intel/wifi/wifi.c
index e197114..51f4b98 100644
--- a/src/drivers/intel/wifi/wifi.c
+++ b/src/drivers/intel/wifi/wifi.c
@@ -70,6 +70,12 @@
 	return -1;
 }
 
+__weak
+const char* get_wifi_sar_cbfs_filename(void)
+{
+	return NULL;
+}
+
 #if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
 static void emit_sar_acpi_structures(void)
 {
diff --git a/src/include/sar.h b/src/include/sar.h
index 9da4dd9..096a273 100644
--- a/src/include/sar.h
+++ b/src/include/sar.h
@@ -54,4 +54,6 @@
  */
 int get_wifi_sar_limits(struct wifi_sar_limits *sar_limits);
 
+const char* get_wifi_sar_cbfs_filename(void);
+
 #endif /* _SAR_H_ */
diff --git a/src/vendorcode/google/chromeos/sar.c b/src/vendorcode/google/chromeos/sar.c
index 6799f12..70c8f18 100644
--- a/src/vendorcode/google/chromeos/sar.c
+++ b/src/vendorcode/google/chromeos/sar.c
@@ -26,7 +26,11 @@
 
 static int load_sar_file_from_cbfs(void *buf, size_t buffer_size)
 {
-	return cbfs_boot_load_file(WIFI_SAR_CBFS_FILENAME, buf,
+	const char *filename = get_wifi_sar_cbfs_filename();
+	if (filename == NULL) {
+		filename = WIFI_SAR_CBFS_FILENAME;
+	}
+	return cbfs_boot_load_file(filename, buf,
 			buffer_size, CBFS_TYPE_RAW);
 }
 

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

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib852aaaff39f1e9149fa43bf8dc25b2400737ea5
Gerrit-Change-Number: 30222
Gerrit-PatchSet: 1
Gerrit-Owner: Justin TerAvest <teravest at chromium.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181214/060e87cb/attachment.html>


More information about the coreboot-gerrit mailing list