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>
This commit is contained in:
@@ -40,9 +40,9 @@ enum {
|
|||||||
/* SD controller type */
|
/* SD controller type */
|
||||||
FW_CONFIG_MASK_SD_CTRLR = 0x7,
|
FW_CONFIG_MASK_SD_CTRLR = 0x7,
|
||||||
FW_CONFIG_SHIFT_SD_CTRLR = 20,
|
FW_CONFIG_SHIFT_SD_CTRLR = 20,
|
||||||
/* SPI speed value */
|
/* SAR presence */
|
||||||
FW_CONFIG_MASK_SPI_SPEED = 0xf,
|
FW_CONFIG_MASK_SAR = 0x7,
|
||||||
FW_CONFIG_SHIFT_SPI_SPEED = 23,
|
FW_CONFIG_SHIFT_SAR = 23,
|
||||||
/* Fan information */
|
/* Fan information */
|
||||||
FW_CONFIG_MASK_FAN = 0x3,
|
FW_CONFIG_MASK_FAN = 0x3,
|
||||||
FW_CONFIG_SHIFT_FAN = 27,
|
FW_CONFIG_SHIFT_FAN = 27,
|
||||||
@@ -81,6 +81,11 @@ static unsigned int extract_field(uint64_t mask, int shift)
|
|||||||
return (fw_config >> shift) & mask;
|
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)
|
int variant_has_emmc(void)
|
||||||
{
|
{
|
||||||
return !!extract_field(FW_CONFIG_MASK_EMMC, FW_CONFIG_SHIFT_EMMC);
|
return !!extract_field(FW_CONFIG_MASK_EMMC, FW_CONFIG_SHIFT_EMMC);
|
||||||
|
@@ -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);
|
const fsp_ddi_descriptor *baseboard_get_ddi_descriptors(size_t *num);
|
||||||
|
|
||||||
/* Retrieve attributes from FW_CONFIG in CBI. */
|
/* 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. */
|
/* Return 0 if non-existent, 1 if present. */
|
||||||
int variant_has_emmc(void);
|
int variant_has_emmc(void);
|
||||||
/* Return 0 if non-existent, 1 if present. */
|
/* Return 0 if non-existent, 1 if present. */
|
||||||
|
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include <baseboard/variants.h>
|
#include <baseboard/variants.h>
|
||||||
#include <soc/pci_devs.h>
|
#include <soc/pci_devs.h>
|
||||||
|
#include <fw_config.h>
|
||||||
|
#include <sar.h>
|
||||||
|
|
||||||
static const fsp_ddi_descriptor hdmi_ddi_descriptors[] = {
|
static const fsp_ddi_descriptor hdmi_ddi_descriptors[] = {
|
||||||
{ // DDI0, DP0, eDP
|
{ // DDI0, DP0, eDP
|
||||||
@@ -41,3 +43,50 @@ void variant_devtree_update(void)
|
|||||||
if (variant_has_wwan())
|
if (variant_has_wwan())
|
||||||
soc_cfg->acp_i2s_use_external_48mhz_osc = 1;
|
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;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user