Elyes Haouas has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/61848 )
Change subject: sb/intel/ibexpeak/azalia.c: Read 16 bits on HDA_STATESTS_REG ......................................................................
sb/intel/ibexpeak/azalia.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: I8423d263bf6e3274630284279d8fc61a8d86d61e Signed-off-by: Elyes Haouas ehaouas@noos.fr --- M src/southbridge/intel/ibexpeak/azalia.c 1 file changed, 8 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/48/61848/1
diff --git a/src/southbridge/intel/ibexpeak/azalia.c b/src/southbridge/intel/ibexpeak/azalia.c index d4e639a..96a7f1a 100644 --- a/src/southbridge/intel/ibexpeak/azalia.c +++ b/src/southbridge/intel/ibexpeak/azalia.c @@ -10,9 +10,10 @@ #include <device/azalia_device.h> #include "pch.h"
-static int codec_detect(u8 *base) +static u16 codec_detect(u8 *base) { - u8 reg8; + const u16 codec_mask = (1 << CONFIG_AZALIA_MAX_CODECS) - 1; + u16 reg16;
if (azalia_exit_reset(base) < 0) goto no_codec; @@ -21,12 +22,12 @@ write16(base + HDA_GCAP_REG, read16(base + HDA_GCAP_REG));
/* 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 */ @@ -39,7 +40,7 @@ { u8 *base; struct resource *res; - u32 codec_mask; + u16 codec_mask; u32 reg32;
/* Find base address */