Elyes Haouas has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/61850 )
Change subject: sb//intel/lynxpoint/hda_verb.c: Read 16 bits on HDA_STATESTS_REG ......................................................................
sb//intel/lynxpoint/hda_verb.c: Read 16 bits on HDA_STATESTS_REG
HDA_STATESTS_REG is a 16 bits register, so correct the codec_mask and read 16bits.
Change-Id: Ia82ca04dac25efba1a173a690da75e8b3063b147 Signed-off-by: Elyes Haouas ehaouas@noos.fr --- M src/southbridge/intel/lynxpoint/hda_verb.c M src/southbridge/intel/lynxpoint/hda_verb.h 2 files changed, 11 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/61850/1
diff --git a/src/southbridge/intel/lynxpoint/hda_verb.c b/src/southbridge/intel/lynxpoint/hda_verb.c index 7e9f4d2..48c8c74 100644 --- a/src/southbridge/intel/lynxpoint/hda_verb.c +++ b/src/southbridge/intel/lynxpoint/hda_verb.c @@ -6,9 +6,10 @@
#include "hda_verb.h"
-int hda_codec_detect(u8 *base) +u16 hda_codec_detect(u8 *base) { - u8 reg8; + const u16 codec_mask = (1 << CONFIG_AZALIA_MAX_CODECS) - 1; + u16 reg16;
/* Set Bit 0 to 1 to exit reset state (BAR + 0x8)[0] */ if (azalia_exit_reset(base) < 0) @@ -21,7 +22,9 @@ * Clear the "State Change Status Register" STATESTS bits * for each of the "SDIN Stat Change Status Flag" */ - write8(base + HDA_STATESTS_REG, 0xf); + reg16 = read16(base + HDA_STATESTS_REG); + reg16 |= codec_mask; + write16(base + HDA_STATESTS_REG, reg16);
/* Turn off the link and poll RESET# bit until it reads back as 0 */ if (azalia_enter_reset(base) < 0) @@ -32,12 +35,12 @@ goto no_codec;
/* Read in Codec location (BAR + 0xe)[2..0] */ - reg8 = read8(base + HDA_STATESTS_REG); - reg8 &= 0x0f; - if (!reg8) + reg16 = read16(base + HDA_STATESTS_REG); + reg16 &= codec_mask; + if (!reg16) goto no_codec;
- return reg8; + return reg16;
no_codec: /* Codec not found, put HDA back in reset */ diff --git a/src/southbridge/intel/lynxpoint/hda_verb.h b/src/southbridge/intel/lynxpoint/hda_verb.h index 1d6ef39..2eab550 100644 --- a/src/southbridge/intel/lynxpoint/hda_verb.h +++ b/src/southbridge/intel/lynxpoint/hda_verb.h @@ -5,6 +5,6 @@
#include <stdint.h>
-int hda_codec_detect(u8 *base); +u16 hda_codec_detect(u8 *base);
#endif