mb/amd: Replace verb tables with reworked implementation

No modifications/assumptions about the codecs were made on these boards.

The Kconfigs were reverted using the following command:
  find src/mainboard/amd -name 'Kconfig' | xargs git checkout main

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= All boards passed regression test (CB:88763)

Change-Id: Ie8dcff7caa24ec9f671159ea39a46989a98a6fbc
Signed-off-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88659
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:
Nicholas Sudsgaard 2025-08-07 09:18:03 +09:00 committed by Matt DeVillier
commit 970249694f
6 changed files with 64 additions and 34 deletions

View file

@ -4,7 +4,6 @@ if BOARD_AMD_BILBY
config BOARD_SPECIFIC_OPTIONS
def_bool y
select AZALIA_USE_LEGACY_VERB_TABLE
select SOC_AMD_PICASSO
select BOARD_ROMSIZE_KB_16384
select AZALIA_HDA_CODEC_SUPPORT

View file

@ -2,12 +2,7 @@
#include <device/azalia_device.h>
const u32 cim_verb_data[] = {
/* Realtek ALC701 on mainboard */
0x10ec0701,
0x00000000,
0x00000016,
static const u32 realtek_alc701_verbs[] = {
AZALIA_SUBVENDOR(0, 0x1022D001), // HDA Codec Subsystem ID: 0x1022D001
AZALIA_RESET(1), // Widget node 0x01 :
@ -34,12 +29,9 @@ const u32 cim_verb_data[] = {
0x0205004a, 0x0204201b, 0x0205004a, 0x0204201b, // NID 0x20 - 2
0x02050010, 0x02040420, 0x01470c00, 0x02050036, // Dos beep path - 1
0x02047151, 0x01470740, 0x0143b000, 0x01470c02, // Dos beep path - 2
};
/* Realtek ALC285 on extension card */
0x10ec0285,
0x00000000,
0x00000028,
static const u32 realtek_alc285_verbs[] = {
AZALIA_SUBVENDOR(0, 0x1022D002),
AZALIA_RESET(1), // Widget node 0x01 :
@ -94,4 +86,26 @@ const u32 cim_verb_data[] = {
const u32 pc_beep_verbs[] = {
};
struct azalia_codec mainboard_azalia_codecs[] = {
{
/* Realtek ALC701 on mainboard */
.name = "Realtek ALC701",
.vendor_id = 0x10ec0701,
.subsystem_id = 0x00000000,
.address = 0,
.verbs = realtek_alc701_verbs,
.verb_count = ARRAY_SIZE(realtek_alc701_verbs),
},
{
/* Realtek ALC285 on extension card */
.name = "Realtek ALC285",
.vendor_id = 0x10ec0285,
.subsystem_id = 0x00000000,
.address = 0,
.verbs = realtek_alc285_verbs,
.verb_count = ARRAY_SIZE(realtek_alc285_verbs),
},
{ /* terminator */ }
};
AZALIA_ARRAY_SIZES;

View file

@ -4,7 +4,6 @@ if BOARD_AMD_MANDOLIN || BOARD_AMD_CEREME
config BOARD_SPECIFIC_OPTIONS
def_bool y
select AZALIA_USE_LEGACY_VERB_TABLE
select SOC_AMD_COMMON_BLOCK_USE_ESPI
select SOC_AMD_PICASSO
select BOARD_ROMSIZE_KB_8192 if BOARD_AMD_MANDOLIN

View file

@ -2,12 +2,7 @@
#include <device/azalia_device.h>
const u32 cim_verb_data[] = {
/* Realtek ALC701 on mainboard */
0x10ec0701,
0x00000000,
0x00000016,
static const u32 realtek_alc701_verbs[] = {
AZALIA_SUBVENDOR(0, 0x1022D001), // HDA Codec Subsystem ID: 0x1022D001
AZALIA_RESET(1), // Widget node 0x01 :
@ -34,12 +29,9 @@ const u32 cim_verb_data[] = {
0x0205004a, 0x0204201b, 0x0205004a, 0x0204201b, // NID 0x20 - 2
0x02050010, 0x02040420, 0x01470c00, 0x02050036, // Dos beep path - 1
0x02047151, 0x01470740, 0x0143b000, 0x01470c02, // Dos beep path - 2
};
/* Realtek ALC285 on extension card */
0x10ec0285,
0x00000000,
0x00000028,
static const u32 realtek_alc285_verbs[] = {
AZALIA_SUBVENDOR(0, 0x1022D002),
AZALIA_RESET(1), // Widget node 0x01 :
@ -94,4 +86,26 @@ const u32 cim_verb_data[] = {
const u32 pc_beep_verbs[] = {
};
struct azalia_codec mainboard_azalia_codecs[] = {
{
/* Realtek ALC701 on mainboard */
.name = "Realtek ALC701",
.vendor_id = 0x10ec0701,
.subsystem_id = 0x00000000,
.address = 0,
.verbs = realtek_alc701_verbs,
.verb_count = ARRAY_SIZE(realtek_alc701_verbs),
},
{
/* Realtek ALC285 on extension card */
.name = "Realtek ALC285",
.vendor_id = 0x10ec0285,
.subsystem_id = 0x00000000,
.address = 0,
.verbs = realtek_alc285_verbs,
.verb_count = ARRAY_SIZE(realtek_alc285_verbs),
},
{ /* terminator */ }
};
AZALIA_ARRAY_SIZES;

View file

@ -4,7 +4,6 @@ if BOARD_AMD_PADEMELON
config BOARD_SPECIFIC_OPTIONS
def_bool y
select AZALIA_USE_LEGACY_VERB_TABLE
select SOC_AMD_STONEYRIDGE
select AMD_APU_PKG_FP4
select BOARD_ROMSIZE_KB_8192

View file

@ -2,15 +2,7 @@
#include <device/azalia_device.h>
const u32 cim_verb_data[] = {
/* coreboot specific header */
/* Realtek ALC662 rev1 */
0x10ec0662, /* Vendor ID */
0x80865756, /* Subsystem ID */
10, /* Number of entries */
/* Pin Widget Verb Table */
static const u32 realtek_alc662_verbs[] = {
AZALIA_PIN_CFG(0, 0x14, 0x01014010),
AZALIA_PIN_CFG(0, 0x15, AZALIA_PIN_CFG_NC(0)),
AZALIA_PIN_CFG(0, 0x16, AZALIA_PIN_CFG_NC(0)),
@ -23,6 +15,19 @@ const u32 cim_verb_data[] = {
AZALIA_PIN_CFG(0, 0x1e, 0x01441130),
};
const u32 pc_beep_verbs[0] = {};
struct azalia_codec mainboard_azalia_codecs[] = {
{
.name = "Realtek ALC662",
.vendor_id = 0x10ec0662,
.subsystem_id = 0x80865756,
.address = 0,
.verbs = realtek_alc662_verbs,
.verb_count = ARRAY_SIZE(realtek_alc662_verbs),
},
{ /* terminator */ }
};
AZALIA_ARRAY_SIZES;