Duncan Laurie has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41215 )
Change subject: mb/google/volteer: Add firmware configuration table ......................................................................
mb/google/volteer: Add firmware configuration table
Add the current firmware configuration table for the volteer mainboard. This is not completely filled out for all fields yet but has the entries needed for audio.
- When I2S options are selected disable the SoundWire GPIOs. - When SoundWire is enabled disable the I2S GPIOs. - When no audio is enabled disable all the GPIOs.
The current mainboard configuration value is read from the Embedded Controller CBI field and provided to the firmware configuration interface for probing.
BUG=b:147462631 TEST=Test that GPIOs are configured as expected based on the current value of the fw_config field in cbi.
Change-Id: I179f8b6436be83a2b37911777764bd26a0d404b7 Signed-off-by: Duncan Laurie dlaurie@google.com --- M src/mainboard/google/volteer/Kconfig M src/mainboard/google/volteer/Makefile.inc A src/mainboard/google/volteer/fw_config.c 3 files changed, 136 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/41215/1
diff --git a/src/mainboard/google/volteer/Kconfig b/src/mainboard/google/volteer/Kconfig index e6c6ec7..3acc0ea 100644 --- a/src/mainboard/google/volteer/Kconfig +++ b/src/mainboard/google/volteer/Kconfig @@ -13,6 +13,7 @@ select EC_GOOGLE_CHROMEEC_BOARDID select EC_GOOGLE_CHROMEEC_SKUID select EC_GOOGLE_CHROMEEC_LPC + select FW_CONFIG select HAVE_ACPI_RESUME select HAVE_ACPI_TABLES select INTEL_LPSS_UART_FOR_CONSOLE diff --git a/src/mainboard/google/volteer/Makefile.inc b/src/mainboard/google/volteer/Makefile.inc index 9d1bb3f..2ddd508 100644 --- a/src/mainboard/google/volteer/Makefile.inc +++ b/src/mainboard/google/volteer/Makefile.inc @@ -13,6 +13,7 @@ ramstage-$(CONFIG_CHROMEOS) += chromeos.c ramstage-y += ec.c ramstage-y += mainboard.c +ramstage-$(CONFIG_FW_CONFIG) += fw_config.c
smm-y += smihandler.c
diff --git a/src/mainboard/google/volteer/fw_config.c b/src/mainboard/google/volteer/fw_config.c new file mode 100644 index 0000000..64adfe9 --- /dev/null +++ b/src/mainboard/google/volteer/fw_config.c @@ -0,0 +1,134 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* This file is part of the coreboot project. */ + +#ifndef __MAINBOARD_FW_CONFIG__ +#define __MAINBOARD_FW_CONFIG__ + +#include <commonlib/helpers.h> +#include <console/console.h> +#include <ec/google/chromeec/ec.h> +#include <fw_config.h> +#include <stdint.h> +#include <soc/gpio.h> + +static const struct pad_config dmic_enable_pads[] = { + PAD_CFG_NF(GPP_S4, NONE, DEEP, NF2), /* DMIC_CLK1 */ + PAD_CFG_NF(GPP_S5, NONE, DEEP, NF2), /* DMIC_DATA1 */ + PAD_CFG_NF(GPP_S6, NONE, DEEP, NF2), /* DMIC_CLK0 */ + PAD_CFG_NF(GPP_S7, NONE, DEEP, NF2), /* DMIC_DATA0 */ +}; + +static const struct pad_config dmic_disable_pads[] = { + PAD_NC(GPP_S4, NONE), + PAD_NC(GPP_S5, NONE), + PAD_NC(GPP_S6, NONE), + PAD_NC(GPP_S7, NONE), +}; + +static const struct pad_config sndw_enable_pads[] = { + PAD_CFG_NF(GPP_S0, NONE, DEEP, NF1), /* SNDW0_CLK */ + PAD_CFG_NF(GPP_S1, NONE, DEEP, NF1), /* SNDW0_DATA */ + PAD_CFG_NF(GPP_S2, NONE, DEEP, NF1), /* SNDW1_CLK */ + PAD_CFG_NF(GPP_S3, NONE, DEEP, NF1), /* SNDW1_DATA */ +}; + +static const struct pad_config sndw_disable_pads[] = { + PAD_NC(GPP_S0, NONE), + PAD_NC(GPP_S1, NONE), + PAD_NC(GPP_S2, NONE), + PAD_NC(GPP_S3, NONE), +}; + +static const struct pad_config i2s_enable_pads[] = { + PAD_CFG_NF(GPP_A23, NONE, DEEP, NF1), /* I2S1_SCLK */ + PAD_CFG_NF(GPP_D19, NONE, DEEP, NF1), /* I2S_MCLK1 */ + PAD_CFG_NF(GPP_R0, NONE, DEEP, NF2), /* I2S0_SCLK */ + PAD_CFG_NF(GPP_R1, NONE, DEEP, NF2), /* I2S0_SFRM */ + PAD_CFG_NF(GPP_R2, DN_20K, DEEP, NF2), /* I2S0_TXD */ + PAD_CFG_NF(GPP_R3, NONE, DEEP, NF2), /* I2S0_RXD */ + PAD_CFG_NF(GPP_R5, NONE, DEEP, NF2), /* I2S1_RXD */ + PAD_CFG_NF(GPP_R6, NONE, DEEP, NF2), /* I2S1_TXD */ + PAD_CFG_NF(GPP_R7, NONE, DEEP, NF2), /* I2S1_SFRM */ +}; + +static const struct pad_config i2s_disable_pads[] = { + PAD_NC(GPP_A23, NONE), + PAD_NC(GPP_D19, NONE), + PAD_NC(GPP_R0, NONE), + PAD_NC(GPP_R1, NONE), + PAD_NC(GPP_R2, DN_20K), + PAD_NC(GPP_R3, NONE), + PAD_NC(GPP_R5, NONE), + PAD_NC(GPP_R6, NONE), + PAD_NC(GPP_R7, NONE), +}; + +static void audio_db_none_cb(const struct fw_config_option *option) +{ + printk(BIOS_INFO, "%s: Configure GPIOs for no audio.\n", __func__); + gpio_configure_pads(i2s_disable_pads, ARRAY_SIZE(i2s_disable_pads)); + gpio_configure_pads(dmic_disable_pads, ARRAY_SIZE(dmic_disable_pads)); + gpio_configure_pads(sndw_disable_pads, ARRAY_SIZE(sndw_disable_pads)); +} + +static void audio_db_i2s_cb(const struct fw_config_option *option) +{ + printk(BIOS_INFO, "%s: Configure GPIOs for I2S audio.\n", __func__); + gpio_configure_pads(i2s_enable_pads, ARRAY_SIZE(i2s_enable_pads)); + gpio_configure_pads(dmic_enable_pads, ARRAY_SIZE(dmic_enable_pads)); + gpio_configure_pads(sndw_disable_pads, ARRAY_SIZE(sndw_disable_pads)); +} + +static void audio_db_sndw_cb(const struct fw_config_option *option) +{ + printk(BIOS_INFO, "%s: Configure GPIOs for SoundWire audio.\n", __func__); + gpio_configure_pads(sndw_enable_pads, ARRAY_SIZE(sndw_enable_pads)); + gpio_configure_pads(dmic_enable_pads, ARRAY_SIZE(dmic_enable_pads)); + gpio_configure_pads(i2s_disable_pads, ARRAY_SIZE(i2s_disable_pads)); +} + +static const struct fw_config_field volteer_fw_config[] = { + { + FW_CONFIG_FIELD("DB", 0xf, 0), + }, + { + FW_CONFIG_FIELD("THERMAL", 0xf, 4), + }, + { + FW_CONFIG_FIELD("AUDIO", 0x7, 8), + .option = { + FW_CONFIG_OPTION_CB("NONE", 0, audio_db_none_cb), + FW_CONFIG_OPTION_CB("MAX98357_ALC5682I_I2S", 1, audio_db_i2s_cb), + FW_CONFIG_OPTION_CB("MAX98373_ALC5682I_I2S", 2, audio_db_i2s_cb), + FW_CONFIG_OPTION_CB("MAX98373_ALC5682_SNDW", 3, audio_db_sndw_cb) + }, + }, + { + FW_CONFIG_FIELD("TABLETMODE", 0x1, 11), + .option = { + FW_CONFIG_OPTION("DISABLED", 0), + FW_CONFIG_OPTION("ENABLED", 1) + }, + }, + { + FW_CONFIG_FIELD("LTE_DB", 0x3, 12), + .option = { + FW_CONFIG_OPTION("ABSENT", 0), + FW_CONFIG_OPTION("PRESENT", 1) + }, + }, + { } +}; + +size_t mainboard_get_fw_config(const struct fw_config_field **table, uint32_t *config) +{ + if (google_chromeec_cbi_get_fw_config(config) < 0) { + printk(BIOS_ERR, "Could not get fw_config from EC\n"); + return 0; + } + + *table = volteer_fw_config; + return ARRAY_SIZE(volteer_fw_config); +} + +#endif /* __MAINBOARD_FW_CONFIG__ */
Hello Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/41215
to look at the new patch set (#2).
Change subject: mb/google/volteer: Add firmware configuration table ......................................................................
mb/google/volteer: Add firmware configuration table
Add the current firmware configuration table for the volteer mainboard. This is not completely filled out for all fields yet but has the entries needed for audio.
- When I2S options are selected disable the SoundWire GPIOs. - When SoundWire is enabled disable the I2S GPIOs. - When no audio is enabled disable all the GPIOs.
The current mainboard configuration value is read from the Embedded Controller CBI field and provided to the firmware configuration interface for probing.
BUG=b:147462631 TEST=Test that GPIOs are configured as expected based on the current value of the fw_config field in cbi.
Change-Id: I179f8b6436be83a2b37911777764bd26a0d404b7 Signed-off-by: Duncan Laurie dlaurie@google.com --- M src/mainboard/google/volteer/Kconfig M src/mainboard/google/volteer/Makefile.inc A src/mainboard/google/volteer/fw_config.c 3 files changed, 136 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/41215/2
Duncan Laurie has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41215 )
Change subject: mb/google/volteer: Add firmware configuration table ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/41215/3/src/mainboard/google/voltee... File src/mainboard/google/volteer/fw_config.c:
https://review.coreboot.org/c/coreboot/+/41215/3/src/mainboard/google/voltee... PS3, Line 90: volteer_fw_config I need to make some changes here to support variants adding to (maybe overriding) the options within a field. I don't think it is a blocker for landing these changes as I am still thinking about the best way to do it.
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41215 )
Change subject: mb/google/volteer: Add firmware configuration table ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/41215/3/src/mainboard/google/voltee... File src/mainboard/google/volteer/fw_config.c:
https://review.coreboot.org/c/coreboot/+/41215/3/src/mainboard/google/voltee... PS3, Line 90: volteer_fw_config
I need to make some changes here to support variants adding to (maybe overriding) the options within […]
Maybe similar to the gpio_configure_pads_with_override ? Provide a base configuration and then the variant can override specific defaults or callbacks?
Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/41215
to look at the new patch set (#4).
Change subject: mb/google/volteer: Add firmware configuration table ......................................................................
mb/google/volteer: Add firmware configuration table
Add the current firmware configuration table for the volteer mainboard and define some actions based on probe results for audio:
- When I2S options are selected disable the SoundWire GPIOs. - When SoundWire is enabled disable the I2S GPIOs. - When no audio is enabled disable all the GPIOs.
BUG=b:147462631 TEST=Test that GPIOs are configured as expected based on the current value of the fw_config field in cbi.
Change-Id: I179f8b6436be83a2b37911777764bd26a0d404b7 Signed-off-by: Duncan Laurie dlaurie@google.com --- M src/mainboard/google/volteer/Kconfig M src/mainboard/google/volteer/Makefile.inc A src/mainboard/google/volteer/fw_config.c M src/mainboard/google/volteer/variants/baseboard/devicetree.cb 4 files changed, 111 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/41215/4
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41215 )
Change subject: mb/google/volteer: Add firmware configuration table ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/41215/4/src/mainboard/google/voltee... File src/mainboard/google/volteer/fw_config.c:
https://review.coreboot.org/c/coreboot/+/41215/4/src/mainboard/google/voltee... PS4, Line 66: if (fw_config_probe_one(FW_CONFIG(AUDIO, NONE))){ space required before the open brace '{'
Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/41215
to look at the new patch set (#5).
Change subject: mb/google/volteer: Add firmware configuration table ......................................................................
mb/google/volteer: Add firmware configuration table
Add the current firmware configuration table for the volteer mainboard and define some actions based on probe results for audio:
- When I2S options are selected disable the SoundWire GPIOs. - When SoundWire is enabled disable the I2S GPIOs. - When no audio is enabled disable all the GPIOs.
BUG=b:147462631 TEST=Test that GPIOs are configured as expected based on the current value of the fw_config field in cbi.
Change-Id: I179f8b6436be83a2b37911777764bd26a0d404b7 Signed-off-by: Duncan Laurie dlaurie@google.com --- M src/mainboard/google/volteer/Kconfig M src/mainboard/google/volteer/Makefile.inc A src/mainboard/google/volteer/fw_config.c M src/mainboard/google/volteer/variants/baseboard/devicetree.cb 4 files changed, 112 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/41215/5
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41215 )
Change subject: mb/google/volteer: Add firmware configuration table ......................................................................
Patch Set 5:
(3 comments)
https://review.coreboot.org/c/coreboot/+/41215/5/src/mainboard/google/voltee... File src/mainboard/google/volteer/fw_config.c:
https://review.coreboot.org/c/coreboot/+/41215/5/src/mainboard/google/voltee... PS5, Line 2: /* This file is part of the coreboot project. */ please remove
https://review.coreboot.org/c/coreboot/+/41215/5/src/mainboard/google/voltee... PS5, Line 4: #include <bootstate.h> : #include <commonlib/helpers.h> : #include <console/console.h> : #include <ec/google/chromeec/ec.h> : #include <fw_config.h> : #include <stdint.h> please include only what you use
https://review.coreboot.org/c/coreboot/+/41215/5/src/mainboard/google/voltee... PS5, Line 10: #include <soc/gpio.h> Please include <gpio.h>, which should indirectly include the SoC-specific <soc/gpio.h>.
(see https://review.coreboot.org/q/topic:%22soc_gpio%22+(status:open%20OR%20statu...) )
Duncan Laurie has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41215 )
Change subject: mb/google/volteer: Add firmware configuration table ......................................................................
Patch Set 5:
(3 comments)
https://review.coreboot.org/c/coreboot/+/41215/5/src/mainboard/google/voltee... File src/mainboard/google/volteer/fw_config.c:
https://review.coreboot.org/c/coreboot/+/41215/5/src/mainboard/google/voltee... PS5, Line 2: /* This file is part of the coreboot project. */
please remove
Done
https://review.coreboot.org/c/coreboot/+/41215/5/src/mainboard/google/voltee... PS5, Line 4: #include <bootstate.h> : #include <commonlib/helpers.h> : #include <console/console.h> : #include <ec/google/chromeec/ec.h> : #include <fw_config.h> : #include <stdint.h>
please include only what you use
Done
https://review.coreboot.org/c/coreboot/+/41215/5/src/mainboard/google/voltee... PS5, Line 10: #include <soc/gpio.h>
Please include <gpio.h>, which should indirectly include the SoC-specific <soc/gpio.h>. […]
Done
Duncan Laurie has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41215 )
Change subject: mb/google/volteer: Add firmware configuration table ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/c/coreboot/+/41215/4/src/mainboard/google/voltee... File src/mainboard/google/volteer/fw_config.c:
https://review.coreboot.org/c/coreboot/+/41215/4/src/mainboard/google/voltee... PS4, Line 66: if (fw_config_probe_one(FW_CONFIG(AUDIO, NONE))){
space required before the open brace '{'
Done
Duncan Laurie has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41215 )
Change subject: mb/google/volteer: Add firmware configuration table ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/c/coreboot/+/41215/3/src/mainboard/google/voltee... File src/mainboard/google/volteer/fw_config.c:
https://review.coreboot.org/c/coreboot/+/41215/3/src/mainboard/google/voltee... PS3, Line 90: volteer_fw_config
Maybe similar to the gpio_configure_pads_with_override ? Provide a base configuration and then the v […]
Ack
Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/41215
to look at the new patch set (#6).
Change subject: mb/google/volteer: Add firmware configuration table ......................................................................
mb/google/volteer: Add firmware configuration table
Add the current firmware configuration table for the volteer mainboard and define some actions based on probe results for audio:
- When I2S options are selected disable the SoundWire GPIOs. - When SoundWire is enabled disable the I2S GPIOs. - When no audio is enabled disable all the GPIOs.
BUG=b:147462631 TEST=Test that GPIOs are configured as expected based on the current value of the fw_config field in cbi.
Change-Id: I179f8b6436be83a2b37911777764bd26a0d404b7 Signed-off-by: Duncan Laurie dlaurie@google.com --- M src/mainboard/google/volteer/Kconfig M src/mainboard/google/volteer/Makefile.inc A src/mainboard/google/volteer/fw_config.c M src/mainboard/google/volteer/variants/baseboard/devicetree.cb 4 files changed, 109 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/41215/6
Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/41215
to look at the new patch set (#9).
Change subject: mb/google/volteer: Add firmware configuration table ......................................................................
mb/google/volteer: Add firmware configuration table
Add the current firmware configuration table for the volteer mainboard and define some actions based on probe results for audio:
- When I2S options are selected disable the SoundWire GPIOs. - When SoundWire is enabled disable the I2S GPIOs. - When no audio is enabled disable all the GPIOs.
BUG=b:147462631 TEST=Test that GPIOs are configured as expected based on the current value of the fw_config field in cbi.
Change-Id: I179f8b6436be83a2b37911777764bd26a0d404b7 Signed-off-by: Duncan Laurie dlaurie@google.com --- M src/mainboard/google/volteer/Kconfig M src/mainboard/google/volteer/Makefile.inc A src/mainboard/google/volteer/fw_config.c M src/mainboard/google/volteer/variants/baseboard/devicetree.cb 4 files changed, 108 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/41215/9
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41215 )
Change subject: mb/google/volteer: Add firmware configuration table ......................................................................
Patch Set 18: Code-Review+2
(2 comments)
https://review.coreboot.org/c/coreboot/+/41215/18/src/mainboard/google/volte... File src/mainboard/google/volteer/fw_config.c:
https://review.coreboot.org/c/coreboot/+/41215/18/src/mainboard/google/volte... PS18, Line 60: fw_config_handle This is okay for now, but this breaks our override gpio mechanism. I think we need to extend the gpio override function to accept an array of override tables to apply the required overrides. We don't need to solve it in this CL. I can push some patches for the API since it might be required for some other changes for the variants as well.
https://review.coreboot.org/c/coreboot/+/41215/18/src/mainboard/google/volte... File src/mainboard/google/volteer/variants/baseboard/devicetree.cb:
https://review.coreboot.org/c/coreboot/+/41215/18/src/mainboard/google/volte... PS18, Line 1: fw_config I really like the way this is being implemented. It feels very easy to use and extend :).
Duncan Laurie has submitted this change. ( https://review.coreboot.org/c/coreboot/+/41215 )
Change subject: mb/google/volteer: Add firmware configuration table ......................................................................
mb/google/volteer: Add firmware configuration table
Add the current firmware configuration table for the volteer mainboard and define some actions based on probe results for audio:
- When I2S options are selected disable the SoundWire GPIOs. - When SoundWire is enabled disable the I2S GPIOs. - When no audio is enabled disable all the GPIOs.
BUG=b:147462631 TEST=Test that GPIOs are configured as expected based on the current value of the fw_config field in cbi.
Change-Id: I179f8b6436be83a2b37911777764bd26a0d404b7 Signed-off-by: Duncan Laurie dlaurie@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/41215 Reviewed-by: Furquan Shaikh furquan@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/google/volteer/Kconfig M src/mainboard/google/volteer/Makefile.inc A src/mainboard/google/volteer/fw_config.c M src/mainboard/google/volteer/variants/baseboard/devicetree.cb 4 files changed, 108 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved
diff --git a/src/mainboard/google/volteer/Kconfig b/src/mainboard/google/volteer/Kconfig index 7b9963a..76acb9a 100644 --- a/src/mainboard/google/volteer/Kconfig +++ b/src/mainboard/google/volteer/Kconfig @@ -15,6 +15,8 @@ select EC_GOOGLE_CHROMEEC_BOARDID select EC_GOOGLE_CHROMEEC_SKUID select EC_GOOGLE_CHROMEEC_LPC + select FW_CONFIG + select FW_CONFIG_SOURCE_CHROMEEC_CBI select HAVE_ACPI_RESUME select HAVE_ACPI_TABLES select INTEL_LPSS_UART_FOR_CONSOLE diff --git a/src/mainboard/google/volteer/Makefile.inc b/src/mainboard/google/volteer/Makefile.inc index c7e1dae..f66c520 100644 --- a/src/mainboard/google/volteer/Makefile.inc +++ b/src/mainboard/google/volteer/Makefile.inc @@ -8,6 +8,7 @@
ramstage-$(CONFIG_CHROMEOS) += chromeos.c ramstage-y += ec.c +ramstage-$(CONFIG_FW_CONFIG) += fw_config.c ramstage-y += mainboard.c
smm-y += smihandler.c diff --git a/src/mainboard/google/volteer/fw_config.c b/src/mainboard/google/volteer/fw_config.c new file mode 100644 index 0000000..61e20f4 --- /dev/null +++ b/src/mainboard/google/volteer/fw_config.c @@ -0,0 +1,82 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <bootstate.h> +#include <console/console.h> +#include <fw_config.h> +#include <gpio.h> + +static const struct pad_config dmic_enable_pads[] = { + PAD_CFG_NF(GPP_S4, NONE, DEEP, NF2), /* DMIC_CLK1 */ + PAD_CFG_NF(GPP_S5, NONE, DEEP, NF2), /* DMIC_DATA1 */ + PAD_CFG_NF(GPP_S6, NONE, DEEP, NF2), /* DMIC_CLK0 */ + PAD_CFG_NF(GPP_S7, NONE, DEEP, NF2), /* DMIC_DATA0 */ +}; + +static const struct pad_config dmic_disable_pads[] = { + PAD_NC(GPP_S4, NONE), + PAD_NC(GPP_S5, NONE), + PAD_NC(GPP_S6, NONE), + PAD_NC(GPP_S7, NONE), +}; + +static const struct pad_config sndw_enable_pads[] = { + PAD_CFG_NF(GPP_S0, NONE, DEEP, NF1), /* SNDW0_CLK */ + PAD_CFG_NF(GPP_S1, NONE, DEEP, NF1), /* SNDW0_DATA */ + PAD_CFG_NF(GPP_S2, NONE, DEEP, NF1), /* SNDW1_CLK */ + PAD_CFG_NF(GPP_S3, NONE, DEEP, NF1), /* SNDW1_DATA */ +}; + +static const struct pad_config sndw_disable_pads[] = { + PAD_NC(GPP_S0, NONE), + PAD_NC(GPP_S1, NONE), + PAD_NC(GPP_S2, NONE), + PAD_NC(GPP_S3, NONE), +}; + +static const struct pad_config i2s_enable_pads[] = { + PAD_CFG_NF(GPP_A23, NONE, DEEP, NF1), /* I2S1_SCLK */ + PAD_CFG_NF(GPP_D19, NONE, DEEP, NF1), /* I2S_MCLK1 */ + PAD_CFG_NF(GPP_R0, NONE, DEEP, NF2), /* I2S0_SCLK */ + PAD_CFG_NF(GPP_R1, NONE, DEEP, NF2), /* I2S0_SFRM */ + PAD_CFG_NF(GPP_R2, DN_20K, DEEP, NF2), /* I2S0_TXD */ + PAD_CFG_NF(GPP_R3, NONE, DEEP, NF2), /* I2S0_RXD */ + PAD_CFG_NF(GPP_R5, NONE, DEEP, NF2), /* I2S1_RXD */ + PAD_CFG_NF(GPP_R6, NONE, DEEP, NF2), /* I2S1_TXD */ + PAD_CFG_NF(GPP_R7, NONE, DEEP, NF2), /* I2S1_SFRM */ +}; + +static const struct pad_config i2s_disable_pads[] = { + PAD_NC(GPP_A23, NONE), + PAD_NC(GPP_D19, NONE), + PAD_NC(GPP_R0, NONE), + PAD_NC(GPP_R1, NONE), + PAD_NC(GPP_R2, DN_20K), + PAD_NC(GPP_R3, NONE), + PAD_NC(GPP_R5, NONE), + PAD_NC(GPP_R6, NONE), + PAD_NC(GPP_R7, NONE), +}; + +static void fw_config_handle(void *unused) +{ + if (fw_config_probe(FW_CONFIG(AUDIO, NONE))) { + printk(BIOS_INFO, "Configure GPIOs for no audio.\n"); + gpio_configure_pads(i2s_disable_pads, ARRAY_SIZE(i2s_disable_pads)); + gpio_configure_pads(dmic_disable_pads, ARRAY_SIZE(dmic_disable_pads)); + gpio_configure_pads(sndw_disable_pads, ARRAY_SIZE(sndw_disable_pads)); + } + if (fw_config_probe(FW_CONFIG(AUDIO, MAX98373_ALC5682_SNDW))) { + printk(BIOS_INFO, "Configure GPIOs for SoundWire audio.\n"); + gpio_configure_pads(sndw_enable_pads, ARRAY_SIZE(sndw_enable_pads)); + gpio_configure_pads(dmic_enable_pads, ARRAY_SIZE(dmic_enable_pads)); + gpio_configure_pads(i2s_disable_pads, ARRAY_SIZE(i2s_disable_pads)); + } + if (fw_config_probe(FW_CONFIG(AUDIO, MAX98357_ALC5682I_I2S)) || + fw_config_probe(FW_CONFIG(AUDIO, MAX98373_ALC5682I_I2S))) { + printk(BIOS_INFO, "Configure GPIOs for I2S audio.\n"); + gpio_configure_pads(i2s_enable_pads, ARRAY_SIZE(i2s_enable_pads)); + gpio_configure_pads(dmic_enable_pads, ARRAY_SIZE(dmic_enable_pads)); + gpio_configure_pads(sndw_disable_pads, ARRAY_SIZE(sndw_disable_pads)); + } +} +BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL); diff --git a/src/mainboard/google/volteer/variants/baseboard/devicetree.cb b/src/mainboard/google/volteer/variants/baseboard/devicetree.cb index 23e2f75..a55ef7d 100644 --- a/src/mainboard/google/volteer/variants/baseboard/devicetree.cb +++ b/src/mainboard/google/volteer/variants/baseboard/devicetree.cb @@ -1,3 +1,26 @@ +fw_config + field USB_DB 0 3 + option NONE 0 + option USB4 1 + option USB3 2 + end + field THERMAL 4 7 end + field AUDIO 8 10 + option NONE 0 + option MAX98357_ALC5682I_I2S 1 + option MAX98373_ALC5682I_I2S 2 + option MAX98373_ALC5682_SNDW 3 + end + field TABLETMODE 11 + option DISABLED 0 + option ENABLED 1 + end + field LTE_DB 12 + option ABSENT 0 + option PRESENT 1 + end +end + chip soc/intel/tigerlake
device cpu_cluster 0 on
9elements QA has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41215 )
Change subject: mb/google/volteer: Add firmware configuration table ......................................................................
Patch Set 22:
Automatic boot test returned (PASS/FAIL/TOTAL): 4/0/4 Emulation targets: "QEMU x86 q35/ich9" using payload TianoCore : SUCCESS : https://lava.9esec.io/r/4693 "QEMU x86 q35/ich9" using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/4692 "QEMU x86 i440fx/piix4" using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/4691 "QEMU AArch64" using payload LinuxBoot_u-root_kexec : SUCCESS : https://lava.9esec.io/r/4690
Please note: This test is under development and might not be accurate at all!