Elyes Haouas has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/61852 )
Change subject: sb/intel/i82801ix/azalia.c: Read 16 bits on HDA_STATESTS_REG ......................................................................
sb/intel/i82801ix/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: I6945b1461a12ca2b07c05ee90246a199e7447435 Signed-off-by: Elyes Haouas ehaouas@noos.fr --- M src/southbridge/intel/i82801ix/azalia.c 1 file changed, 8 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/52/61852/1
diff --git a/src/southbridge/intel/i82801ix/azalia.c b/src/southbridge/intel/i82801ix/azalia.c index 0179415..ec3706e 100644 --- a/src/southbridge/intel/i82801ix/azalia.c +++ b/src/southbridge/intel/i82801ix/azalia.c @@ -10,9 +10,10 @@ #include "chip.h" #include "i82801ix.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; @@ -21,12 +22,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 */ @@ -39,7 +40,7 @@ { u8 *base; struct resource *res; - u32 codec_mask; + u16 codec_mask;
// ESD pci_update_config32(dev, 0x134, ~0x00ff0000, 2 << 16);