Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/58879 )
Change subject: mb/prodrive/hermes: Configure pink rear vref based on eeprom ......................................................................
mb/prodrive/hermes: Configure pink rear vref based on eeprom
Change-Id: Iaa11ba9c74f643e94046d4983fbce65dbedd1025 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/mainboard/prodrive/hermes/variants/baseboard/include/eeprom.h M src/mainboard/prodrive/hermes/variants/r04/hda_verb.c 2 files changed, 24 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/79/58879/1
diff --git a/src/mainboard/prodrive/hermes/variants/baseboard/include/eeprom.h b/src/mainboard/prodrive/hermes/variants/baseboard/include/eeprom.h index 9ec4604..f64a23a 100644 --- a/src/mainboard/prodrive/hermes/variants/baseboard/include/eeprom.h +++ b/src/mainboard/prodrive/hermes/variants/baseboard/include/eeprom.h @@ -49,12 +49,13 @@ uint8_t blue_rear_vref; uint8_t internal_audio_connection; uint8_t pxe_boot_capability; + uint8_t pink_rear_vref; }; - uint8_t raw_settings[9]; + uint8_t raw_settings[10]; }; };
-_Static_assert(sizeof(struct eeprom_board_settings) == (9 + sizeof(uint32_t)), +_Static_assert(sizeof(struct eeprom_board_settings) == (10 + sizeof(uint32_t)), "struct eeprom_board_settings has invalid size!");
struct __packed eeprom_bmc_settings { diff --git a/src/mainboard/prodrive/hermes/variants/r04/hda_verb.c b/src/mainboard/prodrive/hermes/variants/r04/hda_verb.c index f9a3cb3..8eeecda 100644 --- a/src/mainboard/prodrive/hermes/variants/r04/hda_verb.c +++ b/src/mainboard/prodrive/hermes/variants/r04/hda_verb.c @@ -52,6 +52,23 @@ } }
+static u32 get_pink_audio_cfg(uint8_t pink_rear_vref) +{ + switch (pink_rear_vref) { + default: + case 0: + return 0x411110F0; /* Disabled (Hi-Z) */ + case 1: + return 0x411111f0; /* 50% of LDO out */ + case 2: + return 0x411114f0; /* 80% of LDO out */ + case 3: + return 0x411115f0; /* 100% of LDO out */ + case 4: + return 0x411112f0; /* Ground */ + } +} + void mainboard_r0x_configure_alc888(u8 *base, u32 viddid) { /* Overwrite settings made by baseboard */ @@ -62,10 +79,12 @@ if (!board_cfg) return;
- const u32 config = get_internal_audio_cfg(board_cfg->internal_audio_connection); + const u32 internal_config = get_internal_audio_cfg(board_cfg->internal_audio_connection); + const u32 pink_config = get_pink_audio_cfg(board_cfg->pink_rear_vref);
const u32 verbs[] = { - AZALIA_PIN_CFG(0, 0x1b, config), + AZALIA_PIN_CFG(0, 0x12, pink_config), + AZALIA_PIN_CFG(0, 0x1b, internal_config), 0x0205000d, /* Pin 37 vrefo hidden register - used as port C vref */ get_port_c_vref_cfg(board_cfg->blue_rear_vref), };