From 2e387e13f51ce107a89c53fa7b1b3bb9a630a86f Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Sun, 27 Apr 2025 00:02:30 +0530 Subject: [PATCH] mb/google/fatcat/var/francka: Conditionally init HDA This commit implements `mainboard_is_hda_codec_enabled` for the Google Francka mainboard variant. This overrides the default weak HDA common initialization. Initialization of the High Definition Audio (HDA) controller, managed by `azalia_audio_init()` (which handles HDA verb table loading), is now conditional. It proceeds only if the firmware config `FW_CONFIG(AUDIO, AUDIO_ALC256M_CG_HDA)` is set. This targets the ALC256M-CG HDA codec. This change ensures that HDA verb tables are loaded only when the ALC256M-CG HDA codec is actively configured for the Francka variant. Crucially, this prevents attempts to incorrectly load HDA verbs for other audio interfaces, like SoundWire (SNDW), which might be present in different Francka hardware configurations. The header `intelblocks/hda.h` added to support this HDA initialization logic. BUG=b:ENTER_FRANCKA_BUG_ID_HERE TEST=Verified HDA verb table loading is skipped on Francka platforms when configured with non-HDA audio codecs (e.g., SNDW), and proceeds as expected when ALC256M-CG HDA is configured Change-Id: Idbc506c1ad180c7e8ecdec51c3491e6f0518204c Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/87463 Tested-by: build bot (Jenkins) Reviewed-by: Pranava Y N Reviewed-by: Kapil Porwal --- .../google/fatcat/variants/francka/variant.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/mainboard/google/fatcat/variants/francka/variant.c b/src/mainboard/google/fatcat/variants/francka/variant.c index 0943ee18be..1ca6e41125 100644 --- a/src/mainboard/google/fatcat/variants/francka/variant.c +++ b/src/mainboard/google/fatcat/variants/francka/variant.c @@ -3,6 +3,7 @@ #include #include #include +#include void variant_update_soc_memory_init_params(FSPM_UPD *memupd) { @@ -15,3 +16,22 @@ void variant_update_soc_memory_init_params(FSPM_UPD *memupd) m_cfg->PchHdaSdiEnable[1] = false; } } + +/* + * HDA verb table loading is supported based on the firmware configuration. + * + * This function determines if the current platform has an HDA codec enabled by + * examining the `FW_CONFIG` value. Specifically, it checks if the + * `FW_CONFIG` includes the `AUDIO_ALC256M_CG_HDA` value, which is used to identify + * Francka SKUs with HDA codec support. + * + * Return true if the `FW_CONFIG` indicates HDA support (i.e., contains + * `AUDIO_ALC256M_CG_HDA`), false otherwise. + */ +bool mainboard_is_hda_codec_enabled(void) +{ + if (fw_config_probe(FW_CONFIG(AUDIO, AUDIO_ALC256M_CG_HDA))) + return true; + + return false; +}