soc/intel/ptl: Update ME specification version to 21
[coreboot.git] / src / mainboard / google / brya / variants / kuldax / fw_config.c
blob42613af16316c1b6e2b2ca819087a3c7705f3268
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <bootstate.h>
4 #include <console/console.h>
5 #include <fw_config.h>
6 #include <gpio.h>
8 static const struct pad_config dmic_enable_pads[] = {
9 PAD_CFG_NF(GPP_R6, NONE, DEEP, NF3), /* DMIC_CLK1_R */
10 PAD_CFG_NF(GPP_R7, NONE, DEEP, NF3), /* DMIC_DATA1_R */
13 static const struct pad_config dmic_disable_pads[] = {
14 PAD_NC(GPP_R6, NONE),
15 PAD_NC(GPP_R7, NONE),
18 static const struct pad_config i2s_enable_pads[] = {
19 PAD_CFG_NF(GPP_R0, NONE, DEEP, NF2), /* I2S_HP_SCLK_R */
20 PAD_CFG_NF(GPP_R1, NONE, DEEP, NF2), /* I2S_HP_SFRM_R */
21 PAD_CFG_NF(GPP_R2, DN_20K, DEEP, NF2), /* I2S_PCH_TX_HP_RX_STRAP */
22 PAD_CFG_NF(GPP_R3, NONE, DEEP, NF2), /* I2S_PCH_RX_HP_TX */
25 static const struct pad_config i2s_disable_pads[] = {
26 PAD_NC(GPP_R0, NONE),
27 PAD_NC(GPP_R1, NONE),
28 PAD_NC(GPP_R2, NONE),
29 PAD_NC(GPP_R3, NONE),
32 static const struct pad_config bt_i2s_enable_pads[] = {
33 PAD_CFG_NF(GPP_VGPIO_30, NONE, DEEP, NF3), /* BT_I2S_BCLK */
34 PAD_CFG_NF(GPP_VGPIO_31, NONE, DEEP, NF3), /* BT_I2S_SYNC */
35 PAD_CFG_NF(GPP_VGPIO_32, NONE, DEEP, NF3), /* BT_I2S_SDO */
36 PAD_CFG_NF(GPP_VGPIO_33, NONE, DEEP, NF3), /* BT_I2S_SDI */
37 PAD_CFG_NF(GPP_VGPIO_34, NONE, DEEP, NF1), /* SSP2_SCLK */
38 PAD_CFG_NF(GPP_VGPIO_35, NONE, DEEP, NF1), /* SSP2_SFRM */
39 PAD_CFG_NF(GPP_VGPIO_36, NONE, DEEP, NF1), /* SSP_TXD */
40 PAD_CFG_NF(GPP_VGPIO_37, NONE, DEEP, NF1), /* SSP_RXD */
43 static const struct pad_config bt_i2s_disable_pads[] = {
44 PAD_NC(GPP_VGPIO_30, NONE),
45 PAD_NC(GPP_VGPIO_31, NONE),
46 PAD_NC(GPP_VGPIO_32, NONE),
47 PAD_NC(GPP_VGPIO_33, NONE),
48 PAD_NC(GPP_VGPIO_34, NONE),
49 PAD_NC(GPP_VGPIO_35, NONE),
50 PAD_NC(GPP_VGPIO_36, NONE),
51 PAD_NC(GPP_VGPIO_37, NONE),
54 static void fw_config_handle(void *unused)
56 if (!fw_config_is_provisioned() || fw_config_probe(FW_CONFIG(AUDIO, AUDIO_UNKNOWN))) {
57 printk(BIOS_INFO, "Disable audio related GPIO pins.\n");
58 gpio_configure_pads(i2s_disable_pads, ARRAY_SIZE(i2s_disable_pads));
59 gpio_configure_pads(dmic_disable_pads, ARRAY_SIZE(dmic_disable_pads));
60 gpio_configure_pads(bt_i2s_disable_pads, ARRAY_SIZE(bt_i2s_disable_pads));
61 return;
64 if (fw_config_probe(FW_CONFIG(AUDIO, NAU88L25B_I2S))) {
65 printk(BIOS_INFO, "Configure audio over I2S with NAU88L25B.\n");
66 gpio_configure_pads(dmic_enable_pads, ARRAY_SIZE(dmic_enable_pads));
67 gpio_configure_pads(i2s_enable_pads, ARRAY_SIZE(i2s_enable_pads));
68 printk(BIOS_INFO, "BT offload enabled\n");
69 gpio_configure_pads(bt_i2s_enable_pads, ARRAY_SIZE(bt_i2s_enable_pads));
70 } else {
71 printk(BIOS_INFO, "BT offload disabled\n");
72 gpio_configure_pads(bt_i2s_disable_pads, ARRAY_SIZE(bt_i2s_disable_pads));
75 BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL);