From 94beaa7ab313b1f790a41336288e75483ec2180a Mon Sep 17 00:00:00 2001 From: Nicholas Sudsgaard Date: Thu, 7 Aug 2025 09:17:53 +0900 Subject: [PATCH] mb/acer: Replace verb tables with reworked implementation Some boards did not provide the chip name for the audio codecs in the comments, and were therefore identified using external sources: g43t-am3: - 0x10ec0888 -> Realtek ALC888[1] The Kconfigs were reverted using the following command: find src/mainboard/acer -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. References: [1] coreboot board status: kernel_log.txt TEST= All boards passed regression test (CB:88763) Change-Id: I36cccc7033b3df523ff1c0d1891ef194090fe50e Signed-off-by: Nicholas Sudsgaard Reviewed-on: https://review.coreboot.org/c/coreboot/+/88658 Reviewed-by: Matt DeVillier Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/mainboard/acer/aspire_vn7_572g/Kconfig | 1 - src/mainboard/acer/aspire_vn7_572g/hda_verb.c | 32 ++++++++++++----- src/mainboard/acer/g43t-am3/Kconfig | 1 - src/mainboard/acer/g43t-am3/hda_verb.c | 36 ++++++++++++------- 4 files changed, 46 insertions(+), 24 deletions(-) diff --git a/src/mainboard/acer/aspire_vn7_572g/Kconfig b/src/mainboard/acer/aspire_vn7_572g/Kconfig index 166b9435af..cee7b7ec0a 100644 --- a/src/mainboard/acer/aspire_vn7_572g/Kconfig +++ b/src/mainboard/acer/aspire_vn7_572g/Kconfig @@ -4,7 +4,6 @@ if BOARD_ACER_VN7_572G config BOARD_SPECIFIC_OPTIONS def_bool y - select AZALIA_USE_LEGACY_VERB_TABLE select BOARD_ROMSIZE_KB_8192 select DRIVERS_I2C_HID select DRIVERS_USB_ACPI diff --git a/src/mainboard/acer/aspire_vn7_572g/hda_verb.c b/src/mainboard/acer/aspire_vn7_572g/hda_verb.c index 20197d1d22..233e72d9fb 100644 --- a/src/mainboard/acer/aspire_vn7_572g/hda_verb.c +++ b/src/mainboard/acer/aspire_vn7_572g/hda_verb.c @@ -4,12 +4,8 @@ #include -const u32 cim_verb_data[] = { +static const u32 realtek_alc255_verbs[] = { /* --- Codec #0 --- */ - /* coreboot specific header */ - 0x10ec0255, /* Codec Vendor / Device ID: Realtek ALC255 */ - 0x10251037, /* Subsystem ID */ - 20, /* Number of jacks (NID entries) */ /* Codec Address: Bits 31:28 */ /* Node ID: Bits 27:20 */ @@ -81,12 +77,10 @@ const u32 cim_verb_data[] = { 0x01470740, /* Repeated for units? */ 0x02050010, /* Set coeff idx: 0x10 */ 0x02040f20, /* Set processing coeff: 0xf20 */ +}; +static const u32 intel_display_audio_verbs[] = { /* --- Codec #2 --- */ - /* coreboot specific header */ - 0x80862809, /* Codec Vendor / Device ID: Intel Skylake HDMI */ - 0x80860101, /* Subsystem ID */ - 5, /* Number of jacks (NID entries) */ /* Codec Address: Bits 31:28 */ /* Node ID: Bits 27:20 */ @@ -115,4 +109,24 @@ const u32 cim_verb_data[] = { const u32 pc_beep_verbs[] = {}; +struct azalia_codec mainboard_azalia_codecs[] = { + { + .name = "Realtek ALC255", + .vendor_id = 0x10ec0255, + .subsystem_id = 0x10251037, + .address = 0, + .verbs = realtek_alc255_verbs, + .verb_count = ARRAY_SIZE(realtek_alc255_verbs), + }, + { + .name = "Intel Display Audio (HDMI/DP)", + .vendor_id = 0x80862809, + .subsystem_id = 0x80860101, + .address = 2, + .verbs = intel_display_audio_verbs, + .verb_count = ARRAY_SIZE(intel_display_audio_verbs), + }, + { /* terminator */ } +}; + AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/acer/g43t-am3/Kconfig b/src/mainboard/acer/g43t-am3/Kconfig index 466c5b9bf4..77ce9d4ca1 100644 --- a/src/mainboard/acer/g43t-am3/Kconfig +++ b/src/mainboard/acer/g43t-am3/Kconfig @@ -4,7 +4,6 @@ if BOARD_ACER_G43T_AM3 || BOARD_ACER_Q45T_AM config BOARD_SPECIFIC_OPTIONS def_bool y - select AZALIA_USE_LEGACY_VERB_TABLE select CPU_INTEL_SOCKET_LGA775 select NORTHBRIDGE_INTEL_X4X select SOUTHBRIDGE_INTEL_I82801JX diff --git a/src/mainboard/acer/g43t-am3/hda_verb.c b/src/mainboard/acer/g43t-am3/hda_verb.c index a47fe03865..38db6eb941 100644 --- a/src/mainboard/acer/g43t-am3/hda_verb.c +++ b/src/mainboard/acer/g43t-am3/hda_verb.c @@ -2,14 +2,7 @@ #include -const u32 cim_verb_data[] = { - /* coreboot specific header */ - 0x10ec0888, - 0x1025024c, // Subsystem ID - 14, // Number of entries - - /* Pin Widget Verb Table */ - +static const u32 realtek_alc888_verbs[] = { AZALIA_PIN_CFG(0, 0x11, 0x014b7140), AZALIA_PIN_CFG(0, 0x12, AZALIA_PIN_CFG_NC(0)), AZALIA_PIN_CFG(0, 0x14, 0x01014010), @@ -24,15 +17,32 @@ const u32 cim_verb_data[] = { AZALIA_PIN_CFG(0, 0x1d, AZALIA_PIN_CFG_NC(0)), AZALIA_PIN_CFG(0, 0x1e, 0x18567130), AZALIA_PIN_CFG(0, 0x1f, AZALIA_PIN_CFG_NC(0)), +}; - /* HDMI */ - 0x80862803, - 0x80860101, - 1, - +static const u32 intel_display_audio_verbs[] = { AZALIA_PIN_CFG(0, 0x03, 0x18560010) }; const u32 pc_beep_verbs[0] = {}; +struct azalia_codec mainboard_azalia_codecs[] = { + { + .name = "Realtek ALC888", + .vendor_id = 0x10ec0888, + .subsystem_id = 0x1025024c, + .address = 0, + .verbs = realtek_alc888_verbs, + .verb_count = ARRAY_SIZE(realtek_alc888_verbs), + }, + { + .name = "Intel Display Audio (HDMI/DP)", + .vendor_id = 0x80862803, + .subsystem_id = 0x80860101, + .address = 0, + .verbs = intel_display_audio_verbs, + .verb_count = ARRAY_SIZE(intel_display_audio_verbs), + }, + { /* terminator */ } +}; + AZALIA_ARRAY_SIZES;