mb/purism: 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/purism -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: I2ee7a93392a57e8194cc8116c3fc55116336234f
Signed-off-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88686
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Nicholas Sudsgaard 2025-08-07 09:25:42 +09:00 committed by Matt DeVillier
commit f634121fa4
9 changed files with 102 additions and 49 deletions

View file

@ -2,7 +2,6 @@
config BOARD_PURISM_BASEBOARD_LIBREM_BDW
def_bool n
select AZALIA_USE_LEGACY_VERB_TABLE
select SYSTEM_TYPE_LAPTOP
select BOARD_ROMSIZE_KB_8192
select HAVE_ACPI_RESUME

View file

@ -2,12 +2,7 @@
#include <device/azalia_device.h>
const u32 cim_verb_data[] = {
/* coreboot specific header */
0x10ec0269, /* Codec Vendor / Device ID: Realtek ALC269 */
0x19910269, /* Subsystem ID */
12, /* Number of jacks (NID entries) */
static const u32 realtek_alc269_verbs[] = {
AZALIA_RESET(1),
AZALIA_SUBVENDOR(0, 0x19910269),
AZALIA_PIN_CFG(0, 0x12, 0x40000000),
@ -24,4 +19,15 @@ const u32 cim_verb_data[] = {
const u32 pc_beep_verbs[] = {};
struct azalia_codec mainboard_azalia_codecs[] = {
{
.name = "Realtek ALC269",
.vendor_id = 0x10ec0269,
.subsystem_id = 0x19910269,
.address = 0,
.verbs = realtek_alc269_verbs,
.verb_count = ARRAY_SIZE(realtek_alc269_verbs),
},
};
AZALIA_ARRAY_SIZES;

View file

@ -2,7 +2,6 @@
config BOARD_PURISM_BASEBOARD_LIBREM_CNL
def_bool n
select AZALIA_USE_LEGACY_VERB_TABLE
select BOARD_ROMSIZE_KB_16384
select DRIVERS_GENERIC_CBFS_SERIAL
select DRIVERS_USB_ACPI

View file

@ -4,12 +4,7 @@
#include <ec/purism/librem-ec/librem_ec.h>
#include <console/console.h>
const u32 cim_verb_data[] = {
/* Board revision 01 has ALC256 */
0x10ec0256, /* Codec Vendor/Device ID: Realtek ALC256 */
0x10ec0256, /* Subsystem ID */
16, /* Number of entries */
static const u32 realtek_alc256_verbs[] = {
AZALIA_RESET(0x1),
AZALIA_SUBVENDOR(0, 0x10ec0256),
@ -47,12 +42,9 @@ const u32 cim_verb_data[] = {
0x02046901,
0x02050007,
0x02040200,
};
/* Board revision 02 has ALC269 */
0x10ec0269, /* Codec Vendor/Device ID: Realtek ALC269 */
0x10ec0269, /* Subsystem ID */
16, /* Number of entries */
static const u32 realtek_alc269_verbs[] = {
AZALIA_RESET(0x1),
AZALIA_SUBVENDOR(0, 0x10ec129e),
@ -86,11 +78,9 @@ const u32 cim_verb_data[] = {
0x020400AF,
0x02050005,
0x020400C0,
};
0x8086280b, /* Codec Vendor/Device ID: Intel CometPoint HDMI */
0x80860101, /* Subsystem ID */
4, /* Number of entries */
static const u32 intel_display_audio_verbs[] = {
AZALIA_SUBVENDOR(2, 0x80860101),
AZALIA_PIN_CFG(2, 0x05, 0x18560010),
AZALIA_PIN_CFG(2, 0x06, 0x18560010),
@ -99,6 +89,35 @@ const u32 cim_verb_data[] = {
const u32 pc_beep_verbs[] = {};
struct azalia_codec mainboard_azalia_codecs[] = {
{
/* Board revision 01 has ALC256 */
.name = "Realtek ALC256",
.vendor_id = 0x10ec0256,
.subsystem_id = 0x10ec0256,
.address = 0,
.verbs = realtek_alc256_verbs,
.verb_count = ARRAY_SIZE(realtek_alc256_verbs),
},
{
/* Board revision 02 has ALC269 */
.name = "Realtek ALC269",
.vendor_id = 0x10ec0269,
.subsystem_id = 0x10ec0269,
.address = 0,
.verbs = realtek_alc269_verbs,
.verb_count = ARRAY_SIZE(realtek_alc269_verbs),
},
{
.name = "Intel Display Audio (HDMI/DP)",
.vendor_id = 0x8086280b,
.subsystem_id = 0x80860101,
.address = 2,
.verbs = intel_display_audio_verbs,
.verb_count = ARRAY_SIZE(intel_display_audio_verbs),
},
};
AZALIA_ARRAY_SIZES;
/* Older ALC256 verbs with no jack detect - needed if an older Librem EC is in

View file

@ -2,11 +2,7 @@
#include <device/azalia_device.h>
const u32 cim_verb_data[] = {
0x10ec0269, /* Codec Vendor/Device ID: Realtek ALC269 */
0x10ec0269, /* Subsystem ID */
12, /* Number of entries */
static const u32 realtek_alc269_verbs[] = {
AZALIA_RESET(0x1),
AZALIA_SUBVENDOR(0, 0x10ec0269),
@ -20,11 +16,9 @@ const u32 cim_verb_data[] = {
AZALIA_PIN_CFG(0, 0x1b, AZALIA_PIN_CFG_NC(0)), /* NC */
AZALIA_PIN_CFG(0, 0x1d, AZALIA_PIN_CFG_NC(0)), /* NC */
AZALIA_PIN_CFG(0, 0x1e, AZALIA_PIN_CFG_NC(0)), /* NC */
};
0x8086280b, /* Codec Vendor/Device ID: Intel CannonPoint HDMI */
0x80860101, /* Subsystem ID */
4, /* Number of entries */
static const u32 intel_display_audio_verbs[] = {
AZALIA_SUBVENDOR(2, 0x80860101),
AZALIA_PIN_CFG(2, 0x05, 0x18560010),
AZALIA_PIN_CFG(2, 0x06, 0x18560010),
@ -33,4 +27,23 @@ const u32 cim_verb_data[] = {
const u32 pc_beep_verbs[] = {};
struct azalia_codec mainboard_azalia_codecs[] = {
{
.name = "Realtek ALC269",
.vendor_id = 0x10ec0269,
.subsystem_id = 0x10ec0269,
.address = 0,
.verbs = realtek_alc269_verbs,
.verb_count = ARRAY_SIZE(realtek_alc269_verbs),
},
{
.name = "Intel Display Audio (HDMI/DP)",
.vendor_id = 0x8086280b,
.subsystem_id = 0x80860101,
.address = 2,
.verbs = intel_display_audio_verbs,
.verb_count = ARRAY_SIZE(intel_display_audio_verbs),
},
};
AZALIA_ARRAY_SIZES;

View file

@ -2,7 +2,6 @@
config BOARD_PURISM_BASEBOARD_LIBREM_JSL
def_bool n
select AZALIA_USE_LEGACY_VERB_TABLE
select BOARD_ROMSIZE_KB_16384
select DRIVERS_GENERIC_CBFS_SERIAL
select DRIVERS_USB_ACPI

View file

@ -2,11 +2,7 @@
#include <device/azalia_device.h>
const u32 cim_verb_data[] = {
0x10ec0269, /* Codec Vendor/Device ID: Realtek ALC269 */
0x10ec0269, /* Subsystem ID */
16, /* Number of entries */
static const u32 realtek_alc269_verbs[] = {
AZALIA_RESET(0x1),
AZALIA_SUBVENDOR(0, 0x10ec0269),
@ -41,11 +37,9 @@ const u32 cim_verb_data[] = {
0x020400AF,
0x02050005,
0x020400C0,
};
0x8086281a, /* Codec Vendor/Device ID: Intel Jasper Lake HDMI */
0x80860101, /* Subsystem ID */
6, /* Number of entries */
static const u32 intel_display_audio_verbs[] = {
AZALIA_SUBVENDOR(2, 0x80860101),
AZALIA_PIN_CFG(2, 0x04, 0x18560010),
AZALIA_PIN_CFG(2, 0x06, 0x18560010),
@ -56,4 +50,23 @@ const u32 cim_verb_data[] = {
const u32 pc_beep_verbs[] = {};
struct azalia_codec mainboard_azalia_codecs[] = {
{
.name = "Realtek ALC269",
.vendor_id = 0x10ec0269,
.subsystem_id = 0x10ec0269,
.address = 0,
.verbs = realtek_alc269_verbs,
.verb_count = ARRAY_SIZE(realtek_alc269_verbs),
},
{
.name = "Intel Display Audio (HDMI/DP)",
.vendor_id = 0x8086281a,
.subsystem_id = 0x80860101,
.address = 2,
.verbs = intel_display_audio_verbs,
.verb_count = ARRAY_SIZE(intel_display_audio_verbs),
},
};
AZALIA_ARRAY_SIZES;

View file

@ -2,7 +2,6 @@
config BOARD_PURISM_BASEBOARD_LIBREM_SKL
def_bool n
select AZALIA_USE_LEGACY_VERB_TABLE
select BOARD_ROMSIZE_KB_16384
select DRIVERS_GENERIC_CBFS_SERIAL
select GFX_GMA_IGNORE_PRESENCE_STRAPS

View file

@ -2,12 +2,7 @@
#include <device/azalia_device.h>
const u32 cim_verb_data[] = {
/* coreboot specific header */
0x10ec0269, /* Codec Vendor / Device ID: Realtek ALC269 */
0x19910269, /* Subsystem ID */
12, /* Number of jacks (NID entries) */
static const u32 realtek_alc269_verbs[] = {
AZALIA_RESET(1),
AZALIA_SUBVENDOR(0, 0x19910269),
AZALIA_PIN_CFG(0, 0x12, 0x40000000),
@ -24,4 +19,15 @@ const u32 cim_verb_data[] = {
const u32 pc_beep_verbs[] = {};
struct azalia_codec mainboard_azalia_codecs[] = {
{
.name = "Realtek ALC269",
.vendor_id = 0x10ec0269,
.subsystem_id = 0x19910269,
.address = 0,
.verbs = realtek_alc269_verbs,
.verb_count = ARRAY_SIZE(realtek_alc269_verbs),
},
};
AZALIA_ARRAY_SIZES;