From 970249694f85dd4ee1fbffedc84bfda6c08a9c19 Mon Sep 17 00:00:00 2001 From: Nicholas Sudsgaard Date: Thu, 7 Aug 2025 09:18:03 +0900 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/88659 Reviewed-by: Matt DeVillier Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/mainboard/amd/bilby/Kconfig | 1 - src/mainboard/amd/bilby/hda_verb.c | 36 ++++++++++++++++++-------- src/mainboard/amd/mandolin/Kconfig | 1 - src/mainboard/amd/mandolin/hda_verb.c | 36 ++++++++++++++++++-------- src/mainboard/amd/pademelon/Kconfig | 1 - src/mainboard/amd/pademelon/hda_verb.c | 23 +++++++++------- 6 files changed, 64 insertions(+), 34 deletions(-) diff --git a/src/mainboard/amd/bilby/Kconfig b/src/mainboard/amd/bilby/Kconfig index be80b70c27..95732046b0 100644 --- a/src/mainboard/amd/bilby/Kconfig +++ b/src/mainboard/amd/bilby/Kconfig @@ -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 diff --git a/src/mainboard/amd/bilby/hda_verb.c b/src/mainboard/amd/bilby/hda_verb.c index b5c65e8098..7db6e172cd 100644 --- a/src/mainboard/amd/bilby/hda_verb.c +++ b/src/mainboard/amd/bilby/hda_verb.c @@ -2,12 +2,7 @@ #include -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; diff --git a/src/mainboard/amd/mandolin/Kconfig b/src/mainboard/amd/mandolin/Kconfig index 47d8debb68..ce3af3ba74 100644 --- a/src/mainboard/amd/mandolin/Kconfig +++ b/src/mainboard/amd/mandolin/Kconfig @@ -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 diff --git a/src/mainboard/amd/mandolin/hda_verb.c b/src/mainboard/amd/mandolin/hda_verb.c index b5c65e8098..7db6e172cd 100644 --- a/src/mainboard/amd/mandolin/hda_verb.c +++ b/src/mainboard/amd/mandolin/hda_verb.c @@ -2,12 +2,7 @@ #include -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; diff --git a/src/mainboard/amd/pademelon/Kconfig b/src/mainboard/amd/pademelon/Kconfig index 5a06a60bbe..b31971d95e 100644 --- a/src/mainboard/amd/pademelon/Kconfig +++ b/src/mainboard/amd/pademelon/Kconfig @@ -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 diff --git a/src/mainboard/amd/pademelon/hda_verb.c b/src/mainboard/amd/pademelon/hda_verb.c index 5bef966e75..447896142b 100644 --- a/src/mainboard/amd/pademelon/hda_verb.c +++ b/src/mainboard/amd/pademelon/hda_verb.c @@ -2,15 +2,7 @@ #include -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;