clear-pkgs-linux-iot-lts2018/0243-ASoC-Intel-CNL-Initial...

72 lines
2.3 KiB
Diff

From 100195cb064a05934c2e87af4d9b56d952f34c39 Mon Sep 17 00:00:00 2001
From: "Panwar, Ashish" <ashish.panwar@intel.com>
Date: Fri, 18 Mar 2016 16:01:07 +0530
Subject: [PATCH 243/743] ASoC: Intel: CNL: Initialize trace buffer window for
CNL
Initialize address, size of tracing window and write pointers
of each core for CNL platform.
Change-Id: I9febfe5bd1eef76f50f5de170c6c99fc98cdc6d9
Signed-off-by: Panwar, Ashish <ashish.panwar@intel.com>
Reviewed-on:
Reviewed-by: Shah, Hardik T <hardik.t.shah@intel.com>
Tested-by: Shah, Hardik T <hardik.t.shah@intel.com>
---
sound/soc/intel/skylake/cnl-sst.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c
index f70d70d0822a..b82de714c916 100644
--- a/sound/soc/intel/skylake/cnl-sst.c
+++ b/sound/soc/intel/skylake/cnl-sst.c
@@ -37,6 +37,7 @@
#include "cnl-sst-dsp.h"
#include "skl-sst-dsp.h"
#include "skl-sst-ipc.h"
+#include "skl-fwlog.h"
#define CNL_FW_ROM_INIT 0x1
#define CNL_FW_INIT 0x5
@@ -46,6 +47,14 @@
#define CNL_ADSP_SRAM0_BASE 0x80000
+/* Trace Buffer Window */
+#define CNL_ADSP_SRAM2_BASE 0x0C0000
+#define CNL_ADSP_W2_SIZE 0x2000
+#define CNL_ADSP_WP_DSP0 (CNL_ADSP_SRAM0_BASE+0x30)
+#define CNL_ADSP_WP_DSP1 (CNL_ADSP_SRAM0_BASE+0x34)
+#define CNL_ADSP_WP_DSP2 (CNL_ADSP_SRAM0_BASE+0x38)
+#define CNL_ADSP_WP_DSP3 (CNL_ADSP_SRAM0_BASE+0x3C)
+
/* Firmware status window */
#define CNL_ADSP_FW_STATUS CNL_ADSP_SRAM0_BASE
#define CNL_ADSP_ERROR_CODE (CNL_ADSP_FW_STATUS + 0x4)
@@ -629,6 +638,8 @@ int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
{
struct skl_sst *cnl;
struct sst_dsp *sst;
+ u32 dsp_wp[] = {CNL_ADSP_WP_DSP0, CNL_ADSP_WP_DSP1, CNL_ADSP_WP_DSP2,
+ CNL_ADSP_WP_DSP3};
int ret;
ret = skl_sst_ctx_init(dev, irq, fw_name, dsp_ops, dsp, &cnl_dev);
@@ -651,6 +662,13 @@ int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
CNL_ADSP_W0_UP_SZ, CNL_ADSP_SRAM1_BASE,
CNL_ADSP_W1_SZ);
+ ret = skl_dsp_init_trace_window(sst, dsp_wp, CNL_ADSP_SRAM2_BASE,
+ CNL_ADSP_W2_SIZE, CNL_DSP_CORES);
+ if (ret) {
+ dev_err(dev, "FW tracing init failed : %x", ret);
+ return ret;
+ }
+
ret = cnl_ipc_init(dev, cnl);
if (ret) {
skl_dsp_free(sst);
--
2.19.2