Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/28806
Change subject: soc/intel/.../hda: Add and use config for initialization of HDA codecs ......................................................................
soc/intel/.../hda: Add and use config for initialization of HDA codecs
Config option SOC_INTEL_COMMON_BLOCK_HDA is currently used for initialization of HDA codecs only. This prevents adding of any static devices under the HDA device node. However, there can be boards which want to add devices under HDA node without performing any codec initialization using the HDA. This change: 1. Adds a new config option SOC_INTEL_COMMON_BLOCK_HDA_VERB that can be set explicitly by the boards that want to perform code initialization. 2. Uses newly added config option is used to guard the initialization functions for the codec. Rest of the device operations can still be used by all the other boards without having to use HDA codec initialization. 3. Selects the newly added option SOC_INTEL_COMMON_BLOCK_HDA_VERB in kblrvp which was the only board enabling HDA codec initialization using common block code. 4. Original config SOC_INTEL_COMMON_BLOCK_HDA is selected for skylake SoC.
Above changes need to be bundled and pushed in as a single change in order to avoid breaking existing users.
BUG=b:112888584
Change-Id: Ie6f39c13a801833b283120a2d4b6f6175688999c Signed-off-by: Furquan Shaikh furquan@google.com --- M src/mainboard/intel/kblrvp/Kconfig M src/soc/intel/common/block/hda/Kconfig M src/soc/intel/common/block/hda/hda.c M src/soc/intel/skylake/Kconfig 4 files changed, 12 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/28806/1
diff --git a/src/mainboard/intel/kblrvp/Kconfig b/src/mainboard/intel/kblrvp/Kconfig index aed8297..bf17c4b 100644 --- a/src/mainboard/intel/kblrvp/Kconfig +++ b/src/mainboard/intel/kblrvp/Kconfig @@ -8,7 +8,7 @@ select HAVE_ACPI_TABLES select HAVE_OPTION_TABLE select HAVE_SMI_HANDLER - select SOC_INTEL_COMMON_BLOCK_HDA if BOARD_INTEL_KBLRVP3 || BOARD_INTEL_KBLRVP7 + select SOC_INTEL_COMMON_BLOCK_HDA_VERB if BOARD_INTEL_KBLRVP3 || BOARD_INTEL_KBLRVP7 select SOC_INTEL_SKYLAKE select SKYLAKE_SOC_PCH_H if BOARD_INTEL_KBLRVP8 select MAINBOARD_USES_FSP2_0 diff --git a/src/soc/intel/common/block/hda/Kconfig b/src/soc/intel/common/block/hda/Kconfig index ca415bc..a2209ab 100644 --- a/src/soc/intel/common/block/hda/Kconfig +++ b/src/soc/intel/common/block/hda/Kconfig @@ -2,3 +2,9 @@ bool help Intel Processor common High Definition Audio driver support + +config SOC_INTEL_COMMON_BLOCK_HDA_VERB + bool + depends on SOC_INTEL_COMMON_BLOCK_HDA + help + Enable initialization of HDA codecs. diff --git a/src/soc/intel/common/block/hda/hda.c b/src/soc/intel/common/block/hda/hda.c index 3f87fcc..97efba2 100644 --- a/src/soc/intel/common/block/hda/hda.c +++ b/src/soc/intel/common/block/hda/hda.c @@ -22,6 +22,7 @@ #include <soc/intel/common/hda_verb.h> #include <soc/ramstage.h>
+#if IS_ENABLED(CONFIG_SOC_INTEL_COMMON_BLOCK_HDA_VERB) static void codecs_init(uint8_t *base, u32 codec_mask) { int i; @@ -57,12 +58,15 @@ codecs_init(base, codec_mask); } } +#endif
static struct device_operations hda_ops = { .read_resources = &pci_dev_read_resources, .set_resources = &pci_dev_set_resources, .enable_resources = &pci_dev_enable_resources, +#if IS_ENABLED(CONFIG_SOC_INTEL_COMMON_BLOCK_HDA_VERB) .init = &hda_init, +#endif .ops_pci = &pci_dev_ops_pci, };
diff --git a/src/soc/intel/skylake/Kconfig b/src/soc/intel/skylake/Kconfig index 6a5dc07..e368dec 100644 --- a/src/soc/intel/skylake/Kconfig +++ b/src/soc/intel/skylake/Kconfig @@ -61,6 +61,7 @@ select SOC_INTEL_COMMON_BLOCK_GPIO_LEGACY_MACROS select SOC_INTEL_COMMON_BLOCK_GPIO_PADCFG_PADTOL select SOC_INTEL_COMMON_BLOCK_GSPI + select SOC_INTEL_COMMON_BLOCK_HDA select SOC_INTEL_COMMON_BLOCK_SA select SOC_INTEL_COMMON_BLOCK_SGX select SOC_INTEL_COMMON_BLOCK_SMM