Joey Peng has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/57332 )
Change subject: mb/google/brya/variants/taeko: Update fw config for taeko ......................................................................
mb/google/brya/variants/taeko: Update fw config for taeko
Update customized fw config for taeko
BUG=b:194649740 TEST=FW_NAME=taeko emerge-brya coreboot chromeos-bootimage
Change-Id: Ifef750338d777b76e9710d6bca9a166120db6a0a --- A src/mainboard/google/brya/variants/taeko/fw_config.c M src/mainboard/google/brya/variants/taeko/overridetree.cb 2 files changed, 88 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/32/57332/1
diff --git a/src/mainboard/google/brya/variants/taeko/fw_config.c b/src/mainboard/google/brya/variants/taeko/fw_config.c new file mode 100644 index 0000000..7c9eb94 --- /dev/null +++ b/src/mainboard/google/brya/variants/taeko/fw_config.c @@ -0,0 +1,56 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <bootstate.h> +#include <console/console.h> +#include <fw_config.h> +#include <gpio.h> + +static const struct pad_config dmic_enable_pads[] = { + PAD_CFG_NF(GPP_S2, NONE, DEEP, NF2), /* DMIC_CLK0_R */ + PAD_CFG_NF(GPP_S3, NONE, DEEP, NF2), /* DMIC_DATA0_R */ + +}; + +static const struct pad_config dmic_disable_pads[] = { + PAD_NC(GPP_S2, NONE), + PAD_NC(GPP_S3, NONE), +}; + +static const struct pad_config i2s_enable_pads[] = { + PAD_CFG_NF(GPP_R0, NONE, DEEP, NF2), /* I2S_HP_SCLK_R */ + PAD_CFG_NF(GPP_R1, NONE, DEEP, NF2), /* I2S_HP_SFRM_R */ + PAD_CFG_NF(GPP_R2, DN_20K, DEEP, NF2), /* I2S_PCH_TX_HP_RX_STRAP */ + PAD_CFG_NF(GPP_R3, NONE, DEEP, NF2), /* I2S_PCH_RX_HP_TX */ + PAD_CFG_NF(GPP_R4, NONE, DEEP, NF2), /* I2S_SPKR_SCLK_R */ + PAD_CFG_NF(GPP_R5, NONE, DEEP, NF2), /* I2S_SPKR_SFRM_R */ + PAD_CFG_NF(GPP_R6, NONE, DEEP, NF2), /* I2S_PCH_TX_SPKR_RX_R */ + PAD_NC(GPP_R7, NONE), /* I2S_PCH_RX_SPKR_TX */ +}; + +static const struct pad_config i2s_disable_pads[] = { + PAD_NC(GPP_R0, NONE), + PAD_NC(GPP_R1, NONE), + PAD_NC(GPP_R2, NONE), + PAD_NC(GPP_R3, NONE), + PAD_NC(GPP_R4, NONE), + PAD_NC(GPP_R5, NONE), + PAD_NC(GPP_R6, NONE), + PAD_NC(GPP_R7, NONE), +}; + +static void fw_config_handle(void *unused) +{ + if (!fw_config_is_provisioned() || fw_config_probe(FW_CONFIG(AUDIO, AUDIO_UNKNOWN))) { + printk(BIOS_INFO, "Disable audio related GPIO pins.\n"); + gpio_configure_pads(i2s_disable_pads, ARRAY_SIZE(i2s_disable_pads)); + gpio_configure_pads(dmic_disable_pads, ARRAY_SIZE(dmic_disable_pads)); + return; + } + + if (fw_config_probe(FW_CONFIG(AUDIO, MAX98357_ALC5682I_I2S))) { + printk(BIOS_INFO, "Configure audio over I2S with MAX98357 ALC5682I.\n"); + gpio_configure_pads(dmic_enable_pads, ARRAY_SIZE(dmic_enable_pads)); + gpio_configure_pads(i2s_enable_pads, ARRAY_SIZE(i2s_enable_pads)); + } +} +BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL); diff --git a/src/mainboard/google/brya/variants/taeko/overridetree.cb b/src/mainboard/google/brya/variants/taeko/overridetree.cb index 87351e1..c64ec2b 100644 --- a/src/mainboard/google/brya/variants/taeko/overridetree.cb +++ b/src/mainboard/google/brya/variants/taeko/overridetree.cb @@ -1,3 +1,35 @@ +fw_config + field DB_USB 0 1 + option DB_USB_ABSENT 0 + option DB_USB3_NO_A 1 + end + field DB_SD 2 3 + option DB_SD_ABSENT 0 + option DB_SD_OZ711LV2LN 1 + end + field KB_BL 4 4 + option KB_BL_ABSENT 0 + option KB_BL_PRESENT 1 + end + field AUDIO 5 7 + option AUDIO_UNKNOWN 0 + option MAX98357_ALC5682I_I2S 1 + end + field KB_LAYOUT 8 9 + option KB_LAYOUT_DEFAULT 0 + end + field WIFI_SAR_ID 10 11 + option WIFI_SAR_ID_0 0 + end + field BOOT_DEVICE_EMMC 12 12 + option BOOT_EMMC_DISABLED 0 + option BOOT_EMMC_ENABLED 1 + end + field BOOT_DEVICE_NVME 13 13 + option BOOT_NVME_DISABLED 0 + option BOOT_NVME_ENABLED 1 + end +end chip soc/intel/alderlake register "usb2_ports[1]" = "USB2_PORT_EMPTY" # Disable Port 1 register "usb2_ports[2]" = "USB2_PORT_TYPE_C(OC2)" # DB USB2_C1