mail.coreboot.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
List overview
Download
coreboot-gerrit
November 2021
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
coreboot-gerrit@coreboot.org
1 participants
6394 discussions
Start a n
N
ew thread
Change in coreboot[master]: mb/google/brya/var/kano: Configure USB2 and USB3 port
by Paul Fagerburg (Code Review)
11 Nov '21
11 Nov '21
Paul Fagerburg has submitted this change. (
https://review.coreboot.org/c/coreboot/+/59084
) Change subject: mb/google/brya/var/kano: Configure USB2 and USB3 port ...................................................................... mb/google/brya/var/kano: Configure USB2 and USB3 port Disable unused USB2 and USB3 port BUG=b:192370253 TEST=build pass Signed-off-by: David Wu <david_wu(a)quanta.corp-partner.google.com> Change-Id: Ia2fa10fb21e0a42e51728bc3d78163ca213f8d91 Reviewed-on:
https://review.coreboot.org/c/coreboot/+/59084
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak(a)chromium.org> --- M src/mainboard/google/brya/variants/kano/overridetree.cb 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: build bot (Jenkins): Verified Tim Wawrzynczak: Looks good to me, approved diff --git a/src/mainboard/google/brya/variants/kano/overridetree.cb b/src/mainboard/google/brya/variants/kano/overridetree.cb index f2b04db..8aca8b4 100644 --- a/src/mainboard/google/brya/variants/kano/overridetree.cb +++ b/src/mainboard/google/brya/variants/kano/overridetree.cb @@ -18,6 +18,12 @@ # GPE configuration register "pmc_gpe0_dw1" = "GPP_D" + register "usb2_ports[1]" = "USB2_PORT_EMPTY" # Disable USB2_C1 + register "usb2_ports[3]" = "USB2_PORT_EMPTY" # Disable M.2 WWAN + register "usb2_ports[9]" = "USB2_PORT_EMPTY" # Disable M.2 Bluetooth + + register "usb3_ports[3]" = "USB3_PORT_EMPTY" # Disable M.2 WWAN + # FIVR configurations for kano are disabled since the board doesn't have V1p05 and Vnn # bypass rails implemented. register "ext_fivr_settings" = "{ -- To view, visit
https://review.coreboot.org/c/coreboot/+/59084
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: Ia2fa10fb21e0a42e51728bc3d78163ca213f8d91 Gerrit-Change-Number: 59084 Gerrit-PatchSet: 3 Gerrit-Owner: David Wu <david_wu(a)quanta.corp-partner.google.com> Gerrit-Reviewer: Paul Fagerburg <pfagerburg(a)chromium.org> Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-MessageType: merged
1
0
0
0
Change in coreboot[master]: lynxpoint/broadwell: Use `azalia_codecs_init()`
by Paul Fagerburg (Code Review)
11 Nov '21
11 Nov '21
Paul Fagerburg has submitted this change. (
https://review.coreboot.org/c/coreboot/+/59120
) Change subject: lynxpoint/broadwell: Use `azalia_codecs_init()` ...................................................................... lynxpoint/broadwell: Use `azalia_codecs_init()` Use the functionally-equivalent common Azalia code to get rid of redundant code. Change-Id: Id25d2797a91b05264b1a76fa8faec0533dd5ac78 Signed-off-by: Angel Pons <th3fanbus(a)gmail.com> Reviewed-on:
https://review.coreboot.org/c/coreboot/+/59120
Reviewed-by: Arthur Heymans <arthur(a)aheymans.xyz> Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org> --- M src/soc/intel/broadwell/pch/Kconfig M src/soc/intel/broadwell/pch/hda.c M src/southbridge/intel/lynxpoint/Kconfig M src/southbridge/intel/lynxpoint/azalia.c 4 files changed, 8 insertions(+), 30 deletions(-) Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved diff --git a/src/soc/intel/broadwell/pch/Kconfig b/src/soc/intel/broadwell/pch/Kconfig index 4e187ff..3fbaa79 100644 --- a/src/soc/intel/broadwell/pch/Kconfig +++ b/src/soc/intel/broadwell/pch/Kconfig @@ -24,6 +24,9 @@ select SOUTHBRIDGE_INTEL_COMMON_SPI_ICH9 select SPI_FLASH +config AZALIA_MAX_CODECS + default 4 + config EHCI_BAR hex default 0xd8000000 diff --git a/src/soc/intel/broadwell/pch/hda.c b/src/soc/intel/broadwell/pch/hda.c index 5c5e08f..c292b94 100644 --- a/src/soc/intel/broadwell/pch/hda.c +++ b/src/soc/intel/broadwell/pch/hda.c @@ -11,20 +11,6 @@ #include <soc/rcba.h> #include <southbridge/intel/lynxpoint/hda_verb.h> -static void codecs_init(u8 *base, u32 codec_mask) -{ - int i; - - /* Can support up to 4 codecs */ - for (i = 3; i >= 0; i--) { - if (codec_mask & (1 << i)) - azalia_codec_init(base, i, cim_verb_data, cim_verb_data_size); - } - - if (pc_beep_verbs_size) - azalia_program_verb_table(base, pc_beep_verbs, pc_beep_verbs_size); -} - static void hda_pch_init(struct device *dev, u8 *base) { u8 reg8; @@ -94,7 +80,7 @@ if (codec_mask) { printk(BIOS_DEBUG, "HDA: codec_mask = %02x\n", codec_mask); - codecs_init(base, codec_mask); + azalia_codecs_init(base, codec_mask); } } diff --git a/src/southbridge/intel/lynxpoint/Kconfig b/src/southbridge/intel/lynxpoint/Kconfig index 891b06a..b7c719b 100644 --- a/src/southbridge/intel/lynxpoint/Kconfig +++ b/src/southbridge/intel/lynxpoint/Kconfig @@ -41,6 +41,9 @@ help Set this option to y for LynxPoint LP (Haswell ULT). +config AZALIA_MAX_CODECS + default 4 + config EHCI_BAR hex default 0xe8000000 diff --git a/src/southbridge/intel/lynxpoint/azalia.c b/src/southbridge/intel/lynxpoint/azalia.c index 9201caa..1bde180 100644 --- a/src/southbridge/intel/lynxpoint/azalia.c +++ b/src/southbridge/intel/lynxpoint/azalia.c @@ -11,20 +11,6 @@ #include "pch.h" #include "hda_verb.h" -static void codecs_init(u8 *base, u32 codec_mask) -{ - int i; - - /* Can support up to 4 codecs */ - for (i = 3; i >= 0; i--) { - if (codec_mask & (1 << i)) - azalia_codec_init(base, i, cim_verb_data, cim_verb_data_size); - } - - if (pc_beep_verbs_size) - azalia_program_verb_table(base, pc_beep_verbs, pc_beep_verbs_size); -} - static void azalia_pch_init(struct device *dev, u8 *base) { u8 reg8; @@ -115,7 +101,7 @@ if (codec_mask) { printk(BIOS_DEBUG, "Azalia: codec_mask = %02x\n", codec_mask); - codecs_init(base, codec_mask); + azalia_codecs_init(base, codec_mask); } } -- To view, visit
https://review.coreboot.org/c/coreboot/+/59120
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: Id25d2797a91b05264b1a76fa8faec0533dd5ac78 Gerrit-Change-Number: 59120 Gerrit-PatchSet: 2 Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com> Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz> Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org> Gerrit-Reviewer: Paul Fagerburg <pfagerburg(a)chromium.org> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-MessageType: merged
1
0
0
0
Change in coreboot[master]: device/azalia_device: Drop unused function parameter
by Paul Fagerburg (Code Review)
11 Nov '21
11 Nov '21
Paul Fagerburg has submitted this change. (
https://review.coreboot.org/c/coreboot/+/59119
) Change subject: device/azalia_device: Drop unused function parameter ...................................................................... device/azalia_device: Drop unused function parameter The `dev` parameter of the `azalia_codecs_init()` function is not used. Remove it, and update all call sites accordingly. Change-Id: Idbe4a6ee5e81d5a7fd451fb83e0fe91bd0c09f0e Signed-off-by: Angel Pons <th3fanbus(a)gmail.com> Reviewed-on:
https://review.coreboot.org/c/coreboot/+/59119
Reviewed-by: Arthur Heymans <arthur(a)aheymans.xyz> Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org> --- M src/device/azalia_device.c M src/include/device/azalia_device.h 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 7 files changed, 8 insertions(+), 8 deletions(-) Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved diff --git a/src/device/azalia_device.c b/src/device/azalia_device.c index 2305101..e61e1dc 100644 --- a/src/device/azalia_device.c +++ b/src/device/azalia_device.c @@ -270,7 +270,7 @@ mainboard_azalia_program_runtime_verbs(base, reg32); } -void azalia_codecs_init(struct device *dev, u8 *base, u16 codec_mask) +void azalia_codecs_init(u8 *base, u16 codec_mask) { int i; @@ -300,7 +300,7 @@ if (codec_mask) { printk(BIOS_DEBUG, "azalia_audio: codec_mask = %02x\n", codec_mask); - azalia_codecs_init(dev, base, codec_mask); + azalia_codecs_init(base, codec_mask); } } diff --git a/src/include/device/azalia_device.h b/src/include/device/azalia_device.h index d717fdd..1562e25 100644 --- a/src/include/device/azalia_device.h +++ b/src/include/device/azalia_device.h @@ -24,7 +24,7 @@ u32 azalia_find_verb(const u32 *verb_table, u32 verb_table_bytes, u32 viddid, const u32 **verb); int azalia_program_verb_table(u8 *base, const u32 *verbs, u32 verb_size); void azalia_codec_init(u8 *base, int addr, const u32 *verb_table, u32 verb_table_bytes); -void azalia_codecs_init(struct device *dev, u8 *base, u16 codec_mask); +void azalia_codecs_init(u8 *base, u16 codec_mask); void azalia_audio_init(struct device *dev); extern struct device_operations default_azalia_audio_ops; diff --git a/src/southbridge/intel/bd82x6x/azalia.c b/src/southbridge/intel/bd82x6x/azalia.c index ae9b821..0a0b515 100644 --- a/src/southbridge/intel/bd82x6x/azalia.c +++ b/src/southbridge/intel/bd82x6x/azalia.c @@ -110,7 +110,7 @@ if (codec_mask) { printk(BIOS_DEBUG, "Azalia: codec_mask = %02x\n", codec_mask); - azalia_codecs_init(dev, base, codec_mask); + azalia_codecs_init(base, codec_mask); } /* Enable dynamic clock gating */ diff --git a/src/southbridge/intel/i82801gx/azalia.c b/src/southbridge/intel/i82801gx/azalia.c index 0730744..33a0cd8 100644 --- a/src/southbridge/intel/i82801gx/azalia.c +++ b/src/southbridge/intel/i82801gx/azalia.c @@ -95,7 +95,7 @@ if (codec_mask) { printk(BIOS_DEBUG, "Azalia: codec_mask = %02x\n", codec_mask); - azalia_codecs_init(dev, base, codec_mask); + azalia_codecs_init(base, codec_mask); } } diff --git a/src/southbridge/intel/i82801ix/azalia.c b/src/southbridge/intel/i82801ix/azalia.c index c929be7..26144c3 100644 --- a/src/southbridge/intel/i82801ix/azalia.c +++ b/src/southbridge/intel/i82801ix/azalia.c @@ -78,7 +78,7 @@ if (codec_mask) { printk(BIOS_DEBUG, "Azalia: codec_mask = %02x\n", codec_mask); - azalia_codecs_init(dev, base, codec_mask); + azalia_codecs_init(base, codec_mask); } } diff --git a/src/southbridge/intel/i82801jx/azalia.c b/src/southbridge/intel/i82801jx/azalia.c index c637f08..bb8aec4 100644 --- a/src/southbridge/intel/i82801jx/azalia.c +++ b/src/southbridge/intel/i82801jx/azalia.c @@ -78,7 +78,7 @@ if (codec_mask) { printk(BIOS_DEBUG, "Azalia: codec_mask = %02x\n", codec_mask); - azalia_codecs_init(dev, base, codec_mask); + azalia_codecs_init(base, codec_mask); } } diff --git a/src/southbridge/intel/ibexpeak/azalia.c b/src/southbridge/intel/ibexpeak/azalia.c index 32b4bb0..17db658 100644 --- a/src/southbridge/intel/ibexpeak/azalia.c +++ b/src/southbridge/intel/ibexpeak/azalia.c @@ -116,7 +116,7 @@ if (codec_mask) { printk(BIOS_DEBUG, "Azalia: codec_mask = %02x\n", codec_mask); - azalia_codecs_init(dev, base, codec_mask); + azalia_codecs_init(base, codec_mask); } /* Enable dynamic clock gating */ -- To view, visit
https://review.coreboot.org/c/coreboot/+/59119
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: Idbe4a6ee5e81d5a7fd451fb83e0fe91bd0c09f0e Gerrit-Change-Number: 59119 Gerrit-PatchSet: 2 Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com> Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz> Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org> Gerrit-Reviewer: Paul Fagerburg <pfagerburg(a)chromium.org> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-MessageType: merged
1
0
0
0
Change in coreboot[master]: haswell/lynxpoint/broadwell: Use `azalia_codec_init()`
by Paul Fagerburg (Code Review)
11 Nov '21
11 Nov '21
Paul Fagerburg has submitted this change. (
https://review.coreboot.org/c/coreboot/+/59118
) Change subject: haswell/lynxpoint/broadwell: Use `azalia_codec_init()` ...................................................................... haswell/lynxpoint/broadwell: Use `azalia_codec_init()` Use the functionally-equivalent common Azalia code to get rid of redundant code. Change-Id: I83cf1a3a1a3854c9283ccac5e254357a32638dda Signed-off-by: Angel Pons <th3fanbus(a)gmail.com> Reviewed-on:
https://review.coreboot.org/c/coreboot/+/59118
Reviewed-by: Arthur Heymans <arthur(a)aheymans.xyz> Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org> --- M src/northbridge/intel/haswell/minihd.c M src/soc/intel/broadwell/minihd.c M src/soc/intel/broadwell/pch/hda.c M src/southbridge/intel/lynxpoint/azalia.c M src/southbridge/intel/lynxpoint/hda_verb.c M src/southbridge/intel/lynxpoint/hda_verb.h 6 files changed, 8 insertions(+), 103 deletions(-) Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved diff --git a/src/northbridge/intel/haswell/minihd.c b/src/northbridge/intel/haswell/minihd.c index 6896464..558f41f 100644 --- a/src/northbridge/intel/haswell/minihd.c +++ b/src/northbridge/intel/haswell/minihd.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include <console/console.h> +#include <device/azalia_device.h> #include <device/device.h> #include <device/pci.h> #include <device/pci_ids.h> @@ -78,8 +79,8 @@ if (codec_mask) { for (i = 3; i >= 0; i--) { if (codec_mask & (1 << i)) - hda_codec_init(base, i, sizeof(minihd_verb_table), - minihd_verb_table); + azalia_codec_init(base, i, minihd_verb_table, + sizeof(minihd_verb_table)); } } } diff --git a/src/soc/intel/broadwell/minihd.c b/src/soc/intel/broadwell/minihd.c index a07d9b1..396c283 100644 --- a/src/soc/intel/broadwell/minihd.c +++ b/src/soc/intel/broadwell/minihd.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include <console/console.h> +#include <device/azalia_device.h> #include <device/device.h> #include <device/pci.h> #include <device/pci_ids.h> @@ -79,8 +80,8 @@ if (codec_mask) { for (i = 3; i >= 0; i--) { if (codec_mask & (1 << i)) - hda_codec_init(base, i, sizeof(minihd_verb_table), - minihd_verb_table); + azalia_codec_init(base, i, minihd_verb_table, + sizeof(minihd_verb_table)); } } diff --git a/src/soc/intel/broadwell/pch/hda.c b/src/soc/intel/broadwell/pch/hda.c index 2230614..5c5e08f 100644 --- a/src/soc/intel/broadwell/pch/hda.c +++ b/src/soc/intel/broadwell/pch/hda.c @@ -18,9 +18,7 @@ /* Can support up to 4 codecs */ for (i = 3; i >= 0; i--) { if (codec_mask & (1 << i)) - hda_codec_init(base, i, - cim_verb_data_size, - cim_verb_data); + azalia_codec_init(base, i, cim_verb_data, cim_verb_data_size); } if (pc_beep_verbs_size) diff --git a/src/southbridge/intel/lynxpoint/azalia.c b/src/southbridge/intel/lynxpoint/azalia.c index 8e138f1..9201caa 100644 --- a/src/southbridge/intel/lynxpoint/azalia.c +++ b/src/southbridge/intel/lynxpoint/azalia.c @@ -18,9 +18,7 @@ /* Can support up to 4 codecs */ for (i = 3; i >= 0; i--) { if (codec_mask & (1 << i)) - hda_codec_init(base, i, - cim_verb_data_size, - cim_verb_data); + azalia_codec_init(base, i, cim_verb_data, cim_verb_data_size); } if (pc_beep_verbs_size) diff --git a/src/southbridge/intel/lynxpoint/hda_verb.c b/src/southbridge/intel/lynxpoint/hda_verb.c index ba30f1d..809ab3b 100644 --- a/src/southbridge/intel/lynxpoint/hda_verb.c +++ b/src/southbridge/intel/lynxpoint/hda_verb.c @@ -46,95 +46,3 @@ printk(BIOS_DEBUG, "HDA: No codec!\n"); return 0; } - -/* - * Wait 50usec for the codec to indicate it is ready. - * No response would imply that the codec is non-operative. - */ -static int hda_wait_for_ready(u8 *base) -{ - /* Use a 50 usec timeout - the Linux kernel uses the same duration */ - int timeout = 50; - - while (timeout--) { - u32 reg32 = read32(base + HDA_ICII_REG); - if (!(reg32 & HDA_ICII_BUSY)) - return 0; - udelay(1); - } - - return -1; -} - -/* - * Wait 50usec for the codec to indicate that it accepted the previous command. - * No response would imply that the code is non-operative. - */ -static int hda_wait_for_valid(u8 *base) -{ - u32 reg32; - /* Use a 50 usec timeout - the Linux kernel uses the same duration */ - int timeout = 50; - - /* Send the verb to the codec */ - reg32 = read32(base + HDA_ICII_REG); - reg32 |= HDA_ICII_BUSY | HDA_ICII_VALID; - write32(base + HDA_ICII_REG, reg32); - - while (timeout--) { - reg32 = read32(base + HDA_ICII_REG); - if ((reg32 & (HDA_ICII_VALID | HDA_ICII_BUSY)) == HDA_ICII_VALID) - return 0; - udelay(1); - } - - return -1; -} - -int hda_codec_init(u8 *base, int addr, int verb_size, const u32 *verb_data) -{ - const u32 *verb; - u32 reg32, size; - int rc; - - printk(BIOS_DEBUG, "HDA: Initializing codec #%d\n", addr); - - if (!verb_size || !verb_data) { - printk(BIOS_DEBUG, "HDA: No verb list!\n"); - return -1; - } - - /* 1 */ - if (hda_wait_for_ready(base) < 0) { - printk(BIOS_DEBUG, " codec not ready.\n"); - return -1; - } - - reg32 = (addr << 28) | 0x000f0000; - write32(base + HDA_IC_REG, reg32); - - if (hda_wait_for_valid(base) < 0) { - printk(BIOS_DEBUG, " codec not valid.\n"); - return -1; - } - - /* 2 */ - reg32 = read32(base + HDA_IR_REG); - printk(BIOS_DEBUG, "HDA: codec viddid: %08x\n", reg32); - - size = azalia_find_verb(verb_data, verb_size, reg32, &verb); - if (!size) { - printk(BIOS_DEBUG, "HDA: No verb table entry found\n"); - return -1; - } - - /* 3 */ - rc = azalia_program_verb_table(base, verb, size); - - if (rc < 0) - printk(BIOS_DEBUG, "HDA: verb not loaded\n"); - else - printk(BIOS_DEBUG, "HDA: verb loaded.\n"); - - return rc; -} diff --git a/src/southbridge/intel/lynxpoint/hda_verb.h b/src/southbridge/intel/lynxpoint/hda_verb.h index 327811f..1d6ef39 100644 --- a/src/southbridge/intel/lynxpoint/hda_verb.h +++ b/src/southbridge/intel/lynxpoint/hda_verb.h @@ -6,6 +6,5 @@ #include <stdint.h> int hda_codec_detect(u8 *base); -int hda_codec_init(u8 *base, int addr, int verb_size, const u32 *verb_data); #endif -- To view, visit
https://review.coreboot.org/c/coreboot/+/59118
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I83cf1a3a1a3854c9283ccac5e254357a32638dda Gerrit-Change-Number: 59118 Gerrit-PatchSet: 2 Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com> Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz> Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org> Gerrit-Reviewer: Paul Fagerburg <pfagerburg(a)chromium.org> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-MessageType: merged
1
0
0
0
Change in coreboot[master]: device/azalia_device: Adapt and export `codec_init()`
by Paul Fagerburg (Code Review)
11 Nov '21
11 Nov '21
Paul Fagerburg has submitted this change. (
https://review.coreboot.org/c/coreboot/+/59117
) Change subject: device/azalia_device: Adapt and export `codec_init()` ...................................................................... device/azalia_device: Adapt and export `codec_init()` Make the `codec_init()` function non-static so that it can be used in other places. Rename it to `azalia_codec_init()` for consistency with the other functions of the API. Also, update the function's signature to make it more flexible. Remove the unused `dev` parameter and allow callers to pass the verb table to use. Update the original call site to preserve behavior. Change-Id: I5343796242065b5fedc78cd95bcf010c9e2623dd Signed-off-by: Angel Pons <th3fanbus(a)gmail.com> Reviewed-on:
https://review.coreboot.org/c/coreboot/+/59117
Reviewed-by: Arthur Heymans <arthur(a)aheymans.xyz> Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org> --- M src/device/azalia_device.c M src/include/device/azalia_device.h 2 files changed, 4 insertions(+), 3 deletions(-) Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved diff --git a/src/device/azalia_device.c b/src/device/azalia_device.c index c390db1..2305101 100644 --- a/src/device/azalia_device.c +++ b/src/device/azalia_device.c @@ -227,7 +227,7 @@ { } -static void codec_init(struct device *dev, u8 *base, int addr) +void azalia_codec_init(u8 *base, int addr, const u32 *verb_table, u32 verb_table_bytes) { u32 reg32; const u32 *verb; @@ -252,7 +252,7 @@ /* 2 */ reg32 = read32(base + HDA_IR_REG); printk(BIOS_DEBUG, "azalia_audio: codec viddid: %08x\n", reg32); - verb_size = azalia_find_verb(cim_verb_data, cim_verb_data_size, reg32, &verb); + verb_size = azalia_find_verb(verb_table, verb_table_bytes, reg32, &verb); if (!verb_size) { printk(BIOS_DEBUG, "azalia_audio: No verb!\n"); @@ -276,7 +276,7 @@ for (i = CONFIG_AZALIA_MAX_CODECS - 1; i >= 0; i--) { if (codec_mask & (1 << i)) - codec_init(dev, base, i); + azalia_codec_init(base, i, cim_verb_data, cim_verb_data_size); } azalia_program_verb_table(base, pc_beep_verbs, pc_beep_verbs_size); diff --git a/src/include/device/azalia_device.h b/src/include/device/azalia_device.h index 8f0d212..d717fdd 100644 --- a/src/include/device/azalia_device.h +++ b/src/include/device/azalia_device.h @@ -23,6 +23,7 @@ int azalia_exit_reset(u8 *base); u32 azalia_find_verb(const u32 *verb_table, u32 verb_table_bytes, u32 viddid, const u32 **verb); int azalia_program_verb_table(u8 *base, const u32 *verbs, u32 verb_size); +void azalia_codec_init(u8 *base, int addr, const u32 *verb_table, u32 verb_table_bytes); void azalia_codecs_init(struct device *dev, u8 *base, u16 codec_mask); void azalia_audio_init(struct device *dev); extern struct device_operations default_azalia_audio_ops; -- To view, visit
https://review.coreboot.org/c/coreboot/+/59117
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I5343796242065b5fedc78cd95bcf010c9e2623dd Gerrit-Change-Number: 59117 Gerrit-PatchSet: 2 Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com> Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz> Gerrit-Reviewer: Paul Fagerburg <pfagerburg(a)chromium.org> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-MessageType: merged
1
0
0
0
Change in coreboot[master]: lynxpoint/broadwell: Use `azalia_program_verb_table()`
by Paul Fagerburg (Code Review)
11 Nov '21
11 Nov '21
Paul Fagerburg has submitted this change. (
https://review.coreboot.org/c/coreboot/+/59116
) Change subject: lynxpoint/broadwell: Use `azalia_program_verb_table()` ...................................................................... lynxpoint/broadwell: Use `azalia_program_verb_table()` Use the `azalia_program_verb_table()` function in preparation to deduplicate Azalia init code. Change-Id: I22cfee41e001c9ecf4fbac37aadbd12f43ac8aaf Signed-off-by: Angel Pons <th3fanbus(a)gmail.com> Reviewed-on:
https://review.coreboot.org/c/coreboot/+/59116
Reviewed-by: Arthur Heymans <arthur(a)aheymans.xyz> Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org> --- M src/soc/intel/broadwell/pch/hda.c M src/southbridge/intel/lynxpoint/azalia.c M src/southbridge/intel/lynxpoint/hda_verb.c M src/southbridge/intel/lynxpoint/hda_verb.h 4 files changed, 3 insertions(+), 21 deletions(-) Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved diff --git a/src/soc/intel/broadwell/pch/hda.c b/src/soc/intel/broadwell/pch/hda.c index 37f2d9f..2230614 100644 --- a/src/soc/intel/broadwell/pch/hda.c +++ b/src/soc/intel/broadwell/pch/hda.c @@ -24,7 +24,7 @@ } if (pc_beep_verbs_size) - hda_codec_write(base, pc_beep_verbs_size, pc_beep_verbs); + azalia_program_verb_table(base, pc_beep_verbs, pc_beep_verbs_size); } static void hda_pch_init(struct device *dev, u8 *base) diff --git a/src/southbridge/intel/lynxpoint/azalia.c b/src/southbridge/intel/lynxpoint/azalia.c index fe5c4c9..8e138f1 100644 --- a/src/southbridge/intel/lynxpoint/azalia.c +++ b/src/southbridge/intel/lynxpoint/azalia.c @@ -24,7 +24,7 @@ } if (pc_beep_verbs_size) - hda_codec_write(base, pc_beep_verbs_size, pc_beep_verbs); + azalia_program_verb_table(base, pc_beep_verbs, pc_beep_verbs_size); } static void azalia_pch_init(struct device *dev, u8 *base) diff --git a/src/southbridge/intel/lynxpoint/hda_verb.c b/src/southbridge/intel/lynxpoint/hda_verb.c index 41ecac1..ba30f1d 100644 --- a/src/southbridge/intel/lynxpoint/hda_verb.c +++ b/src/southbridge/intel/lynxpoint/hda_verb.c @@ -91,23 +91,6 @@ return -1; } -int hda_codec_write(u8 *base, u32 size, const u32 *data) -{ - int i; - - for (i = 0; i < size; i++) { - if (hda_wait_for_ready(base) < 0) - return -1; - - write32(base + HDA_IC_REG, data[i]); - - if (hda_wait_for_valid(base) < 0) - return -1; - } - - return 0; -} - int hda_codec_init(u8 *base, int addr, int verb_size, const u32 *verb_data) { const u32 *verb; @@ -146,7 +129,7 @@ } /* 3 */ - rc = hda_codec_write(base, size, verb); + rc = azalia_program_verb_table(base, verb, size); if (rc < 0) printk(BIOS_DEBUG, "HDA: verb not loaded\n"); diff --git a/src/southbridge/intel/lynxpoint/hda_verb.h b/src/southbridge/intel/lynxpoint/hda_verb.h index 07ee513..327811f 100644 --- a/src/southbridge/intel/lynxpoint/hda_verb.h +++ b/src/southbridge/intel/lynxpoint/hda_verb.h @@ -6,7 +6,6 @@ #include <stdint.h> int hda_codec_detect(u8 *base); -int hda_codec_write(u8 *base, u32 size, const u32 *data); int hda_codec_init(u8 *base, int addr, int verb_size, const u32 *verb_data); #endif -- To view, visit
https://review.coreboot.org/c/coreboot/+/59116
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I22cfee41e001c9ecf4fbac37aadbd12f43ac8aaf Gerrit-Change-Number: 59116 Gerrit-PatchSet: 2 Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com> Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz> Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org> Gerrit-Reviewer: Paul Fagerburg <pfagerburg(a)chromium.org> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-MessageType: merged
1
0
0
0
Change in coreboot[master]: azalia_device: Report if codec verb loading failed
by Paul Fagerburg (Code Review)
11 Nov '21
11 Nov '21
Paul Fagerburg has submitted this change. (
https://review.coreboot.org/c/coreboot/+/59115
) Change subject: azalia_device: Report if codec verb loading failed ...................................................................... azalia_device: Report if codec verb loading failed Handle the return value of `azalia_program_verb_table()` and print different messages accordingly. Change-Id: I99e9e1416217c5e67c529944736affb31f9c7d2f Signed-off-by: Angel Pons <th3fanbus(a)gmail.com> Reviewed-on:
https://review.coreboot.org/c/coreboot/+/59115
Reviewed-by: Arthur Heymans <arthur(a)aheymans.xyz> Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org> --- M src/device/azalia_device.c 1 file changed, 5 insertions(+), 2 deletions(-) Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved diff --git a/src/device/azalia_device.c b/src/device/azalia_device.c index c3bb91b..c390db1 100644 --- a/src/device/azalia_device.c +++ b/src/device/azalia_device.c @@ -261,8 +261,11 @@ printk(BIOS_DEBUG, "azalia_audio: verb_size: %u\n", verb_size); /* 3 */ - azalia_program_verb_table(base, verb, verb_size); - printk(BIOS_DEBUG, "azalia_audio: verb loaded.\n"); + const int rc = azalia_program_verb_table(base, verb, verb_size); + if (rc < 0) + printk(BIOS_DEBUG, "azalia_audio: verb not loaded.\n"); + else + printk(BIOS_DEBUG, "azalia_audio: verb loaded.\n"); mainboard_azalia_program_runtime_verbs(base, reg32); } -- To view, visit
https://review.coreboot.org/c/coreboot/+/59115
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I99e9e1416217c5e67c529944736affb31f9c7d2f Gerrit-Change-Number: 59115 Gerrit-PatchSet: 2 Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com> Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz> Gerrit-Reviewer: Paul Fagerburg <pfagerburg(a)chromium.org> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-MessageType: merged
1
0
0
0
Change in coreboot[master]: sb/intel/bd82x6x: Use `azalia_codecs_init()`
by Paul Fagerburg (Code Review)
11 Nov '21
11 Nov '21
Paul Fagerburg has submitted this change. (
https://review.coreboot.org/c/coreboot/+/59114
) Change subject: sb/intel/bd82x6x: Use `azalia_codecs_init()` ...................................................................... sb/intel/bd82x6x: Use `azalia_codecs_init()` Use the functionally-equivalent common Azalia code to get rid of redundant code. Change-Id: I982c1725d5affe95a20aa6713a246cd6b1ad270c Signed-off-by: Angel Pons <th3fanbus(a)gmail.com> Reviewed-on:
https://review.coreboot.org/c/coreboot/+/59114
Reviewed-by: Arthur Heymans <arthur(a)aheymans.xyz> Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org> --- M src/southbridge/intel/bd82x6x/Kconfig M src/southbridge/intel/bd82x6x/azalia.c 2 files changed, 4 insertions(+), 96 deletions(-) Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved diff --git a/src/southbridge/intel/bd82x6x/Kconfig b/src/southbridge/intel/bd82x6x/Kconfig index c9e8662..ee8a5cc 100644 --- a/src/southbridge/intel/bd82x6x/Kconfig +++ b/src/southbridge/intel/bd82x6x/Kconfig @@ -37,6 +37,9 @@ select SOUTHBRIDGE_INTEL_COMMON_WATCHDOG select SOUTHBRIDGE_INTEL_COMMON_USB_DEBUG +config AZALIA_MAX_CODECS + default 4 + config EHCI_BAR hex default 0xfef00000 diff --git a/src/southbridge/intel/bd82x6x/azalia.c b/src/southbridge/intel/bd82x6x/azalia.c index 974a390..ae9b821 100644 --- a/src/southbridge/intel/bd82x6x/azalia.c +++ b/src/southbridge/intel/bd82x6x/azalia.c @@ -37,101 +37,6 @@ return 0; } -/* - * Wait 50usec for the codec to indicate it is ready. - * No response would imply that the codec is non-operative. - */ - -static int wait_for_ready(u8 *base) -{ - /* Use a 1msec timeout */ - int timeout = 1000; - - while (timeout--) { - u32 reg32 = read32(base + HDA_ICII_REG); - if (!(reg32 & HDA_ICII_BUSY)) - return 0; - udelay(1); - } - - return -1; -} - -/* - * Wait 50usec for the codec to indicate that it accepted the previous command. - * No response would imply that the code is non-operative. - */ - -static int wait_for_valid(u8 *base) -{ - u32 reg32; - /* Use a 1msec timeout */ - int timeout = 1000; - - /* Send the verb to the codec */ - reg32 = read32(base + HDA_ICII_REG); - reg32 |= HDA_ICII_BUSY | HDA_ICII_VALID; - write32(base + HDA_ICII_REG, reg32); - - while (timeout--) { - reg32 = read32(base + HDA_ICII_REG); - if ((reg32 & (HDA_ICII_VALID | HDA_ICII_BUSY)) == HDA_ICII_VALID) - return 0; - udelay(1); - } - - return -1; -} - -static void codec_init(struct device *dev, u8 *base, int addr) -{ - u32 reg32; - const u32 *verb; - u32 verb_size; - - printk(BIOS_DEBUG, "Azalia: Initializing codec #%d\n", addr); - - /* 1 */ - if (wait_for_ready(base) < 0) { - printk(BIOS_DEBUG, " codec not ready.\n"); - return; - } - - reg32 = (addr << 28) | 0x000f0000; - write32(base + HDA_IC_REG, reg32); - - if (wait_for_valid(base) < 0) { - printk(BIOS_DEBUG, " codec not valid.\n"); - return; - } - - /* 2 */ - reg32 = read32(base + HDA_IR_REG); - printk(BIOS_DEBUG, "Azalia: codec viddid: %08x\n", reg32); - verb_size = azalia_find_verb(cim_verb_data, cim_verb_data_size, reg32, &verb); - - if (!verb_size) { - printk(BIOS_DEBUG, "Azalia: No verb!\n"); - return; - } - printk(BIOS_DEBUG, "Azalia: verb_size: %d\n", verb_size); - - /* 3 */ - azalia_program_verb_table(base, verb, verb_size); - printk(BIOS_DEBUG, "Azalia: verb loaded.\n"); -} - -static void codecs_init(struct device *dev, u8 *base, u32 codec_mask) -{ - int i; - for (i = 3; i >= 0; i--) { - if (codec_mask & (1 << i)) - codec_init(dev, base, i); - } - - azalia_program_verb_table(base, pc_beep_verbs, pc_beep_verbs_size); -} - static void azalia_init(struct device *dev) { u8 *base; @@ -205,7 +110,7 @@ if (codec_mask) { printk(BIOS_DEBUG, "Azalia: codec_mask = %02x\n", codec_mask); - codecs_init(dev, base, codec_mask); + azalia_codecs_init(dev, base, codec_mask); } /* Enable dynamic clock gating */ -- To view, visit
https://review.coreboot.org/c/coreboot/+/59114
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I982c1725d5affe95a20aa6713a246cd6b1ad270c Gerrit-Change-Number: 59114 Gerrit-PatchSet: 2 Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com> Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz> Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org> Gerrit-Reviewer: Paul Fagerburg <pfagerburg(a)chromium.org> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-MessageType: merged
1
0
0
0
Change in coreboot[master]: soc/amd/psp_verstage: Init TPM on S0i3 resume
by Kangheui Won (Code Review)
11 Nov '21
11 Nov '21
Attention is currently required from: Raul Rangel, Andrey Pronin, Julius Werner, Rob Barnes, Karthik Ramasubramanian. Kangheui Won has posted comments on this change. (
https://review.coreboot.org/c/coreboot/+/58870
) Change subject: soc/amd/psp_verstage: Init TPM on S0i3 resume ...................................................................... Patch Set 12: Code-Review+1 (2 comments) File src/soc/amd/common/psp_verstage/psp_verstage.c:
https://review.coreboot.org/c/coreboot/+/58870/comment/4460e267_805c4100
PS12, Line 8: #include <bootstate.h> nit: is this necessary?
https://review.coreboot.org/c/coreboot/+/58870/comment/ef513db9_25c796b6
PS12, Line 21: #include <security/vboot/tpm_common.h> same here. -- To view, visit
https://review.coreboot.org/c/coreboot/+/58870
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: Ie511928da6a8b4be62621fd2c4c31a8d1e724d48 Gerrit-Change-Number: 58870 Gerrit-PatchSet: 12 Gerrit-Owner: Rob Barnes <robbarnes(a)google.com> Gerrit-Reviewer: Andrey Pronin <apronin(a)chromium.org> Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de> Gerrit-Reviewer: Jason Glenesk <jason.glenesk(a)gmail.com> Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org> Gerrit-Reviewer: Kangheui Won <khwon(a)chromium.org> Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com> Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd(a)gmail.com> Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org> Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-Attention: Raul Rangel <rrangel(a)chromium.org> Gerrit-Attention: Andrey Pronin <apronin(a)chromium.org> Gerrit-Attention: Julius Werner <jwerner(a)chromium.org> Gerrit-Attention: Rob Barnes <robbarnes(a)google.com> Gerrit-Attention: Andrey Pronin <apronin(a)chromium.org> Gerrit-Attention: Karthik Ramasubramanian <kramasub(a)google.com> Gerrit-Comment-Date: Thu, 11 Nov 2021 22:43:59 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1
0
0
0
Change in coreboot[master]: sb/intel/ibexpeak: Use `azalia_codecs_init()`
by Paul Fagerburg (Code Review)
11 Nov '21
11 Nov '21
Paul Fagerburg has submitted this change. (
https://review.coreboot.org/c/coreboot/+/59113
) Change subject: sb/intel/ibexpeak: Use `azalia_codecs_init()` ...................................................................... sb/intel/ibexpeak: Use `azalia_codecs_init()` Use the functionally-equivalent common Azalia code to get rid of redundant code. Change-Id: Ib3b40e5788c6315cad02b670346997c9179e5fab Signed-off-by: Angel Pons <th3fanbus(a)gmail.com> Reviewed-on:
https://review.coreboot.org/c/coreboot/+/59113
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org> Reviewed-by: Arthur Heymans <arthur(a)aheymans.xyz> --- M src/southbridge/intel/ibexpeak/Kconfig M src/southbridge/intel/ibexpeak/azalia.c 2 files changed, 4 insertions(+), 97 deletions(-) Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved diff --git a/src/southbridge/intel/ibexpeak/Kconfig b/src/southbridge/intel/ibexpeak/Kconfig index 6972da7..b74cb73 100644 --- a/src/southbridge/intel/ibexpeak/Kconfig +++ b/src/southbridge/intel/ibexpeak/Kconfig @@ -33,6 +33,9 @@ select SOUTHBRIDGE_INTEL_COMMON_WATCHDOG select SOUTHBRIDGE_INTEL_COMMON_USB_DEBUG +config AZALIA_MAX_CODECS + default 4 + config EHCI_BAR hex default 0xfef00000 diff --git a/src/southbridge/intel/ibexpeak/azalia.c b/src/southbridge/intel/ibexpeak/azalia.c index 54fb3be..32b4bb0 100644 --- a/src/southbridge/intel/ibexpeak/azalia.c +++ b/src/southbridge/intel/ibexpeak/azalia.c @@ -35,102 +35,6 @@ return 0; } -/* - * Wait 50usec for the codec to indicate it is ready. - * No response would imply that the codec is non-operative. - */ - -static int wait_for_ready(u8 *base) -{ - /* Use a 1msec timeout */ - int timeout = 1000; - - while (timeout--) { - u32 reg32 = read32(base + HDA_ICII_REG); - if (!(reg32 & HDA_ICII_BUSY)) - return 0; - udelay(1); - } - - return -1; -} - -/* - * Wait 50usec for the codec to indicate that it accepted the previous command. - * No response would imply that the code is non-operative. - */ - -static int wait_for_valid(u8 *base) -{ - u32 reg32; - /* Use a 1msec timeout */ - int timeout = 1000; - - /* Send the verb to the codec */ - reg32 = read32(base + HDA_ICII_REG); - reg32 |= HDA_ICII_BUSY | HDA_ICII_VALID; - write32(base + HDA_ICII_REG, reg32); - - while (timeout--) { - reg32 = read32(base + HDA_ICII_REG); - if ((reg32 & (HDA_ICII_VALID | HDA_ICII_BUSY)) == HDA_ICII_VALID) - return 0; - udelay(1); - } - - return -1; -} - -static void codec_init(struct device *dev, u8 *base, int addr) -{ - u32 reg32; - const u32 *verb; - u32 verb_size; - - printk(BIOS_DEBUG, "Azalia: Initializing codec #%d\n", addr); - - /* 1 */ - if (wait_for_ready(base) < 0) { - printk(BIOS_DEBUG, " codec not ready.\n"); - return; - } - - reg32 = (addr << 28) | 0x000f0000; - write32(base + HDA_IC_REG, reg32); - - if (wait_for_valid(base) < 0) { - printk(BIOS_DEBUG, " codec not valid.\n"); - return; - } - - /* 2 */ - reg32 = read32(base + HDA_IR_REG); - printk(BIOS_DEBUG, "Azalia: codec viddid: %08x\n", reg32); - verb_size = azalia_find_verb(cim_verb_data, cim_verb_data_size, reg32, &verb); - - if (!verb_size) { - printk(BIOS_DEBUG, "Azalia: No verb!\n"); - return; - } - printk(BIOS_DEBUG, "Azalia: verb_size: %d\n", verb_size); - - /* 3 */ - azalia_program_verb_table(base, verb, verb_size); - printk(BIOS_DEBUG, "Azalia: verb loaded.\n"); -} - -static void codecs_init(struct device *dev, u8 *base, u32 codec_mask) -{ - int i; - - for (i = 3; i >= 0; i--) { - if (codec_mask & (1 << i)) - codec_init(dev, base, i); - } - - azalia_program_verb_table(base, pc_beep_verbs, pc_beep_verbs_size); -} - static void azalia_init(struct device *dev) { u8 *base; @@ -212,7 +116,7 @@ if (codec_mask) { printk(BIOS_DEBUG, "Azalia: codec_mask = %02x\n", codec_mask); - codecs_init(dev, base, codec_mask); + azalia_codecs_init(dev, base, codec_mask); } /* Enable dynamic clock gating */ -- To view, visit
https://review.coreboot.org/c/coreboot/+/59113
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: Ib3b40e5788c6315cad02b670346997c9179e5fab Gerrit-Change-Number: 59113 Gerrit-PatchSet: 2 Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com> Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz> Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org> Gerrit-Reviewer: Paul Fagerburg <pfagerburg(a)chromium.org> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-MessageType: merged
1
0
0
0
← Newer
1
...
403
404
405
406
407
408
409
...
640
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
Results per page:
10
25
50
100
200