Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48358 )
Change subject: azalia: Use `azalia_enter_reset` function ......................................................................
azalia: Use `azalia_enter_reset` function
Also tidy up some adjacent comments.
Change-Id: I2e881900a52e42ab3f43ffe96cfbdcc63ff02e23 Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/device/azalia_device.c M src/soc/intel/common/hda_verb.c M src/southbridge/intel/bd82x6x/azalia.c M src/southbridge/intel/i82801gx/azalia.c M src/southbridge/intel/i82801ix/azalia.c M src/southbridge/intel/i82801jx/azalia.c M src/southbridge/intel/ibexpeak/azalia.c M src/southbridge/intel/lynxpoint/hda_verb.c 8 files changed, 19 insertions(+), 30 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/58/48358/1
diff --git a/src/device/azalia_device.c b/src/device/azalia_device.c index 1f259d5..de990bf 100644 --- a/src/device/azalia_device.c +++ b/src/device/azalia_device.c @@ -72,8 +72,7 @@ if (!count) goto no_codec;
- /* Set Bit 0 to 0 to enter reset state (BAR + 0x8)[0] */ - if (azalia_set_bits(base + HDA_GCTL_REG, 1, 0) < 0) + if (azalia_enter_reset(base) < 0) goto no_codec;
if (azalia_exit_reset(base) < 0) diff --git a/src/soc/intel/common/hda_verb.c b/src/soc/intel/common/hda_verb.c index 5a4b467..f4ef756 100644 --- a/src/soc/intel/common/hda_verb.c +++ b/src/soc/intel/common/hda_verb.c @@ -24,7 +24,7 @@ write8(base + HDA_STATESTS_REG, 0xf);
/* Turn off the link and poll RESET# bit until it reads back as 0 */ - if (azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, 0) < 0) + if (azalia_enter_reset(base) < 0) goto no_codec;
/* Turn on the link and poll RESET# bit until it reads back as 1 */ @@ -40,9 +40,8 @@ return reg8;
no_codec: - /* Codec Not found */ - /* Put HDA back in reset (BAR + 0x8) [0] */ - azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, 0); + /* Codec not found, put HDA back in reset */ + azalia_enter_reset(base); printk(BIOS_DEBUG, "HDA: No codec!\n"); return 0; } diff --git a/src/southbridge/intel/bd82x6x/azalia.c b/src/southbridge/intel/bd82x6x/azalia.c index eab8e79..dcb0bb4 100644 --- a/src/southbridge/intel/bd82x6x/azalia.c +++ b/src/southbridge/intel/bd82x6x/azalia.c @@ -33,9 +33,8 @@ return reg8;
no_codec: - /* Codec Not found */ - /* Put HDA back in reset (BAR + 0x8) [0] */ - azalia_set_bits(base + HDA_GCTL_REG, 1, 0); + /* Codec not found, put HDA back in reset */ + azalia_enter_reset(base); printk(BIOS_DEBUG, "Azalia: No codec!\n"); return 0; } diff --git a/src/southbridge/intel/i82801gx/azalia.c b/src/southbridge/intel/i82801gx/azalia.c index d1d3731..3ace204 100644 --- a/src/southbridge/intel/i82801gx/azalia.c +++ b/src/southbridge/intel/i82801gx/azalia.c @@ -15,8 +15,7 @@ { u32 reg32;
- /* Set Bit 0 to 0 to enter reset state (BAR + 0x8)[0] */ - if (azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, 0) < 0) + if (azalia_enter_reset(base) < 0) goto no_codec;
if (azalia_exit_reset(base) < 0) @@ -31,9 +30,8 @@ return reg32;
no_codec: - /* Codec Not found */ - /* Put HDA back in reset (BAR + 0x8) [0] */ - azalia_set_bits(base + HDA_GCTL_REG, 1, 0); + /* Codec not found, put HDA back in reset */ + azalia_enter_reset(base); printk(BIOS_DEBUG, "Azalia: No codec!\n"); return 0; } diff --git a/src/southbridge/intel/i82801ix/azalia.c b/src/southbridge/intel/i82801ix/azalia.c index 558f9cd..ff890a2 100644 --- a/src/southbridge/intel/i82801ix/azalia.c +++ b/src/southbridge/intel/i82801ix/azalia.c @@ -15,8 +15,7 @@ { u32 reg32;
- /* Set Bit 0 to 0 to enter reset state (BAR + 0x8)[0] */ - if (azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, 0) < 0) + if (azalia_enter_reset(base) < 0) goto no_codec;
if (azalia_exit_reset(base) < 0) @@ -31,9 +30,8 @@ return reg32;
no_codec: - /* Codec Not found */ - /* Put HDA back in reset (BAR + 0x8) [0] */ - azalia_set_bits(base + HDA_GCTL_REG, 1, 0); + /* Codec not found, put HDA back in reset */ + azalia_enter_reset(base); printk(BIOS_DEBUG, "Azalia: No codec!\n"); return 0; } diff --git a/src/southbridge/intel/i82801jx/azalia.c b/src/southbridge/intel/i82801jx/azalia.c index bea2e90..5efbc9f 100644 --- a/src/southbridge/intel/i82801jx/azalia.c +++ b/src/southbridge/intel/i82801jx/azalia.c @@ -15,8 +15,7 @@ { u32 reg32;
- /* Set Bit 0 to 0 to enter reset state (BAR + 0x8)[0] */ - if (azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, 0) < 0) + if (azalia_enter_reset(base) < 0) goto no_codec;
if (azalia_exit_reset(base) < 0) @@ -31,9 +30,8 @@ return reg32;
no_codec: - /* Codec Not found */ - /* Put HDA back in reset (BAR + 0x8) [0] */ - azalia_set_bits(base + HDA_GCTL_REG, 1, 0); + /* Codec not found, put HDA back in reset */ + azalia_enter_reset(base); printk(BIOS_DEBUG, "Azalia: No codec!\n"); return 0; } diff --git a/src/southbridge/intel/ibexpeak/azalia.c b/src/southbridge/intel/ibexpeak/azalia.c index 1224792..ef781b7 100644 --- a/src/southbridge/intel/ibexpeak/azalia.c +++ b/src/southbridge/intel/ibexpeak/azalia.c @@ -29,9 +29,8 @@ return reg8;
no_codec: - /* Codec Not found */ - /* Put HDA back in reset (BAR + 0x8) [0] */ - azalia_set_bits(base + HDA_GCTL_REG, 1, 0); + /* Codec not found, put HDA back in reset */ + azalia_enter_reset(base); printk(BIOS_DEBUG, "Azalia: No codec!\n"); return 0; } diff --git a/src/southbridge/intel/lynxpoint/hda_verb.c b/src/southbridge/intel/lynxpoint/hda_verb.c index f7eddf4..a7bfa4a 100644 --- a/src/southbridge/intel/lynxpoint/hda_verb.c +++ b/src/southbridge/intel/lynxpoint/hda_verb.c @@ -28,9 +28,8 @@ return reg8;
no_codec: - /* Codec Not found */ - /* Put HDA back in reset (BAR + 0x8) [0] */ - azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, 0); + /* Codec not found, put HDA back in reset */ + azalia_enter_reset(base); printk(BIOS_DEBUG, "HDA: No codec!\n"); return 0; }
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48358 )
Change subject: azalia: Use `azalia_enter_reset` function ......................................................................
Patch Set 3: Code-Review+1
(1 comment)
https://review.coreboot.org/c/coreboot/+/48358/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/48358/3//COMMIT_MSG@7 PS3, Line 7: Use `azalia_enter_reset` function nit: "Deduplicate code by using..."?
Hello Felix Singer, build bot (Jenkins), Nico Huber, Arthur Heymans, Michael Niewöhner, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/48358
to look at the new patch set (#5).
Change subject: azalia: Use `azalia_enter_reset` function ......................................................................
azalia: Use `azalia_enter_reset` function
Also tidy up some adjacent comments.
Change-Id: I2e881900a52e42ab3f43ffe96cfbdcc63ff02e23 Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/device/azalia_device.c M src/soc/intel/common/hda_verb.c M src/southbridge/intel/bd82x6x/azalia.c M src/southbridge/intel/i82801gx/azalia.c M src/southbridge/intel/i82801ix/azalia.c M src/southbridge/intel/i82801jx/azalia.c M src/southbridge/intel/ibexpeak/azalia.c M src/southbridge/intel/lynxpoint/hda_verb.c 8 files changed, 19 insertions(+), 30 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/58/48358/5
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48358 )
Change subject: azalia: Use `azalia_enter_reset` function ......................................................................
Patch Set 5: Code-Review+2
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48358 )
Change subject: azalia: Use `azalia_enter_reset` function ......................................................................
Patch Set 5: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/48358/5/src/soc/intel/common/hda_ve... File src/soc/intel/common/hda_verb.c:
https://review.coreboot.org/c/coreboot/+/48358/5/src/soc/intel/common/hda_ve... PS5, Line 28: goto no_codec; Seems odd, if reset failed goto reset?
Nico Huber has submitted this change. ( https://review.coreboot.org/c/coreboot/+/48358 )
Change subject: azalia: Use `azalia_enter_reset` function ......................................................................
azalia: Use `azalia_enter_reset` function
Also tidy up some adjacent comments.
Change-Id: I2e881900a52e42ab3f43ffe96cfbdcc63ff02e23 Signed-off-by: Angel Pons th3fanbus@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/48358 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Patrick Rudolph siro@das-labor.org Reviewed-by: Nico Huber nico.h@gmx.de Reviewed-by: Michael Niewöhner foss@mniewoehner.de --- M src/device/azalia_device.c M src/soc/intel/common/hda_verb.c M src/southbridge/intel/bd82x6x/azalia.c M src/southbridge/intel/i82801gx/azalia.c M src/southbridge/intel/i82801ix/azalia.c M src/southbridge/intel/i82801jx/azalia.c M src/southbridge/intel/ibexpeak/azalia.c M src/southbridge/intel/lynxpoint/hda_verb.c 8 files changed, 19 insertions(+), 30 deletions(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved Patrick Rudolph: Looks good to me, approved Michael Niewöhner: Looks good to me, but someone else must approve
diff --git a/src/device/azalia_device.c b/src/device/azalia_device.c index 5e9c6c9..e1899f1 100644 --- a/src/device/azalia_device.c +++ b/src/device/azalia_device.c @@ -72,8 +72,7 @@ if (!count) goto no_codec;
- /* Set Bit 0 to 0 to enter reset state (BAR + 0x8)[0] */ - if (azalia_set_bits(base + HDA_GCTL_REG, 1, 0) < 0) + if (azalia_enter_reset(base) < 0) goto no_codec;
if (azalia_exit_reset(base) < 0) diff --git a/src/soc/intel/common/hda_verb.c b/src/soc/intel/common/hda_verb.c index 5a4b467..f4ef756 100644 --- a/src/soc/intel/common/hda_verb.c +++ b/src/soc/intel/common/hda_verb.c @@ -24,7 +24,7 @@ write8(base + HDA_STATESTS_REG, 0xf);
/* Turn off the link and poll RESET# bit until it reads back as 0 */ - if (azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, 0) < 0) + if (azalia_enter_reset(base) < 0) goto no_codec;
/* Turn on the link and poll RESET# bit until it reads back as 1 */ @@ -40,9 +40,8 @@ return reg8;
no_codec: - /* Codec Not found */ - /* Put HDA back in reset (BAR + 0x8) [0] */ - azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, 0); + /* Codec not found, put HDA back in reset */ + azalia_enter_reset(base); printk(BIOS_DEBUG, "HDA: No codec!\n"); return 0; } diff --git a/src/southbridge/intel/bd82x6x/azalia.c b/src/southbridge/intel/bd82x6x/azalia.c index eab8e79..dcb0bb4 100644 --- a/src/southbridge/intel/bd82x6x/azalia.c +++ b/src/southbridge/intel/bd82x6x/azalia.c @@ -33,9 +33,8 @@ return reg8;
no_codec: - /* Codec Not found */ - /* Put HDA back in reset (BAR + 0x8) [0] */ - azalia_set_bits(base + HDA_GCTL_REG, 1, 0); + /* Codec not found, put HDA back in reset */ + azalia_enter_reset(base); printk(BIOS_DEBUG, "Azalia: No codec!\n"); return 0; } diff --git a/src/southbridge/intel/i82801gx/azalia.c b/src/southbridge/intel/i82801gx/azalia.c index d1d3731..3ace204 100644 --- a/src/southbridge/intel/i82801gx/azalia.c +++ b/src/southbridge/intel/i82801gx/azalia.c @@ -15,8 +15,7 @@ { u32 reg32;
- /* Set Bit 0 to 0 to enter reset state (BAR + 0x8)[0] */ - if (azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, 0) < 0) + if (azalia_enter_reset(base) < 0) goto no_codec;
if (azalia_exit_reset(base) < 0) @@ -31,9 +30,8 @@ return reg32;
no_codec: - /* Codec Not found */ - /* Put HDA back in reset (BAR + 0x8) [0] */ - azalia_set_bits(base + HDA_GCTL_REG, 1, 0); + /* Codec not found, put HDA back in reset */ + azalia_enter_reset(base); printk(BIOS_DEBUG, "Azalia: No codec!\n"); return 0; } diff --git a/src/southbridge/intel/i82801ix/azalia.c b/src/southbridge/intel/i82801ix/azalia.c index 558f9cd..ff890a2 100644 --- a/src/southbridge/intel/i82801ix/azalia.c +++ b/src/southbridge/intel/i82801ix/azalia.c @@ -15,8 +15,7 @@ { u32 reg32;
- /* Set Bit 0 to 0 to enter reset state (BAR + 0x8)[0] */ - if (azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, 0) < 0) + if (azalia_enter_reset(base) < 0) goto no_codec;
if (azalia_exit_reset(base) < 0) @@ -31,9 +30,8 @@ return reg32;
no_codec: - /* Codec Not found */ - /* Put HDA back in reset (BAR + 0x8) [0] */ - azalia_set_bits(base + HDA_GCTL_REG, 1, 0); + /* Codec not found, put HDA back in reset */ + azalia_enter_reset(base); printk(BIOS_DEBUG, "Azalia: No codec!\n"); return 0; } diff --git a/src/southbridge/intel/i82801jx/azalia.c b/src/southbridge/intel/i82801jx/azalia.c index bea2e90..5efbc9f 100644 --- a/src/southbridge/intel/i82801jx/azalia.c +++ b/src/southbridge/intel/i82801jx/azalia.c @@ -15,8 +15,7 @@ { u32 reg32;
- /* Set Bit 0 to 0 to enter reset state (BAR + 0x8)[0] */ - if (azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, 0) < 0) + if (azalia_enter_reset(base) < 0) goto no_codec;
if (azalia_exit_reset(base) < 0) @@ -31,9 +30,8 @@ return reg32;
no_codec: - /* Codec Not found */ - /* Put HDA back in reset (BAR + 0x8) [0] */ - azalia_set_bits(base + HDA_GCTL_REG, 1, 0); + /* Codec not found, put HDA back in reset */ + azalia_enter_reset(base); printk(BIOS_DEBUG, "Azalia: No codec!\n"); return 0; } diff --git a/src/southbridge/intel/ibexpeak/azalia.c b/src/southbridge/intel/ibexpeak/azalia.c index 1224792..ef781b7 100644 --- a/src/southbridge/intel/ibexpeak/azalia.c +++ b/src/southbridge/intel/ibexpeak/azalia.c @@ -29,9 +29,8 @@ return reg8;
no_codec: - /* Codec Not found */ - /* Put HDA back in reset (BAR + 0x8) [0] */ - azalia_set_bits(base + HDA_GCTL_REG, 1, 0); + /* Codec not found, put HDA back in reset */ + azalia_enter_reset(base); printk(BIOS_DEBUG, "Azalia: No codec!\n"); return 0; } diff --git a/src/southbridge/intel/lynxpoint/hda_verb.c b/src/southbridge/intel/lynxpoint/hda_verb.c index f7eddf4..a7bfa4a 100644 --- a/src/southbridge/intel/lynxpoint/hda_verb.c +++ b/src/southbridge/intel/lynxpoint/hda_verb.c @@ -28,9 +28,8 @@ return reg8;
no_codec: - /* Codec Not found */ - /* Put HDA back in reset (BAR + 0x8) [0] */ - azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, 0); + /* Codec not found, put HDA back in reset */ + azalia_enter_reset(base); printk(BIOS_DEBUG, "HDA: No codec!\n"); return 0; }
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48358 )
Change subject: azalia: Use `azalia_enter_reset` function ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/48358/5/src/soc/intel/common/hda_ve... File src/soc/intel/common/hda_verb.c:
https://review.coreboot.org/c/coreboot/+/48358/5/src/soc/intel/common/hda_ve... PS5, Line 28: goto no_codec;
Seems odd, if reset failed goto reset?
Yeah, makes little sense. I want to deduplicate this at some point anyway