diff options
-rw-r--r-- | src/mainboard/intel/adlrvp/Kconfig | 3 | ||||
-rw-r--r-- | src/mainboard/intel/adlrvp/Makefile.inc | 1 | ||||
-rw-r--r-- | src/mainboard/intel/adlrvp/devicetree_m.cb | 44 | ||||
-rw-r--r-- | src/mainboard/intel/adlrvp/fw_config.c | 41 |
4 files changed, 88 insertions, 1 deletions
diff --git a/src/mainboard/intel/adlrvp/Kconfig b/src/mainboard/intel/adlrvp/Kconfig index 8ed37ab53a..8510c3831f 100644 --- a/src/mainboard/intel/adlrvp/Kconfig +++ b/src/mainboard/intel/adlrvp/Kconfig @@ -19,6 +19,9 @@ config BOARD_SPECIFIC_OPTIONS select HAVE_SPD_IN_CBFS select DRIVERS_SOUNDWIRE_ALC711 select SOC_INTEL_CSE_LITE_SKU + select DRIVERS_I2C_MAX98373 + select FW_CONFIG if BOARD_INTEL_ADLRVP_M_EXT_EC + select FW_CONFIG_SOURCE_CHROMEEC_CBI if BOARD_INTEL_ADLRVP_M_EXT_EC config CHROMEOS select GBB_FLAG_FORCE_DEV_SWITCH_ON diff --git a/src/mainboard/intel/adlrvp/Makefile.inc b/src/mainboard/intel/adlrvp/Makefile.inc index 609bed5e5e..ca9ba1445e 100644 --- a/src/mainboard/intel/adlrvp/Makefile.inc +++ b/src/mainboard/intel/adlrvp/Makefile.inc @@ -23,6 +23,7 @@ ramstage-$(CONFIG_CHROMEOS) += chromeos.c ramstage-y += ec.c ramstage-y += mainboard.c ramstage-y += board_id.c +ramstage-$(CONFIG_FW_CONFIG) += fw_config.c CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include diff --git a/src/mainboard/intel/adlrvp/devicetree_m.cb b/src/mainboard/intel/adlrvp/devicetree_m.cb index 34aee729ce..b29533662e 100644 --- a/src/mainboard/intel/adlrvp/devicetree_m.cb +++ b/src/mainboard/intel/adlrvp/devicetree_m.cb @@ -1,3 +1,9 @@ +fw_config + field AUDIO 8 10 + option NONE 0 + option ADL_MAX98373_ALC5682I_I2S 1 + end +end chip soc/intel/alderlake device cpu_cluster 0 on @@ -211,7 +217,43 @@ chip soc/intel/alderlake device generic 0 on end end end - device ref i2c0 on end + device ref i2c0 on + chip drivers/i2c/generic + register "hid" = ""10EC5682"" + register "name" = ""RT58"" + register "desc" = ""Headset Codec"" + register "irq" = "ACPI_IRQ_EDGE_HIGH(GPP_H3_IRQ)" + # Set the jd_src to RT5668_JD1 for jack detection + register "property_count" = "1" + register "property_list[0].type" = "ACPI_DP_TYPE_INTEGER" + register "property_list[0].name" = ""realtek,jd-src"" + register "property_list[0].integer" = "1" + device i2c 1a on + probe AUDIO ADL_MAX98373_ALC5682I_I2S + end + end + chip drivers/i2c/max98373 + register "vmon_slot_no" = "0" + register "imon_slot_no" = "1" + register "uid" = "0" + register "desc" = ""Right Speaker Amp"" + register "name" = ""MAXR"" + device i2c 31 on + probe AUDIO ADL_MAX98373_ALC5682I_I2S + end + end + chip drivers/i2c/max98373 + register "vmon_slot_no" = "2" + register "imon_slot_no" = "3" + register "uid" = "1" + register "desc" = ""Left Speaker Amp"" + register "name" = ""MAXL"" + device i2c 32 on + probe AUDIO ADL_MAX98373_ALC5682I_I2S + end + end + end + device ref i2c1 on chip drivers/intel/mipi_camera register "acpi_hid" = ""OVTI5675"" diff --git a/src/mainboard/intel/adlrvp/fw_config.c b/src/mainboard/intel/adlrvp/fw_config.c new file mode 100644 index 0000000000..8589bd8bdc --- /dev/null +++ b/src/mainboard/intel/adlrvp/fw_config.c @@ -0,0 +1,41 @@ +/* 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 i2s_enable_pads[] = { + /* Audio Codec INT N */ + PAD_CFG_GPI_APIC(GPP_H3, NONE, PLTRST, EDGE_BOTH, INVERT), + + /* I2S0_SCLK */ + PAD_CFG_NF(GPP_R0, NONE, DEEP, NF2), + /* I2S0_SFRM */ + PAD_CFG_NF(GPP_R1, NONE, DEEP, NF2), + /* I2S0_TXD */ + PAD_CFG_NF(GPP_R2, NONE, DEEP, NF2), + /* I2S0_RXD */ + PAD_CFG_NF(GPP_R3, NONE, DEEP, NF2), + + /* I2S2_SCLK */ + PAD_CFG_NF(GPP_R4, NONE, DEEP, NF2), + /* I2S2_SFRM */ + PAD_CFG_NF(GPP_R5, NONE, DEEP, NF2), + /* I2S2_TXD */ + PAD_CFG_NF(GPP_R6, NONE, DEEP, NF2), + /* I2S2_RXD */ + PAD_CFG_NF(GPP_R7, NONE, DEEP, NF2), + + /* I2S_MCLK1_OUT */ + PAD_CFG_NF(GPP_D19, NONE, DEEP, NF1), +}; + +static void fw_config_handle(void *unused) +{ + if (fw_config_probe(FW_CONFIG(AUDIO, ADL_MAX98373_ALC5682I_I2S))) { + printk(BIOS_INFO, "Configure GPIOs for I2S audio.\n"); + 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); |