[Sound-open-firmware] [PATCH 3/3] configure.ac: add CONFIG_HOST_PTABLE flag for platforms which need handle it

Keyon Jie yang.jie at linux.intel.com
Wed Dec 6 14:16:32 CET 2017


We only need handle host page tables on platforms that we
program DMA host buffer(addr/size) inside firmware, for
other platforms, host driver will program these settings
and won't pass in page tables.

So here add frag CONFIG_HOST_PTABLE to configure this for
different platforms, on Baytrail, Cherrytrail, we need
CONFIG_HOST_PTABLE to be selected.

Signed-off-by: Keyon Jie <yang.jie at linux.intel.com>
---
 configure.ac        | 2 ++
 src/ipc/intel-ipc.c | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/configure.ac b/configure.ac
index 6d67220..86d19cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -81,6 +81,7 @@ case "$with_platform" in
 	AC_SUBST(XTENSA_CORE)
 
 	AC_DEFINE([CONFIG_BAYTRAIL], [1], [Configure for Baytrail])
+	AC_DEFINE([CONFIG_HOST_PTABLE], [1], [Configure handling host page table])
     ;;
     cherrytrail*)
 
@@ -97,6 +98,7 @@ case "$with_platform" in
 	AC_SUBST(XTENSA_CORE)
 
 	AC_DEFINE([CONFIG_CHERRYTRAIL], [1], [Configure for Cherrytrail])
+	AC_DEFINE([CONFIG_HOST_PTABLE], [1], [Configure handling host page table])
     ;;
     *)
         AC_MSG_ERROR([Host platform not specified])
diff --git a/src/ipc/intel-ipc.c b/src/ipc/intel-ipc.c
index 4c310b6..e39951a 100644
--- a/src/ipc/intel-ipc.c
+++ b/src/ipc/intel-ipc.c
@@ -82,6 +82,7 @@ static inline struct sof_ipc_hdr *mailbox_validate(void)
 	return hdr;
 }
 
+#ifdef CONFIG_HOST_PTABLE
 static void dma_complete(void *data, uint32_t type, struct dma_sg_elem *next)
 {
 	struct intel_ipc_data *iipc = (struct intel_ipc_data *)data;
@@ -219,6 +220,7 @@ static int parse_page_descriptors(struct intel_ipc_data *iipc,
 
 	return 0;
 }
+#endif
 
 /*
  * Stream IPC Operations.
@@ -227,7 +229,9 @@ static int parse_page_descriptors(struct intel_ipc_data *iipc,
 /* allocate a new stream */
 static int ipc_stream_pcm_params(uint32_t stream)
 {
+#ifdef CONFIG_HOST_PTABLE
 	struct intel_ipc_data *iipc = ipc_get_drvdata(_ipc);
+#endif
 	struct sof_ipc_pcm_params *pcm_params = _ipc->comp_data;
 	struct sof_ipc_pcm_params_reply reply;
 	struct ipc_comp_dev *pcm_dev;
@@ -255,6 +259,7 @@ static int ipc_stream_pcm_params(uint32_t stream)
 	cd = pcm_dev->cd;
 	cd->params = pcm_params->params;
 
+#ifdef CONFIG_HOST_PTABLE
 	/* use DMA to read in compressed page table ringbuffer from host */
 	err = get_page_descriptors(iipc, &pcm_params->params.buffer);
 	if (err < 0) {
@@ -269,6 +274,7 @@ static int ipc_stream_pcm_params(uint32_t stream)
 		trace_ipc_error("eAP");
 		goto error;
 	}
+#endif
 
 	/* configure pipeline audio params */
 	err = pipeline_params(pcm_dev->cd->pipeline, pcm_dev->cd, pcm_params);
-- 
2.11.0



More information about the Sound-open-firmware mailing list