<p>Naveen Manohar would like Rizwan Qureshi to <strong>review</strong> this change.</p><p><a href="https://review.coreboot.org/22265">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">mb/google/poppy/variants/nautilus: add nhlt support<br><br>The use of a NHLT table is required to make audio work<br>on the kabylake SoCs employing the internal DSP. The table<br>describes the audo endpoints (render vs capture) along with<br>their supported formats.<br><br>Nautilus board uses Dialog da7219 headset codec,<br>Select the appropriate NHLT blob to be packaged in CBFS.<br>Also generate the required ACPI NHLT table for codec<br>and the supported topology in nautilus.<br><br>BUG=b:68686020<br>TEST=With the required driver support in kernel verify that<br>the Audio plays on headset and recording on headset mic.<br><br>Change-Id: I27356a0f1d27cb2190f1ebd141720f3adca4c602<br>Signed-off-by: Naveen Manohar <naveen.m@intel.com><br>Signed-off-by: Rizwan Qureshi <rizwan.qureshi@intel.com><br>Signed-off-by: Shruthi Sudhakar <shruthi.sudhakar@intel.com><br>---<br>M src/mainboard/google/poppy/Kconfig<br>M src/mainboard/google/poppy/variants/baseboard/nhlt.c<br>M src/soc/intel/skylake/Kconfig<br>M src/soc/intel/skylake/include/soc/nhlt.h<br>M src/soc/intel/skylake/nhlt/Makefile.inc<br>A src/soc/intel/skylake/nhlt/da7219.c<br>6 files changed, 93 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/65/22265/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/mainboard/google/poppy/Kconfig b/src/mainboard/google/poppy/Kconfig<br>index ceaf7eb..96fe2ed 100644<br>--- a/src/mainboard/google/poppy/Kconfig<br>+++ b/src/mainboard/google/poppy/Kconfig<br>@@ -56,8 +56,10 @@<br> <br> config INCLUDE_NHLT_BLOBS_NAUTILUS<br>        bool "Include blobs for nautilus audio."<br>+   default y if BOARD_GOOGLE_NAUTILUS<br>    select NHLT_DMIC_2CH<br>  select NHLT_DMIC_4CH<br>+ select NHLT_DA7219<br> <br> config MAINBOARD_DIR<br>  string<br>diff --git a/src/mainboard/google/poppy/variants/baseboard/nhlt.c b/src/mainboard/google/poppy/variants/baseboard/nhlt.c<br>index 81557e4..9fb6ad9 100644<br>--- a/src/mainboard/google/poppy/variants/baseboard/nhlt.c<br>+++ b/src/mainboard/google/poppy/variants/baseboard/nhlt.c<br>@@ -28,6 +28,10 @@<br>   if (nhlt_soc_add_dmic_array(nhlt, 4))<br>                 printk(BIOS_ERR, "Couldn't add 4CH DMIC arrays.\n");<br> <br>+        /* Dialog DA7219 Headset codec. */<br>+   if (nhlt_soc_add_da7219(nhlt, AUDIO_LINK_SSP1))<br>+              printk(BIOS_ERR, "Couldn't add Dialog DA7219.\n");<br>+<br>   /* Maxim MAX98927 Smart Amps for left and right channel */<br>    if (nhlt_soc_add_max98927(nhlt, AUDIO_LINK_SSP0))<br>             printk(BIOS_ERR, "Couldn't add Maxim MAX98927\n");<br>diff --git a/src/soc/intel/skylake/Kconfig b/src/soc/intel/skylake/Kconfig<br>index f830f54..f943170 100644<br>--- a/src/soc/intel/skylake/Kconfig<br>+++ b/src/soc/intel/skylake/Kconfig<br>@@ -272,6 +272,12 @@<br>   help<br>    Include DSP firmware settings for max98927 amplifier.<br> <br>+config NHLT_DA7219<br>+      bool<br>+ default n<br>+    help<br>+   Include DSP firmware settings for DA7219 headset codec.<br>+<br> choice<br>         prompt "Cache-as-ram implementation"<br>        default CAR_NEM_ENHANCED<br>diff --git a/src/soc/intel/skylake/include/soc/nhlt.h b/src/soc/intel/skylake/include/soc/nhlt.h<br>index d3e4568..1af27e8 100644<br>--- a/src/soc/intel/skylake/include/soc/nhlt.h<br>+++ b/src/soc/intel/skylake/include/soc/nhlt.h<br>@@ -77,4 +77,10 @@<br>  */<br> int nhlt_soc_add_max98927(struct nhlt *nhlt, int hwlink);<br> <br>+/*<br>+ * Add da7219 headset codec on provided SSP link. Return 0 on success, < 0<br>+ * on error.<br>+ */<br>+int nhlt_soc_add_da7219(struct nhlt *nhlt, int hwlink);<br>+<br> #endif<br>diff --git a/src/soc/intel/skylake/nhlt/Makefile.inc b/src/soc/intel/skylake/nhlt/Makefile.inc<br>index 35b2829..9c9b4c8 100644<br>--- a/src/soc/intel/skylake/nhlt/Makefile.inc<br>+++ b/src/soc/intel/skylake/nhlt/Makefile.inc<br>@@ -5,6 +5,7 @@<br> ramstage-y += rt5514.c<br> ramstage-y += rt5663.c<br> ramstage-y += max98927.c<br>+ramstage-y += da7219.c<br> <br> # DSP firmware settings files.<br> ifeq ($(CONFIG_SOC_INTEL_KABYLAKE),y)<br>@@ -25,6 +26,7 @@<br> RT5663 = rt5663-2ch-48khz-24b.bin<br> SSM4567_RENDER = ssm4567-render-2ch-48khz-24b.bin<br> SSM4567_CAPTURE = ssm4567-capture-4ch-48khz-32b.bin<br>+DA7219_RENDER_CAPTURE = dialog-2ch-48khz-24b.bin<br> <br> cbfs-files-$(CONFIG_NHLT_DMIC_2CH) += $(DMIC_2CH_48KHZ_16B)<br> $(DMIC_2CH_48KHZ_16B)-file := $(NHLT_BLOB_PATH)/$(DMIC_2CH_48KHZ_16B)<br>@@ -73,3 +75,7 @@<br> cbfs-files-$(CONFIG_NHLT_MAX98927) += $(MAX98927_RENDER_24B)<br> $(MAX98927_RENDER_24B)-file := $(NHLT_BLOB_PATH)/$(MAX98927_RENDER_24B)<br> $(MAX98927_RENDER_24B)-type := raw<br>+<br>+cbfs-files-$(CONFIG_NHLT_DA7219) += $(DA7219_RENDER_CAPTURE)<br>+$(DA7219_RENDER_CAPTURE)-file := $(NHLT_BLOB_PATH)/$(DA7219_RENDER_CAPTURE)<br>+$(DA7219_RENDER_CAPTURE)-type := raw<br>diff --git a/src/soc/intel/skylake/nhlt/da7219.c b/src/soc/intel/skylake/nhlt/da7219.c<br>new file mode 100644<br>index 0000000..6aa66c7<br>--- /dev/null<br>+++ b/src/soc/intel/skylake/nhlt/da7219.c<br>@@ -0,0 +1,69 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2017 Intel Corp.<br>+ *<br>+ * This program is free software; you can redistribute it and/or modify<br>+ * it under the terms of the GNU General Public License as published by<br>+ * the Free Software Foundation; either version 2 of the License, or<br>+ * (at your option) any later version.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+#include <console/console.h><br>+#include <nhlt.h><br>+#include <soc/nhlt.h><br>+<br>+static const struct nhlt_tdm_config tdm_config = {<br>+    .virtual_slot = 0,<br>+   .config_type = NHLT_TDM_BASIC,<br>+};<br>+<br>+static const struct nhlt_format_config da7219_formats[] = {<br>+ /* 48 KHz 24-bits per sample. */<br>+     {<br>+            .num_channels = 2,<br>+           .sample_freq_khz = 48,<br>+               .container_bits_per_sample = 32,<br>+             .valid_bits_per_sample = 24,<br>+         .settings_file = "dialog-2ch-48khz-24b.bin",<br>+       },<br>+};<br>+<br>+static const struct nhlt_endp_descriptor da7219_descriptors[] = {<br>+       /* Render Endpoint */<br>+        {<br>+            .link = NHLT_LINK_SSP,<br>+               .device = NHLT_SSP_DEV_I2S,<br>+          .direction = NHLT_DIR_RENDER,<br>+                .vid = NHLT_VID,<br>+             .did = NHLT_DID_SSP,<br>+         .cfg = &tdm_config,<br>+              .cfg_size = sizeof(tdm_config),<br>+              .formats = da7219_formats,<br>+           .num_formats = ARRAY_SIZE(da7219_formats),<br>+   },<br>+   /* Capture Endpoint */<br>+       {<br>+            .link = NHLT_LINK_SSP,<br>+               .device = NHLT_SSP_DEV_I2S,<br>+          .direction = NHLT_DIR_CAPTURE,<br>+               .vid = NHLT_VID,<br>+             .did = NHLT_DID_SSP,<br>+         .cfg = &tdm_config,<br>+              .cfg_size = sizeof(tdm_config),<br>+              .formats = da7219_formats,<br>+           .num_formats = ARRAY_SIZE(da7219_formats),<br>+   },<br>+};<br>+<br>+int nhlt_soc_add_da7219(struct nhlt *nhlt, int hwlink)<br>+{<br>+      /* Virtual bus id of SSP links are the hardware port ids proper. */<br>+  return nhlt_add_ssp_endpoints(nhlt, hwlink, da7219_descriptors,<br>+                                      ARRAY_SIZE(da7219_descriptors));<br>+}<br></pre><p>To view, visit <a href="https://review.coreboot.org/22265">change 22265</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/22265"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I27356a0f1d27cb2190f1ebd141720f3adca4c602 </div>
<div style="display:none"> Gerrit-Change-Number: 22265 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Naveen Manohar <naveen.m@intel.com> </div>
<div style="display:none"> Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi@intel.com> </div>