[coreboot-gerrit] Patch set updated for coreboot: intel/skylake: nhlt: Add support for rt5514 NHLT blob

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Wed Mar 15 01:32:52 CET 2017


Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18816

-gerrit

commit 304e68c8eeba454d61679f192d2f8ead622acf62
Author: Duncan Laurie <dlaurie at chromium.org>
Date:   Thu Mar 2 10:13:51 2017 -0800

    intel/skylake: nhlt: Add support for rt5514 NHLT blob
    
    Add support for describing the NHLT blob for the rt5514 DSP.
    Currently this only supports 4 channel capture.
    
    BUG=b:35585307
    BRANCH=none
    TEST=build and boot on Eve P1
    
    Change-Id: Ib59b56222f9aa65370fdcf9ddf25145c571b1b2e
    Signed-off-by: Duncan Laurie <dlaurie at chromium.org>
---
 src/soc/intel/skylake/Kconfig            |  6 ++++
 src/soc/intel/skylake/include/soc/nhlt.h |  5 +++
 src/soc/intel/skylake/nhlt/Makefile.inc  |  6 ++++
 src/soc/intel/skylake/nhlt/rt5514.c      | 62 ++++++++++++++++++++++++++++++++
 4 files changed, 79 insertions(+)

diff --git a/src/soc/intel/skylake/Kconfig b/src/soc/intel/skylake/Kconfig
index c1b585f..a56d044 100644
--- a/src/soc/intel/skylake/Kconfig
+++ b/src/soc/intel/skylake/Kconfig
@@ -237,6 +237,12 @@ config NHLT_SSM4567
 	help
 	  Include DSP firmware settings for ssm4567 smart amplifier.
 
+config NHLT_RT5514
+	bool
+	default n
+	help
+	  Include DSP firmware settings for rt5514 DSP.
+
 config NHLT_RT5663
 	bool
 	default n
diff --git a/src/soc/intel/skylake/include/soc/nhlt.h b/src/soc/intel/skylake/include/soc/nhlt.h
index 3993003..d3e4568 100644
--- a/src/soc/intel/skylake/include/soc/nhlt.h
+++ b/src/soc/intel/skylake/include/soc/nhlt.h
@@ -61,6 +61,11 @@ int nhlt_soc_add_ssm4567(struct nhlt *nhlt, int hwlink);
 int nhlt_soc_add_max98357(struct nhlt *nhlt, int hwlink);
 
 /*
+ * Add rt5514 DSP on provided SSP link. Return 0 on success, < 0 on error.
+ */
+int nhlt_soc_add_rt5514(struct nhlt *nhlt, int hwlink, int num_channels);
+
+/*
  * Add rt5663 headset codec on provided SSP link. Return 0 on success, < 0
  * on error.
  */
diff --git a/src/soc/intel/skylake/nhlt/Makefile.inc b/src/soc/intel/skylake/nhlt/Makefile.inc
index b5b77eb..39031a5 100644
--- a/src/soc/intel/skylake/nhlt/Makefile.inc
+++ b/src/soc/intel/skylake/nhlt/Makefile.inc
@@ -2,6 +2,7 @@ ramstage-y += dmic.c
 ramstage-y += nau88l25.c
 ramstage-y += max98357.c
 ramstage-y += ssm4567.c
+ramstage-y += rt5514.c
 ramstage-y += rt5663.c
 ramstage-y += max98927.c
 
@@ -19,6 +20,7 @@ DMIC_4CH_48KHZ_32B = dmic-4ch-48khz-32b.bin
 NAU88L25 = nau88l25-2ch-48khz-24b.bin
 MAX98357_RENDER = max98357-render-2ch-48khz-24b.bin
 MAX98927_RENDER = max98927-render-2ch-48khz-24b.bin
+RT5514_CAPTURE = rt5514-capture-4ch-48khz-16b.bin
 RT5663 = rt5663-2ch-48khz-24b.bin
 SSM4567_RENDER = ssm4567-render-2ch-48khz-24b.bin
 SSM4567_CAPTURE = ssm4567-capture-4ch-48khz-32b.bin
@@ -55,6 +57,10 @@ cbfs-files-$(CONFIG_NHLT_SSM4567) += $(SSM4567_CAPTURE)
 $(SSM4567_CAPTURE)-file := $(NHLT_BLOB_PATH)/$(SSM4567_CAPTURE)
 $(SSM4567_CAPTURE)-type := raw
 
+cbfs-files-$(CONFIG_NHLT_RT5514) += $(RT5514_CAPTURE)
+$(RT5514_CAPTURE)-file := $(NHLT_BLOB_PATH)/$(RT5514_CAPTURE)
+$(RT5514_CAPTURE)-type := raw
+
 cbfs-files-$(CONFIG_NHLT_RT5663) += $(RT5663)
 $(RT5663)-file := $(NHLT_BLOB_PATH)/$(RT5663)
 $(RT5663)-type := raw
diff --git a/src/soc/intel/skylake/nhlt/rt5514.c b/src/soc/intel/skylake/nhlt/rt5514.c
new file mode 100644
index 0000000..9c48c7b
--- /dev/null
+++ b/src/soc/intel/skylake/nhlt/rt5514.c
@@ -0,0 +1,62 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2017 Google, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <soc/nhlt.h>
+
+static const struct nhlt_format_config rt5514_4ch_formats[] = {
+	/* 48 KHz 16-bits per sample. */
+	{
+		.num_channels = 4,
+		.sample_freq_khz = 48,
+		.container_bits_per_sample = 16,
+		.valid_bits_per_sample = 16,
+		.speaker_mask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT |
+				SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT,
+		.settings_file = "rt5514-capture-4ch-48khz-16b.bin",
+	},
+};
+
+static const struct nhlt_dmic_array_config rt5514_4ch_mic_config = {
+	.tdm_config = {
+		.config_type = NHLT_TDM_MIC_ARRAY,
+	},
+	.array_type = NHLT_MIC_ARRAY_4CH_L_SHAPED,
+};
+
+static const struct nhlt_endp_descriptor rt5514_4ch_descriptors[] = {
+	{
+		.link = NHLT_LINK_SSP,
+		.device = NHLT_SSP_DEV_I2S,
+		.direction = NHLT_DIR_CAPTURE,
+		.vid = NHLT_VID,
+		.did = NHLT_DID_SSP,
+		.cfg = &rt5514_4ch_mic_config,
+		.cfg_size = sizeof(rt5514_4ch_mic_config),
+		.formats = rt5514_4ch_formats,
+		.num_formats = ARRAY_SIZE(rt5514_4ch_formats),
+	},
+};
+
+int nhlt_soc_add_rt5514(struct nhlt *nhlt, int hwlink, int num_channels)
+{
+	switch (num_channels) {
+	case 4:
+		return nhlt_add_ssp_endpoints(nhlt, hwlink,
+			      rt5514_4ch_descriptors,
+			      ARRAY_SIZE(rt5514_4ch_descriptors));
+	default:
+		return -1;
+	}
+}



More information about the coreboot-gerrit mailing list