Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/58879 )
Change subject: mb/prodrive/hermes: Configure ALC888 port B Vref ......................................................................
mb/prodrive/hermes: Configure ALC888 port B Vref
Define a new field in the board config EEPROM layout for port B Vref. Write port B Vref settings to unused non-volatile NID 0x12 instead of NID 0x18, the actual port B NID. Because per-port Vref settings don't persist after codec resets, a custom Realtek driver (ab)uses NID 0x12 to restore port B Vref after resetting the codec.
Change-Id: Iaa11ba9c74f643e94046d4983fbce65dbedd1025 Signed-off-by: Arthur Heymans arthur@aheymans.xyz Signed-off-by: Angel Pons th3fanbus@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/58879 Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/prodrive/hermes/eeprom.h M src/mainboard/prodrive/hermes/hda_verb.c 2 files changed, 29 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved
diff --git a/src/mainboard/prodrive/hermes/eeprom.h b/src/mainboard/prodrive/hermes/eeprom.h index 26f2faa..a42a3d7 100644 --- a/src/mainboard/prodrive/hermes/eeprom.h +++ b/src/mainboard/prodrive/hermes/eeprom.h @@ -51,12 +51,13 @@ uint8_t blue_rear_vref; uint8_t front_panel_audio; 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/hda_verb.c b/src/mainboard/prodrive/hermes/hda_verb.c index 760cecc..7514ce9 100644 --- a/src/mainboard/prodrive/hermes/hda_verb.c +++ b/src/mainboard/prodrive/hermes/hda_verb.c @@ -90,6 +90,23 @@ } }
+static u32 get_port_b_vref_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 */ + } +} + static u32 get_front_panel_cfg(uint8_t front_panel_audio) { switch (front_panel_audio) { @@ -122,7 +139,16 @@
const u32 front_mic_cfg = get_front_mic_cfg(board_cfg->front_panel_audio);
+ const u32 port_b_vref_cfg = get_port_b_vref_cfg(board_cfg->pink_rear_vref); + const u32 verbs[] = { + /* + * Write port B Vref settings to unused non-volatile NID 0x12 instead of + * NID 0x18, the actual port B NID. Because per-port Vref settings don't + * persist after codec resets, a custom Realtek driver (ab)uses NID 0x12 + * to restore port B Vref after resetting the codec. + */ + AZALIA_PIN_CFG(0, 0x12, port_b_vref_cfg), AZALIA_PIN_CFG(0, 0x19, front_mic_cfg), AZALIA_PIN_CFG(0, 0x1b, front_panel_cfg), 0x0205000d, /* Pin 37 vrefo hidden register - used as port C vref */