device/azalia: Add missing 521us delay after RESET# de-assertion

The spec[1] says a codec is allowed to take up to 521us before sig-
naling an initialization request. Our original SB600 implementation
had a 1ms delay here since commit 4505948fae ("Use the correct device
for switching on HDA.")

Most codecs are a lot faster, which is probably why nobody noticed
the missing delay. For instance, the Realtek ALC272 datasheet spe-
cifies a 1 frame (1/48kHz) maximum[2]. It doesn't hurt, though, to
be correct here. We have a lot longer delays around.

[1] High Definition Audio Specification 1.0a: "4.3 Codec Discovery"
[2] ALC272 datasheet: "9.2.1. Link Reset and Initialization Timing"

TEST= Verbs were loaded correctly on off-tree HP ProBook 450 G3.

Change-Id: Ifd3357758fb3678e60b4c6edcfbdb60b3bda9746
Signed-off-by: Nico Huber <nico.h@gmx.de>
Signed-off-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/89651
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Alicja Michalska <ahplka19@gmail.com>
This commit is contained in:
Nico Huber 2024-07-20 12:54:03 +02:00 committed by Matt DeVillier
commit ecf202b8e4

View file

@ -40,7 +40,13 @@ enum cb_err azalia_enter_reset(u8 *base)
enum cb_err azalia_exit_reset(u8 *base)
{
/* Set bit 0 to 1 to exit reset state (BAR + 0x8)[0] */
return azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, HDA_GCTL_CRST);
if (azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, HDA_GCTL_CRST) != CB_SUCCESS)
return CB_ERR;
/* Codecs have up to 25 frames (at 48kHz) to signal an
initialization request (HDA Spec 1.0a "4.3 Codec Discovery"). */
udelay(521);
return CB_SUCCESS;
}
static u16 codec_detect(u8 *base)