summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2017-03-02 10:13:51 -0800
committerDuncan Laurie <dlaurie@chromium.org>2017-03-15 18:32:27 +0100
commit4a75a66d67ee465749eafe8a5128e0c54675c708 (patch)
tree6bb60c75c091fe16b49fe3efc3d6c43a0acaac4a
parent7273e183992793f5ec3f255ddec77219c991d32a (diff)
downloadcoreboot-4a75a66d67ee465749eafe8a5128e0c54675c708.tar.xz
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@chromium.org> Reviewed-on: https://review.coreboot.org/18816 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Furquan Shaikh <furquan@google.com>
-rw-r--r--src/soc/intel/skylake/Kconfig6
-rw-r--r--src/soc/intel/skylake/include/soc/nhlt.h5
-rw-r--r--src/soc/intel/skylake/nhlt/Makefile.inc6
-rw-r--r--src/soc/intel/skylake/nhlt/rt5514.c62
4 files changed, 79 insertions, 0 deletions
diff --git a/src/soc/intel/skylake/Kconfig b/src/soc/intel/skylake/Kconfig
index c1b585f613..a56d0444de 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 39930036e6..d3e4568d29 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 b5b77eb834..39031a591d 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 0000000000..9c48c7ba37
--- /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;
+ }
+}