summaryrefslogtreecommitdiff
path: root/src/southbridge
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2021-03-18 17:09:49 +0100
committerAngel Pons <th3fanbus@gmail.com>2021-03-22 13:00:28 +0000
commitf20ef65e65f4a71bee3173f7c16048f87fe56379 (patch)
tree95e1c111dbe764666530ca4b366edb6c46062091 /src/southbridge
parentaa566ad07f732016c0f0f962400a40a7ae3d4c8d (diff)
downloadcoreboot-f20ef65e65f4a71bee3173f7c16048f87fe56379.tar.xz
sb/intel/lynxpoint/hda_verb.c: Add missing codec detect steps
Lynx Point reference code version 1.9.1 and soc/intel/common/hda_verb.c perform these steps. Add them to Lynx Point as well. With this change, Lynx Point and soc/intel/common hda_verb.c files are now identical. Change-Id: I2fc592f73697a43bd5a3315ac80c77ff9f00da9b Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/51642 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/southbridge')
-rw-r--r--src/southbridge/intel/lynxpoint/hda_verb.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/southbridge/intel/lynxpoint/hda_verb.c b/src/southbridge/intel/lynxpoint/hda_verb.c
index a7bfa4a705..41ecac11c5 100644
--- a/src/southbridge/intel/lynxpoint/hda_verb.c
+++ b/src/southbridge/intel/lynxpoint/hda_verb.c
@@ -5,7 +5,6 @@
#include <device/mmio.h>
#include <delay.h>
-#include "pch.h"
#include "hda_verb.h"
int hda_codec_detect(u8 *base)
@@ -19,6 +18,20 @@ int hda_codec_detect(u8 *base)
/* Write back the value once reset bit is set. */
write16(base + HDA_GCAP_REG, read16(base + HDA_GCAP_REG));
+ /*
+ * Clear the "State Change Status Register" STATESTS bits
+ * for each of the "SDIN Stat Change Status Flag"
+ */
+ write8(base + HDA_STATESTS_REG, 0xf);
+
+ /* Turn off the link and poll RESET# bit until it reads back as 0 */
+ if (azalia_enter_reset(base) < 0)
+ goto no_codec;
+
+ /* Turn on the link and poll RESET# bit until it reads back as 1 */
+ if (azalia_exit_reset(base) < 0)
+ goto no_codec;
+
/* Read in Codec location (BAR + 0xe)[2..0] */
reg8 = read8(base + HDA_STATESTS_REG);
reg8 &= 0x0f;