aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2021-02-16 10:10:53 +0100
committerFelix Held <felix-coreboot@felixheld.de>2021-04-28 16:32:34 +0000
commit985009ad140698f92dc0fdf47622e2f759f13e6a (patch)
treeb4726fdc0cbe410a987e4d74f3a506b94cc8f838
parentb46ec389bd5606327b72142a4a1dcf5d3a271381 (diff)
soc/intel/common/block/hda: Use azalia device code
The code is already compiled in on all platforms. Use it as it provides the same functionality. Note that GCAP is no longer R/WO on these platforms. However, select `AZALIA_LOCK_DOWN_R_WO_GCAP` just in case. This will be dropped in a follow-up. Tested on Prodrive Hermes, still detects and initializes both codecs. Change-Id: I75424559b2b4aca63fb23bf4f8d5074aa1e1bb31 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/50795 Reviewed-by: Christian Walter <christian.walter@9elements.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/soc/intel/common/block/hda/Kconfig4
-rw-r--r--src/soc/intel/common/block/hda/hda.c41
2 files changed, 6 insertions, 39 deletions
diff --git a/src/soc/intel/common/block/hda/Kconfig b/src/soc/intel/common/block/hda/Kconfig
index a2209ab3ce..a01ede4ac6 100644
--- a/src/soc/intel/common/block/hda/Kconfig
+++ b/src/soc/intel/common/block/hda/Kconfig
@@ -6,5 +6,9 @@ config SOC_INTEL_COMMON_BLOCK_HDA
config SOC_INTEL_COMMON_BLOCK_HDA_VERB
bool
depends on SOC_INTEL_COMMON_BLOCK_HDA
+ select AZALIA_LOCK_DOWN_R_WO_GCAP
help
Enable initialization of HDA codecs.
+
+config AZALIA_MAX_CODECS
+ default 4 if SOC_INTEL_COMMON_BLOCK_HDA_VERB
diff --git a/src/soc/intel/common/block/hda/hda.c b/src/soc/intel/common/block/hda/hda.c
index ece06caaeb..3aa2ad78bc 100644
--- a/src/soc/intel/common/block/hda/hda.c
+++ b/src/soc/intel/common/block/hda/hda.c
@@ -1,58 +1,21 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-#include <console/console.h>
#include <device/device.h>
#include <device/azalia_device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
-#include <soc/intel/common/hda_verb.h>
-#include <soc/ramstage.h>
-
-#if CONFIG(SOC_INTEL_COMMON_BLOCK_HDA_VERB)
-static void codecs_init(uint8_t *base, u32 codec_mask)
-{
- int i;
-
- /* Can support up to 4 codecs */
- for (i = 3; i >= 0; i--) {
- if (codec_mask & (1 << i))
- hda_codec_init(base, i,
- cim_verb_data_size, cim_verb_data);
- }
-
- if (pc_beep_verbs_size)
- hda_codec_write(base, pc_beep_verbs_size, pc_beep_verbs);
-}
static void hda_init(struct device *dev)
{
- struct resource *res;
- int codec_mask;
- uint8_t *base;
-
- res = find_resource(dev, PCI_BASE_ADDRESS_0);
- if (!res)
- return;
-
- base = res2mmio(res, 0, 0);
- if (!base)
- return;
-
- codec_mask = hda_codec_detect(base);
- if (codec_mask) {
- printk(BIOS_INFO, "HDA: codec_mask = %02x\n", codec_mask);
- codecs_init(base, codec_mask);
- }
+ if (CONFIG(SOC_INTEL_COMMON_BLOCK_HDA_VERB))
+ azalia_audio_init(dev);
}
-#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 CONFIG(SOC_INTEL_COMMON_BLOCK_HDA_VERB)
.init = hda_init,
-#endif
.ops_pci = &pci_dev_ops_pci,
.scan_bus = scan_static_bus
};