diff options
author | Frank Wu <frank_wu@compal.corp-partner.google.com> | 2021-01-08 17:53:00 +0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-01-15 11:28:31 +0000 |
commit | f296273692785da1bc88df8d28d955f8d79390e7 (patch) | |
tree | 85ed34f7618001a371c463d520c4785f66aa556d /src | |
parent | 276e865e7fc4c6c7a7fa30e1786fff373b0ae7a1 (diff) |
mb/google/zork/var/vilboz: Add WiFi SAR for Vilboz
The fw_config field SPI_SPEED is not used for zork devices.
To define SAR config, use the fw_config bit[23..26].
Then vilboz can loaded different WiFi SAR table for different SKUs.
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
Reviewed-on: https://review.coreboot.org/c/coreboot/+/49296
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kangheui Won <khwon@chromium.org>
Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src')
3 files changed, 59 insertions, 3 deletions
diff --git a/src/mainboard/google/zork/variants/baseboard/helpers.c b/src/mainboard/google/zork/variants/baseboard/helpers.c index 0e0239c1b4..00e7a033cb 100644 --- a/src/mainboard/google/zork/variants/baseboard/helpers.c +++ b/src/mainboard/google/zork/variants/baseboard/helpers.c @@ -40,9 +40,9 @@ enum { /* SD controller type */ FW_CONFIG_MASK_SD_CTRLR = 0x7, FW_CONFIG_SHIFT_SD_CTRLR = 20, - /* SPI speed value */ - FW_CONFIG_MASK_SPI_SPEED = 0xf, - FW_CONFIG_SHIFT_SPI_SPEED = 23, + /* SAR presence */ + FW_CONFIG_MASK_SAR = 0x7, + FW_CONFIG_SHIFT_SAR = 23, /* Fan information */ FW_CONFIG_MASK_FAN = 0x3, FW_CONFIG_SHIFT_FAN = 27, @@ -81,6 +81,11 @@ static unsigned int extract_field(uint64_t mask, int shift) 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 aeff49b6bc..ac600de255 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_dxio_descriptor *baseboard_get_dxio_descriptors(size_t *num); 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 fd38e1d1ea..3816aac203 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,50 @@ void variant_devtree_update(void) 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[26] |0 |0 |0 |0 |0 |0 |0 |0 | +|SAR[25] |0 |0 |0 |0 |1 |1 |1 |1 | +|SAR[24] |0 |0 |1 |1 |0 |0 |1 |1 | +|SAR[23] |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 3: + /* + 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; + } + + return filename; +} |