diff options
Diffstat (limited to 'src/mainboard')
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; +} |