summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/sar.h2
-rw-r--r--src/mainboard/google/dedede/variants/drawcia/variant.c6
-rw-r--r--src/mainboard/google/dedede/variants/galtic/variant.c6
-rw-r--r--src/mainboard/google/dedede/variants/madoo/variant.c6
-rw-r--r--src/mainboard/google/dedede/variants/magolor/variant.c6
-rw-r--r--src/mainboard/google/hatch/variants/dratini/variant.c6
-rw-r--r--src/mainboard/google/hatch/variants/kindred/variant.c5
-rw-r--r--src/mainboard/google/octopus/variants/bloog/variant.c9
-rw-r--r--src/mainboard/google/octopus/variants/bobba/variant.c5
-rw-r--r--src/mainboard/google/octopus/variants/casta/variant.c5
-rw-r--r--src/mainboard/google/octopus/variants/fleex/variant.c6
-rw-r--r--src/mainboard/google/octopus/variants/foob/variant.c5
-rw-r--r--src/mainboard/google/octopus/variants/meep/variant.c9
-rw-r--r--src/mainboard/google/octopus/variants/phaser/mainboard.c10
-rw-r--r--src/mainboard/google/poppy/variants/rammus/mainboard.c7
-rw-r--r--src/mainboard/google/volteer/variants/lindar/variant.c8
-rw-r--r--src/mainboard/google/zork/variants/vilboz/variant.c16
-rw-r--r--src/vendorcode/google/chromeos/sar.c14
18 files changed, 49 insertions, 82 deletions
diff --git a/src/include/sar.h b/src/include/sar.h
index c4a6cd8dbb..78a1b09f2b 100644
--- a/src/include/sar.h
+++ b/src/include/sar.h
@@ -41,6 +41,8 @@ struct wifi_sar_limits {
*/
int get_wifi_sar_limits(struct wifi_sar_limits *sar_limits);
+#define WIFI_SAR_CBFS_DEFAULT_FILENAME "wifi_sar_defaults.hex"
+
const char *get_wifi_sar_cbfs_filename(void);
#endif /* _SAR_H_ */
diff --git a/src/mainboard/google/dedede/variants/drawcia/variant.c b/src/mainboard/google/dedede/variants/drawcia/variant.c
index 0c2290432e..9dc0028e7c 100644
--- a/src/mainboard/google/dedede/variants/drawcia/variant.c
+++ b/src/mainboard/google/dedede/variants/drawcia/variant.c
@@ -6,12 +6,10 @@
const char *get_wifi_sar_cbfs_filename(void)
{
- const char *filename = NULL;
-
if (fw_config_probe(FW_CONFIG(TABLETMODE, TABLETMODE_ENABLED)))
- filename = "wifi_sar-drawcia.hex";
+ return "wifi_sar-drawcia.hex";
- return filename;
+ return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}
const char *mainboard_vbt_filename(void)
diff --git a/src/mainboard/google/dedede/variants/galtic/variant.c b/src/mainboard/google/dedede/variants/galtic/variant.c
index e7b1bb8ccd..92aa1767cf 100644
--- a/src/mainboard/google/dedede/variants/galtic/variant.c
+++ b/src/mainboard/google/dedede/variants/galtic/variant.c
@@ -5,9 +5,7 @@
const char *get_wifi_sar_cbfs_filename(void)
{
- const char *filename = NULL;
-
if (fw_config_probe(FW_CONFIG(TABLETMODE, TABLETMODE_ENABLED)))
- filename = "wifi_sar-galtic.hex";
- return filename;
+ return "wifi_sar-galtic.hex";
+ return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}
diff --git a/src/mainboard/google/dedede/variants/madoo/variant.c b/src/mainboard/google/dedede/variants/madoo/variant.c
index b8c3654ab0..94e4d9023c 100644
--- a/src/mainboard/google/dedede/variants/madoo/variant.c
+++ b/src/mainboard/google/dedede/variants/madoo/variant.c
@@ -5,10 +5,8 @@
const char *get_wifi_sar_cbfs_filename(void)
{
- const char *filename = NULL;
-
if (fw_config_probe(FW_CONFIG(TABLETMODE, TABLETMODE_ENABLED)))
- filename = "wifi_sar-madoo.hex";
+ return "wifi_sar-madoo.hex";
- return filename;
+ return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}
diff --git a/src/mainboard/google/dedede/variants/magolor/variant.c b/src/mainboard/google/dedede/variants/magolor/variant.c
index e3b9599a91..68ce6c2316 100644
--- a/src/mainboard/google/dedede/variants/magolor/variant.c
+++ b/src/mainboard/google/dedede/variants/magolor/variant.c
@@ -5,10 +5,8 @@
const char *get_wifi_sar_cbfs_filename(void)
{
- const char *filename = NULL;
-
if (fw_config_probe(FW_CONFIG(TABLETMODE, TABLETMODE_ENABLED)))
- filename = "wifi_sar-magolor.hex";
+ return "wifi_sar-magolor.hex";
- return filename;
+ return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}
diff --git a/src/mainboard/google/hatch/variants/dratini/variant.c b/src/mainboard/google/hatch/variants/dratini/variant.c
index 1a4cd4049b..72f62316e3 100644
--- a/src/mainboard/google/hatch/variants/dratini/variant.c
+++ b/src/mainboard/google/hatch/variants/dratini/variant.c
@@ -7,7 +7,6 @@
const char *get_wifi_sar_cbfs_filename(void)
{
- const char *filename = NULL;
uint32_t sku_id = google_chromeec_get_board_sku();
switch (sku_id) {
@@ -15,8 +14,7 @@ const char *get_wifi_sar_cbfs_filename(void)
case SKU_22_DRAGONAIR:
case SKU_23_DRAGONAIR:
case SKU_24_DRAGONAIR:
- filename = "wifi_sar-dragonair.hex";
- break;
+ return "wifi_sar-dragonair.hex";
}
- return filename;
+ return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}
diff --git a/src/mainboard/google/hatch/variants/kindred/variant.c b/src/mainboard/google/hatch/variants/kindred/variant.c
index 9430f67ab1..3510dbb68e 100644
--- a/src/mainboard/google/hatch/variants/kindred/variant.c
+++ b/src/mainboard/google/hatch/variants/kindred/variant.c
@@ -39,12 +39,11 @@ void variant_devtree_update(void)
const char *get_wifi_sar_cbfs_filename(void)
{
- const char *filename = NULL;
uint32_t sku_id = google_chromeec_get_board_sku();
if (sku_id == 1 || sku_id == 2 || sku_id == 3 || sku_id == 4)
- filename = "wifi_sar-kled.hex";
- return filename;
+ return "wifi_sar-kled.hex";
+ return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}
const char *mainboard_vbt_filename(void)
diff --git a/src/mainboard/google/octopus/variants/bloog/variant.c b/src/mainboard/google/octopus/variants/bloog/variant.c
index 5682ac3eb0..28f2ce8f54 100644
--- a/src/mainboard/google/octopus/variants/bloog/variant.c
+++ b/src/mainboard/google/octopus/variants/bloog/variant.c
@@ -28,7 +28,6 @@ enum {
const char *get_wifi_sar_cbfs_filename(void)
{
- const char *filename = NULL;
uint32_t sku_id = google_chromeec_get_board_sku();
switch (sku_id) {
@@ -36,18 +35,16 @@ const char *get_wifi_sar_cbfs_filename(void)
case SKU_34_BLOOG:
case SKU_35_BLOOG:
case SKU_36_BLOOG:
- filename = "wifi_sar-bloog.hex";
- break;
+ return "wifi_sar-bloog.hex";
case SKU_49_BLOOGUARD:
case SKU_50_BLOOGUARD:
case SKU_51_BLOOGUARD:
case SKU_52_BLOOGUARD:
case SKU_53_BIPSHIP:
case SKU_54_BIPSHIP:
- filename = "wifi_sar-blooguard.hex";
- break;
+ return "wifi_sar-blooguard.hex";
}
- return filename;
+ return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}
const char *mainboard_vbt_filename(void)
diff --git a/src/mainboard/google/octopus/variants/bobba/variant.c b/src/mainboard/google/octopus/variants/bobba/variant.c
index 2d09270148..5765eb7768 100644
--- a/src/mainboard/google/octopus/variants/bobba/variant.c
+++ b/src/mainboard/google/octopus/variants/bobba/variant.c
@@ -18,13 +18,12 @@ enum {
const char *get_wifi_sar_cbfs_filename(void)
{
- const char *filename = NULL;
uint32_t sku_id = google_chromeec_get_board_sku();
if (sku_id >= 33 && sku_id <= 44)
- filename = "wifi_sar-droid.hex";
+ return "wifi_sar-droid.hex";
- return filename;
+ return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}
void variant_smi_sleep(u8 slp_typ)
diff --git a/src/mainboard/google/octopus/variants/casta/variant.c b/src/mainboard/google/octopus/variants/casta/variant.c
index a5b948cf62..b9165a7aab 100644
--- a/src/mainboard/google/octopus/variants/casta/variant.c
+++ b/src/mainboard/google/octopus/variants/casta/variant.c
@@ -8,13 +8,12 @@
const char *get_wifi_sar_cbfs_filename(void)
{
- const char *filename = NULL;
uint32_t sku_id = google_chromeec_get_board_sku();
if (sku_id == 2)
- filename = "wifi_sar-bluebird.hex";
+ return "wifi_sar-bluebird.hex";
- return filename;
+ return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}
bool variant_ext_usb_status(unsigned int port_type, unsigned int port_id)
diff --git a/src/mainboard/google/octopus/variants/fleex/variant.c b/src/mainboard/google/octopus/variants/fleex/variant.c
index 6333b074dd..63908e2f68 100644
--- a/src/mainboard/google/octopus/variants/fleex/variant.c
+++ b/src/mainboard/google/octopus/variants/fleex/variant.c
@@ -32,12 +32,10 @@ void variant_smi_sleep(u8 slp_typ)
const char *get_wifi_sar_cbfs_filename(void)
{
- const char *filename = NULL;
-
if (!is_lte_sku())
- filename = "wifi_sar-fleex.hex";
+ return "wifi_sar-fleex.hex";
- return filename;
+ return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}
void variant_update_devtree(struct device *dev)
diff --git a/src/mainboard/google/octopus/variants/foob/variant.c b/src/mainboard/google/octopus/variants/foob/variant.c
index 8cc4a3df0b..aeddc3b3b2 100644
--- a/src/mainboard/google/octopus/variants/foob/variant.c
+++ b/src/mainboard/google/octopus/variants/foob/variant.c
@@ -25,11 +25,10 @@ void variant_update_devtree(struct device *dev)
const char *get_wifi_sar_cbfs_filename(void)
{
- const char *filename = NULL;
uint32_t sku_id = SKU_UNKNOWN;
sku_id = google_chromeec_get_board_sku();
if (sku_id == 9)
- filename = "wifi_sar-foob360.hex";
- return filename;
+ return "wifi_sar-foob360.hex";
+ return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}
diff --git a/src/mainboard/google/octopus/variants/meep/variant.c b/src/mainboard/google/octopus/variants/meep/variant.c
index df4dbd69ea..4e5c4bebf4 100644
--- a/src/mainboard/google/octopus/variants/meep/variant.c
+++ b/src/mainboard/google/octopus/variants/meep/variant.c
@@ -8,7 +8,6 @@
const char *get_wifi_sar_cbfs_filename(void)
{
- const char *filename = NULL;
uint32_t sku_id = google_chromeec_get_board_sku();
switch (sku_id) {
@@ -16,16 +15,14 @@ const char *get_wifi_sar_cbfs_filename(void)
case SKU_2_MEEP:
case SKU_3_MEEP:
case SKU_4_MEEP:
- filename = "wifi_sar-meep.hex";
- break;
+ return "wifi_sar-meep.hex";
case SKU_49_VORTININJA:
case SKU_50_VORTININJA:
case SKU_51_VORTININJA:
case SKU_52_VORTININJA:
- filename = "wifi_sar-vortininja.hex";
- break;
+ return "wifi_sar-vortininja.hex";
}
- return filename;
+ return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}
const char *mainboard_vbt_filename(void)
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";
}
diff --git a/src/mainboard/google/poppy/variants/rammus/mainboard.c b/src/mainboard/google/poppy/variants/rammus/mainboard.c
index 8c09b2a57e..9892dda46d 100644
--- a/src/mainboard/google/poppy/variants/rammus/mainboard.c
+++ b/src/mainboard/google/poppy/variants/rammus/mainboard.c
@@ -33,14 +33,13 @@ const char *smbios_system_sku(void)
const char *get_wifi_sar_cbfs_filename(void)
{
- const char *filename = NULL;
uint32_t sku_id;
sku_id = variant_board_sku();
if (sku_id & 0x200)
- filename = "wifi_sar-shyvana.hex";
+ return "wifi_sar-shyvana.hex";
else
- filename = "wifi_sar-leona.hex";
+ return "wifi_sar-leona.hex";
- return filename;
+ return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}
diff --git a/src/mainboard/google/volteer/variants/lindar/variant.c b/src/mainboard/google/volteer/variants/lindar/variant.c
index b8d7165be3..2d10dc6fc1 100644
--- a/src/mainboard/google/volteer/variants/lindar/variant.c
+++ b/src/mainboard/google/volteer/variants/lindar/variant.c
@@ -5,12 +5,10 @@
const char *get_wifi_sar_cbfs_filename(void)
{
- const char *filename = NULL;
-
if (fw_config_probe(FW_CONFIG(WIFI_SAR_ID, WIFI_SAR_ID_0)))
- filename = "wifi_sar_0.hex";
+ return "wifi_sar_0.hex";
else if (fw_config_probe(FW_CONFIG(WIFI_SAR_ID, WIFI_SAR_ID_1)))
- filename = "wifi_sar_1.hex";
+ return "wifi_sar_1.hex";
- return filename;
+ return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}
diff --git a/src/mainboard/google/zork/variants/vilboz/variant.c b/src/mainboard/google/zork/variants/vilboz/variant.c
index e75d8fcd8a..57563ccaa0 100644
--- a/src/mainboard/google/zork/variants/vilboz/variant.c
+++ b/src/mainboard/google/zork/variants/vilboz/variant.c
@@ -60,29 +60,23 @@ void variant_devtree_update(void)
const char *get_wifi_sar_cbfs_filename(void)
{
- const char *filename = NULL;
int sar_config;
sar_config = variant_gets_sar_config();
switch (sar_config) {
case 1:
- filename = "wifi_sar-vilboz-0.hex";
- break;
+ return "wifi_sar-vilboz-0.hex";
case 3:
/*
TODO: Set default first. It will be replaced after the
new table is generated.
*/
- filename = "wifi_sar_defaults.hex";
- break;
+ return WIFI_SAR_CBFS_DEFAULT_FILENAME;
case 5:
- filename = "wifi_sar-vilboz-1.hex";
- break;
case 7:
- filename = "wifi_sar-vilboz-1.hex";
- break;
+ return "wifi_sar-vilboz-1.hex";
+ default:
+ return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}
-
- return filename;
}
diff --git a/src/vendorcode/google/chromeos/sar.c b/src/vendorcode/google/chromeos/sar.c
index 83c1c0ca20..a38ffe270b 100644
--- a/src/vendorcode/google/chromeos/sar.c
+++ b/src/vendorcode/google/chromeos/sar.c
@@ -9,8 +9,6 @@
#include <string.h>
#include <types.h>
-#define WIFI_SAR_CBFS_FILENAME "wifi_sar_defaults.hex"
-
/*
* Retrieve WiFi SAR limits data from CBFS and decode it
* WiFi SAR data is expected in the format: [<WRDD><EWRD>][WGDS]
@@ -37,6 +35,12 @@ int get_wifi_sar_limits(struct wifi_sar_limits *sar_limits)
char *sar_str;
int ret = -1;
+ filename = get_wifi_sar_cbfs_filename();
+ if (filename == NULL) {
+ printk(BIOS_DEBUG, "Filename missing for CBFS SAR file!\n");
+ return ret;
+ }
+
/*
* If GEO_SAR_ENABLE is not selected, SAR file does not contain
* delta table settings.
@@ -64,10 +68,6 @@ int get_wifi_sar_limits(struct wifi_sar_limits *sar_limits)
printk(BIOS_DEBUG, "Checking CBFS for default SAR values\n");
- filename = get_wifi_sar_cbfs_filename();
- if (filename == NULL)
- filename = WIFI_SAR_CBFS_FILENAME;
-
if (cbfs_load(filename, sar_str, sar_str_len) != sar_str_len) {
printk(BIOS_ERR, "%s has bad len in CBFS\n", filename);
goto done;
@@ -88,5 +88,5 @@ done:
__weak
const char *get_wifi_sar_cbfs_filename(void)
{
- return WIFI_SAR_CBFS_FILENAME;
+ return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}