nb/intel/haswell/minihd.c: Add reworked verb table implementation
This rework is done gradually, and that means different mainboards will
use different implementations of the verb table. As this code is used by
multiple mainboards we need to keep both implementations and select
whichever implementation matches the one being used by the mainboard
currently being built.
It should be noted that we do not modifiy the verb tables in any case,
as it would break the regression test script mentioned in the TEST
section below.
For an overall rationale for this rework, see CB:88656.
TEST=
1. Timeless build with AZALIA_USE_LEGACY_VERB_TABLE=y produces
identical binaries (tested with google/slippy_falcon)
2. Passed regression test (CB:88763)
Change-Id: I3bf8140a4ceb6edad71d57ab82e0a96f51159985
Signed-off-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88739
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
parent
69781b9806
commit
bc92d9a666
1 changed files with 51 additions and 2 deletions
|
|
@ -9,6 +9,7 @@
|
|||
#include <device/mmio.h>
|
||||
#include <southbridge/intel/lynxpoint/hda_verb.h>
|
||||
|
||||
#if CONFIG(AZALIA_USE_LEGACY_VERB_TABLE)
|
||||
static const u32 minihd_verb_table[] = {
|
||||
/* coreboot specific header */
|
||||
0x80862807, /* Codec Vendor / Device ID: Intel Haswell Mini-HD */
|
||||
|
|
@ -43,13 +44,56 @@ static const u32 minihd_verb_table[] = {
|
|||
0x00878100,
|
||||
0x00878100,
|
||||
};
|
||||
#else
|
||||
static const u32 display_audio_verbs[] = {
|
||||
/* Enable 3rd Pin and Converter Widget */
|
||||
0x00878101,
|
||||
|
||||
/* Pin Widget 5 - PORT B */
|
||||
0x00571c10,
|
||||
0x00571d00,
|
||||
0x00571e56,
|
||||
0x00571f18,
|
||||
|
||||
/* Pin Widget 6 - PORT C */
|
||||
0x00671c20,
|
||||
0x00671d00,
|
||||
0x00671e56,
|
||||
0x00671f18,
|
||||
|
||||
/* Pin Widget 7 - PORT D */
|
||||
0x00771c30,
|
||||
0x00771d00,
|
||||
0x00771e56,
|
||||
0x00771f18,
|
||||
|
||||
/* Disable 3rd Pin and Converter Widget */
|
||||
0x00878100,
|
||||
|
||||
/* Dummy entries to fill out the table */
|
||||
0x00878100,
|
||||
0x00878100,
|
||||
};
|
||||
|
||||
static struct azalia_codec minihd_codecs[] = {
|
||||
{
|
||||
.name = "Intel Display Audio (HDMI/DP)",
|
||||
.vendor_id = 0x80862807,
|
||||
.subsystem_id = 0x80860101,
|
||||
.address = 0,
|
||||
.verbs = display_audio_verbs,
|
||||
.verb_count = ARRAY_SIZE(display_audio_verbs),
|
||||
},
|
||||
{ /* terminator */ }
|
||||
};
|
||||
#endif
|
||||
|
||||
static void minihd_init(struct device *dev)
|
||||
{
|
||||
struct resource *res;
|
||||
u32 reg32;
|
||||
u8 *base;
|
||||
int codec_mask, i;
|
||||
int codec_mask;
|
||||
|
||||
/* Find base address */
|
||||
res = probe_resource(dev, PCI_BASE_ADDRESS_0);
|
||||
|
|
@ -76,13 +120,18 @@ static void minihd_init(struct device *dev)
|
|||
/* Init the codec and write the verb table */
|
||||
codec_mask = hda_codec_detect(base);
|
||||
|
||||
#if CONFIG(AZALIA_USE_LEGACY_VERB_TABLE)
|
||||
if (codec_mask) {
|
||||
for (i = 3; i >= 0; i--) {
|
||||
for (int i = 3; i >= 0; i--) {
|
||||
if (codec_mask & (1 << i))
|
||||
azalia_codec_init(base, i, minihd_verb_table,
|
||||
sizeof(minihd_verb_table));
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (codec_mask)
|
||||
azalia_custom_codecs_init(base, minihd_codecs, codec_mask);
|
||||
#endif
|
||||
}
|
||||
|
||||
static struct device_operations minihd_ops = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue