HAOUAS Elyes has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/61845 )
Change subject: sb/intel/i82801gx/azalia.c: Fix read on 16bits register ......................................................................
sb/intel/i82801gx/azalia.c: Fix read on 16bits register
Regarding I/O Controller Hub 7 datasheet (page#735), STATESTS is a 16 bits register and [15:3] is reserved. So correct the codec mask and read only 16 bits.
Change-Id: I530aa21d5a26ade0bc071351ac609c84bd8eb2cb Signed-off-by: Elyes Haouas ehaouas@noos.fr --- M src/southbridge/intel/i82801gx/azalia.c 1 file changed, 7 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/61845/1
diff --git a/src/southbridge/intel/i82801gx/azalia.c b/src/southbridge/intel/i82801gx/azalia.c index 33a0cd8..8011974 100644 --- a/src/southbridge/intel/i82801gx/azalia.c +++ b/src/southbridge/intel/i82801gx/azalia.c @@ -12,9 +12,10 @@ #include "chip.h" #include "i82801gx.h"
-static int codec_detect(u8 *base) +static u16 codec_detect(u8 *base) { - u32 reg32; + const u16 codec_mask = (1 << CONFIG_AZALIA_MAX_CODECS) - 1; + u16 reg16;
if (azalia_enter_reset(base) < 0) goto no_codec; @@ -23,12 +24,12 @@ goto no_codec;
/* Read in Codec location (BAR + 0xe)[2..0] */ - reg32 = read32(base + HDA_STATESTS_REG); - reg32 &= 0x0f; - if (!reg32) + reg16 = read16(base + HDA_STATESTS_REG); + reg16 &= codec_mask; + if (!reg16) goto no_codec;
- return reg32; + return reg16;
no_codec: /* Codec not found, put HDA back in reset */