From 7fe5d3d382e25fbdd5026c8e0231dc5a10b57931 Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Sat, 13 Mar 2021 22:54:16 -0800 Subject: sar: Fix semantics of `get_wifi_sar_cbfs_filename()` Currently, if `get_wifi_sar_cbfs_filename()` returns NULL, then `get_wifi_sar_limits()` assumes that the default filename is used for CBFS SAR file. This prevents a board from supporting different models using the same firmware -- some which require SAR support and some which don't. This change updates the logic in `get_wifi_sar_limits()` to return early if filename is not provided by the mainboard. In order to maintain the same logic as before, current mainboards are updated to return WIFI_SAR_CBFS_DEFAULT_FILENAME instead of NULL in default case. Change-Id: I68b5bdd213767a3cd81fe41ace66540acd68e26a Signed-off-by: Furquan Shaikh Reviewed-on: https://review.coreboot.org/c/coreboot/+/51485 Reviewed-by: Tim Wawrzynczak Tested-by: build bot (Jenkins) --- src/mainboard/google/octopus/variants/phaser/mainboard.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/mainboard/google/octopus/variants/phaser/mainboard.c') diff --git a/src/mainboard/google/octopus/variants/phaser/mainboard.c b/src/mainboard/google/octopus/variants/phaser/mainboard.c index 4997ce452f..b5b53539b7 100644 --- a/src/mainboard/google/octopus/variants/phaser/mainboard.c +++ b/src/mainboard/google/octopus/variants/phaser/mainboard.c @@ -6,14 +6,10 @@ const char *get_wifi_sar_cbfs_filename(void) { - const char *filename = NULL; uint32_t sku_id; - if (google_chromeec_cbi_get_sku_id(&sku_id)) - return NULL; + if (google_chromeec_cbi_get_sku_id(&sku_id) || (sku_id != 5)) + return WIFI_SAR_CBFS_DEFAULT_FILENAME; - if (sku_id == 5) - filename = "wifi_sar-laser.hex"; - - return filename; + return "wifi_sar-laser.hex"; } -- cgit v1.2.3