Leo Chou has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/82702?usp=email )
Change subject: mb/google/nissa/var/pujjoga: Add wifi sar table ......................................................................
mb/google/nissa/var/pujjoga: Add wifi sar table
Add wifi sar table for pujjoga intel wifi config. Use fw_config to separate different wifi card settings.
WIFI_SAR_TABLE_AX211: 0 WIFI_SAR_TABLE_AX203: 1
BUG=b:336167281 Test=emerge-nissa coreboot
Change-Id: If0f542cb13e93e99960bf65d616b26cee7617a43 Signed-off-by: Leo Chou leo.chou@lcfc.corp-partner.google.com --- M src/mainboard/google/brya/Kconfig M src/mainboard/google/brya/variants/pujjoga/Makefile.mk M src/mainboard/google/brya/variants/pujjoga/overridetree.cb A src/mainboard/google/brya/variants/pujjoga/variant.c 4 files changed, 88 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/82702/1
diff --git a/src/mainboard/google/brya/Kconfig b/src/mainboard/google/brya/Kconfig index 366d2dd..7d1fd82 100644 --- a/src/mainboard/google/brya/Kconfig +++ b/src/mainboard/google/brya/Kconfig @@ -418,6 +418,7 @@ config BOARD_GOOGLE_PUJJOGA select BOARD_GOOGLE_BASEBOARD_NISSA select DRIVERS_GENERIC_GPIO_KEYS + select CHROMEOS_WIFI_SAR if CHROMEOS
config BOARD_GOOGLE_QUANDISO select BOARD_GOOGLE_BASEBOARD_NISSA diff --git a/src/mainboard/google/brya/variants/pujjoga/Makefile.mk b/src/mainboard/google/brya/variants/pujjoga/Makefile.mk index 8ae0e3b..e04a887 100644 --- a/src/mainboard/google/brya/variants/pujjoga/Makefile.mk +++ b/src/mainboard/google/brya/variants/pujjoga/Makefile.mk @@ -4,4 +4,5 @@ romstage-y += gpio.c
ramstage-$(CONFIG_FW_CONFIG) += fw_config.c +ramstage-y += variant.c ramstage-y += gpio.c diff --git a/src/mainboard/google/brya/variants/pujjoga/overridetree.cb b/src/mainboard/google/brya/variants/pujjoga/overridetree.cb index cd55c66..2777a0e 100644 --- a/src/mainboard/google/brya/variants/pujjoga/overridetree.cb +++ b/src/mainboard/google/brya/variants/pujjoga/overridetree.cb @@ -4,6 +4,10 @@ option LTE_PRESENT 1 option 5G_PRESENT 2 end + field WIFI_SAR_ID 13 16 + option WIFI_SAR_TABLE_AX211 0 + option WIFI_SAR_TABLE_AX203 1 + end end
chip soc/intel/alderlake diff --git a/src/mainboard/google/brya/variants/pujjoga/variant.c b/src/mainboard/google/brya/variants/pujjoga/variant.c new file mode 100644 index 0000000..695f043 --- /dev/null +++ b/src/mainboard/google/brya/variants/pujjoga/variant.c @@ -0,0 +1,82 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <fw_config.h> +#include <baseboard/variants.h> +#include <baseboard/gpio.h> +#include <console/console.h> +#include <drivers/intel/gma/opregion.h> +#include <sar.h> +#include <delay.h> + +#define FM350_RST_DEALY_MS 20 +#define FM350_PERST_DEALY_MS 30 + +static const struct pad_config fm350_rst_pad[] = { + /* F12 : WWAN_RST_L */ + PAD_CFG_GPO_LOCK(GPP_F12, 1, LOCK_CONFIG), +}; +static const struct pad_config fm350_perst_pad[] = { + /* H21 : WWAN_PERST */ + PAD_CFG_GPO(GPP_H21, 1, DEEP), +}; + +void variant_update_soc_chip_config(struct soc_intel_alderlake_config *config) +{ + // Configure external V1P05/Vnn/VnnSx Rails for Pujjo, Pujjoflex + if (fw_config_probe(FW_CONFIG(EXT_VR, EXT_VR_PRESENT))) { + config->ext_fivr_settings.configure_ext_fivr = 1; + + config->ext_fivr_settings.v1p05_enable_bitmap = + FIVR_ENABLE_ALL_SX & ~FIVR_ENABLE_S0; + + config->ext_fivr_settings.vnn_enable_bitmap = + FIVR_ENABLE_ALL_SX; + + config->ext_fivr_settings.vnn_sx_enable_bitmap = + FIVR_ENABLE_ALL_SX; + + config->ext_fivr_settings.v1p05_supported_voltage_bitmap = + FIVR_VOLTAGE_NORMAL; + + config->ext_fivr_settings.vnn_supported_voltage_bitmap = + FIVR_VOLTAGE_MIN_ACTIVE; + + config->ext_fivr_settings.v1p05_voltage_mv = 1050; + config->ext_fivr_settings.vnn_voltage_mv = 780; + config->ext_fivr_settings.vnn_sx_voltage_mv = 1050; + config->ext_fivr_settings.v1p05_icc_max_ma = 500; + config->ext_fivr_settings.vnn_icc_max_ma = 500; + } +} + +const char *get_wifi_sar_cbfs_filename(void) +{ + return get_wifi_sar_fw_config_filename(FW_CONFIG_FIELD(WIFI_SAR_ID)); +} + +void variant_init(void) +{ + if (fw_config_probe(FW_CONFIG(WWAN_5G, WWAN_5G_PRESENT))) { + /* + * FM350 power on seuqence: + * De-assert WWAN_EN -> 20ms -> de-assert WWAN_RST -> 30ms -> + * de-assert WWAN_PERST + * WWAN_EN is de-asserted in ramstage gpio configuration, de-assert + * WWAN_RST and WWAN_PERST here. + */ + mdelay(FM350_RST_DEALY_MS); + gpio_configure_pads(fm350_rst_pad, ARRAY_SIZE(fm350_rst_pad)); + mdelay(FM350_PERST_DEALY_MS); + gpio_configure_pads(fm350_perst_pad, ARRAY_SIZE(fm350_perst_pad)); + } +} + +const char *mainboard_vbt_filename(void) +{ + if (fw_config_probe(FW_CONFIG(PANEL_IVO_BOE, IVO_BOE_PRESENT))) { + printk(BIOS_INFO, "Use vbt-pujjo1e.bin\n"); + return "vbt-pujjo1e.bin"; + } + printk(BIOS_INFO, "Use vbt.bin\n"); + return "vbt.bin"; +}