Elyes Haouas has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/61851 )
Change subject: sb/intel/i82801jx/azalia.c: Read 16 bits on HDA_STATESTS_REG ......................................................................
sb/intel/i82801jx/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: I2e18f3e604819abfba6f7a3bc1c4db8053a1b9f3 Signed-off-by: Elyes Haouas ehaouas@noos.fr --- M src/southbridge/intel/i82801jx/azalia.c 1 file changed, 8 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/51/61851/1
diff --git a/src/southbridge/intel/i82801jx/azalia.c b/src/southbridge/intel/i82801jx/azalia.c index 618350e..8304bc4 100644 --- a/src/southbridge/intel/i82801jx/azalia.c +++ b/src/southbridge/intel/i82801jx/azalia.c @@ -10,9 +10,10 @@ #include "chip.h" #include "i82801jx.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 reg;
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);