aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMac Chiang <mac.chiang@intel.com>2022-01-26 03:34:49 -0500
committerFelix Held <felix-coreboot@felixheld.de>2022-02-10 12:50:00 +0000
commitfd07fa20da14370846c41a3bada5dcc8eb9459f1 (patch)
tree7cd5853a68097a52efcc30c503f9bd3d96fd346a
parent1f6b7a273bd7bddb32d8a0e56ab5225110269b20 (diff)
mb/google/brya/variants/brask: Enable Bluetooth offload support
Add fw_config NAU88L25B_I2S field, I2S2 configuration and enabling CnviBtAudioOffload UPD bit. BUG=none TEST=temerge-brask coreboot Signed-off-by: Mac Chiang <mac.chiang@intel.com> Change-Id: Id5da8c5c471be176bc0fe1eda4da7faf8ed2e8d2 Reviewed-on: https://review.coreboot.org/c/coreboot/+/61404 Reviewed-by: Zhuohao Lee <zhuohao@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/mainboard/google/brya/variants/brask/Makefile.inc3
-rw-r--r--src/mainboard/google/brya/variants/brask/fw_config.c44
-rw-r--r--src/mainboard/google/brya/variants/brask/overridetree.cb7
-rw-r--r--src/mainboard/google/brya/variants/brask/variant.c10
4 files changed, 64 insertions, 0 deletions
diff --git a/src/mainboard/google/brya/variants/brask/Makefile.inc b/src/mainboard/google/brya/variants/brask/Makefile.inc
index bc39984d6c..c15531e21d 100644
--- a/src/mainboard/google/brya/variants/brask/Makefile.inc
+++ b/src/mainboard/google/brya/variants/brask/Makefile.inc
@@ -5,3 +5,6 @@ romstage-y += gpio.c
ramstage-y += gpio.c
ramstage-y += ramstage.c
+
+ramstage-$(CONFIG_FW_CONFIG) += fw_config.c
+ramstage-$(CONFIG_FW_CONFIG) += variant.c
diff --git a/src/mainboard/google/brya/variants/brask/fw_config.c b/src/mainboard/google/brya/variants/brask/fw_config.c
new file mode 100644
index 0000000000..5302923cd2
--- /dev/null
+++ b/src/mainboard/google/brya/variants/brask/fw_config.c
@@ -0,0 +1,44 @@
+/* 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 bt_i2s_enable_pads[] = {
+ PAD_CFG_NF(GPP_VGPIO_30, NONE, DEEP, NF3), /* BT_I2S_BCLK */
+ PAD_CFG_NF(GPP_VGPIO_31, NONE, DEEP, NF3), /* BT_I2S_SYNC */
+ PAD_CFG_NF(GPP_VGPIO_32, NONE, DEEP, NF3), /* BT_I2S_SDO */
+ PAD_CFG_NF(GPP_VGPIO_33, NONE, DEEP, NF3), /* BT_I2S_SDI */
+ PAD_CFG_NF(GPP_VGPIO_34, NONE, DEEP, NF1), /* SSP2_SCLK */
+ PAD_CFG_NF(GPP_VGPIO_35, NONE, DEEP, NF1), /* SSP2_SFRM */
+ PAD_CFG_NF(GPP_VGPIO_36, NONE, DEEP, NF1), /* SSP_TXD */
+ PAD_CFG_NF(GPP_VGPIO_37, NONE, DEEP, NF1), /* SSP_RXD */
+};
+
+static const struct pad_config bt_i2s_disable_pads[] = {
+ PAD_NC(GPP_VGPIO_30, NONE),
+ PAD_NC(GPP_VGPIO_31, NONE),
+ PAD_NC(GPP_VGPIO_32, NONE),
+ PAD_NC(GPP_VGPIO_33, NONE),
+ PAD_NC(GPP_VGPIO_34, NONE),
+ PAD_NC(GPP_VGPIO_35, NONE),
+ PAD_NC(GPP_VGPIO_36, NONE),
+ PAD_NC(GPP_VGPIO_37, NONE),
+};
+
+static void fw_config_handle(void *unused)
+{
+ if (!fw_config_is_provisioned() || fw_config_probe(FW_CONFIG(AUDIO, AUDIO_UNKNOWN))) {
+ printk(BIOS_INFO, "Disable BT offload audio related GPIO pins.\n");
+ gpio_configure_pads(bt_i2s_disable_pads, ARRAY_SIZE(bt_i2s_disable_pads));
+ return;
+ }
+
+ if (fw_config_probe(FW_CONFIG(AUDIO, NAU88L25B_I2S))) {
+ printk(BIOS_INFO, "BT offload enabled over I2S with NAU88L25B\n");
+ gpio_configure_pads(bt_i2s_enable_pads, ARRAY_SIZE(bt_i2s_enable_pads));
+ }
+
+}
+BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL);
diff --git a/src/mainboard/google/brya/variants/brask/overridetree.cb b/src/mainboard/google/brya/variants/brask/overridetree.cb
index 3aeca90d7f..66d450d3af 100644
--- a/src/mainboard/google/brya/variants/brask/overridetree.cb
+++ b/src/mainboard/google/brya/variants/brask/overridetree.cb
@@ -1,3 +1,10 @@
+fw_config
+ field AUDIO 0 2
+ option AUDIO_UNKNOWN 0
+ option NAU88L25B_I2S 1
+ end
+end
+
chip soc/intel/alderlake
device domain 0 on
device ref dtt on
diff --git a/src/mainboard/google/brya/variants/brask/variant.c b/src/mainboard/google/brya/variants/brask/variant.c
new file mode 100644
index 0000000000..8e3578c84b
--- /dev/null
+++ b/src/mainboard/google/brya/variants/brask/variant.c
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <chip.h>
+#include <fw_config.h>
+#include <baseboard/variants.h>
+
+void variant_update_soc_chip_config(struct soc_intel_alderlake_config *config)
+{
+ config->CnviBtAudioOffload = fw_config_probe(FW_CONFIG(AUDIO, NAU88L25B_I2S));
+}