Frank Wu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/49296 )
Change subject: mb/google/zork/var/vilboz: SAR config ......................................................................
mb/google/zork/var/vilboz: SAR config
BUG=b:176858126, b:176751675, b:176538384 BRANCH=zork TEST=emerge-zork coreboot chromeos-bootimage, then verify that tables are in CBFS and loaded by iwlwifi driver.
Signed-off-by: Frank Wu frank_wu@compal.corp-partner.google.com Change-Id: I5ba98799e697010997b515ee88420d0ac14ca7ec --- M src/mainboard/google/zork/variants/baseboard/helpers.c M src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h M src/mainboard/google/zork/variants/vilboz/variant.c 3 files changed, 55 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/96/49296/1
diff --git a/src/mainboard/google/zork/variants/baseboard/helpers.c b/src/mainboard/google/zork/variants/baseboard/helpers.c index 0e0239c..7973d1e 100644 --- a/src/mainboard/google/zork/variants/baseboard/helpers.c +++ b/src/mainboard/google/zork/variants/baseboard/helpers.c @@ -49,6 +49,9 @@ /* WWAN presence */ FW_CONFIG_MASK_WWAN = 0x1, FW_CONFIG_SHIFT_WWAN = 29, + /* SAR presence */ + FW_CONFIG_MASK_SAR = 0x7, + FW_CONFIG_SHIFT_SAR = 30, };
static int get_fw_config(uint64_t *val) @@ -81,6 +84,11 @@ return (fw_config >> shift) & mask; }
+int variant_gets_sar_config(void) +{ + return !!extract_field(FW_CONFIG_MASK_SAR, FW_CONFIG_SHIFT_SAR); +} + int variant_has_emmc(void) { return !!extract_field(FW_CONFIG_MASK_EMMC, FW_CONFIG_SHIFT_EMMC); diff --git a/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h index aeff49b..ac600de 100644 --- a/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h @@ -59,6 +59,8 @@ const fsp_ddi_descriptor *baseboard_get_ddi_descriptors(size_t *num);
/* Retrieve attributes from FW_CONFIG in CBI. */ +/* Return value of SAR config. */ +int variant_gets_sar_config(void); /* Return 0 if non-existent, 1 if present. */ int variant_has_emmc(void); /* Return 0 if non-existent, 1 if present. */ diff --git a/src/mainboard/google/zork/variants/vilboz/variant.c b/src/mainboard/google/zork/variants/vilboz/variant.c index fd38e1d..2da4f70 100644 --- a/src/mainboard/google/zork/variants/vilboz/variant.c +++ b/src/mainboard/google/zork/variants/vilboz/variant.c @@ -2,6 +2,8 @@
#include <baseboard/variants.h> #include <soc/pci_devs.h> +#include <fw_config.h> +#include <sar.h>
static const fsp_ddi_descriptor hdmi_ddi_descriptors[] = { { // DDI0, DP0, eDP @@ -41,3 +43,46 @@ if (variant_has_wwan()) soc_cfg->acp_i2s_use_external_48mhz_osc = 1; } + +/* ++----------+------+--------+--------+------+--+---------+--+---------+ +| |Vilboz|Vilboz14|Vilboz14|Vilboz|NA|Vilboz360|NA|Vilboz360| +| |WiFi |WiFi |LTE |LTE | |WiFi | |LTE | ++----------+------+--------+--------+------+--+---------+--+---------+ +|SAR[32] |0 |0 |0 |0 |1 |1 |1 |1 | +|SAR[31] |0 |0 |1 |1 |0 |0 |1 |1 | +|SAR[30] |0 |1 |0 |1 |0 |1 |0 |1 | ++----------+------+--------+--------+------+--+---------+--+---------+ +|SAR_config|0 |1 |2 |3 |4 |5 |6 |7 | ++----------+------+--------+--------+------+--+---------+--+---------+ +*/ + +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; + case 2: + //TODO: Set default first. It will be replaced after the new table is generated. + filename = "wifi_sar_defaults.hex"; + break; + case 5: + filename = "wifi_sar-vilboz-1.hex"; + break; + case 7: + //TODO: Set default first. It will be replaced after the new table is generated. + filename = "wifi_sar_defaults.hex"; + break; + default: + filename = "wifi_sar_defaults.hex"; + } + + return filename; +}