alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: alsa-devel@alsa-project.org
Cc: liam.r.girdwood@linux.intel.com, patches.audio@intel.com,
	broonie@kernel.org, Vinod Koul <vinod.koul@intel.com>,
	Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Subject: [PATCH 06/12] ASoC: Intel: Skylake: add additional args to module parsing
Date: Tue, 26 Jul 2016 18:06:44 +0530	[thread overview]
Message-ID: <1469536610-27606-7-git-send-email-vinod.koul@intel.com> (raw)
In-Reply-To: <1469536610-27606-1-git-send-email-vinod.koul@intel.com>

From: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>

For additional library parsing, we need to pass firmware to be
loaded and not use the pointer in context. Also, Library module
IDs are combination of library index and module ID in manifest.

So add the additional arguments of firmware and library offset to
snd_skl_parse_uuids().

Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/skylake/bxt-sst.c       | 2 +-
 sound/soc/intel/skylake/skl-sst-dsp.h   | 3 ++-
 sound/soc/intel/skylake/skl-sst-utils.c | 9 +++++----
 sound/soc/intel/skylake/skl-sst.c       | 2 +-
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c
index eb68258b653d..d6bf32405b3b 100644
--- a/sound/soc/intel/skylake/bxt-sst.c
+++ b/sound/soc/intel/skylake/bxt-sst.c
@@ -175,7 +175,7 @@ static int bxt_load_base_firmware(struct sst_dsp *ctx)
 	if (ctx->fw == NULL)
 		goto sst_load_base_firmware_failed;
 
-	ret = snd_skl_parse_uuids(ctx, BXT_ADSP_FW_BIN_HDR_OFFSET);
+	ret = snd_skl_parse_uuids(ctx, ctx->fw, BXT_ADSP_FW_BIN_HDR_OFFSET, 0);
 	if (ret < 0)
 		goto sst_load_base_firmware_failed;
 
diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h
index 7e994688d8a0..5bc77e1941a5 100644
--- a/sound/soc/intel/skylake/skl-sst-dsp.h
+++ b/sound/soc/intel/skylake/skl-sst-dsp.h
@@ -210,7 +210,8 @@ void bxt_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx);
 
 int snd_skl_get_module_info(struct skl_sst *ctx, u8 *uuid,
 		struct skl_dfw_module *dfw_config);
-int snd_skl_parse_uuids(struct sst_dsp *ctx, unsigned int offset);
+int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw,
+		unsigned int offset, int index);
 void skl_freeup_uuid_list(struct skl_sst *ctx);
 
 int skl_dsp_strip_extended_manifest(struct firmware *fw);
diff --git a/sound/soc/intel/skylake/skl-sst-utils.c b/sound/soc/intel/skylake/skl-sst-utils.c
index ddcb52a51854..fe36e0cf391c 100644
--- a/sound/soc/intel/skylake/skl-sst-utils.c
+++ b/sound/soc/intel/skylake/skl-sst-utils.c
@@ -145,7 +145,8 @@ EXPORT_SYMBOL_GPL(snd_skl_get_module_info);
  * Parse the firmware binary to get the UUID, module id
  * and loadable flags
  */
-int snd_skl_parse_uuids(struct sst_dsp *ctx, unsigned int offset)
+int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw,
+			unsigned int offset, int index)
 {
 	struct adsp_fw_hdr *adsp_hdr;
 	struct adsp_module_entry *mod_entry;
@@ -158,8 +159,8 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, unsigned int offset)
 	unsigned int safe_file;
 
 	/* Get the FW pointer to derive ADSP header */
-	stripped_fw.data = ctx->fw->data;
-	stripped_fw.size = ctx->fw->size;
+	stripped_fw.data = fw->data;
+	stripped_fw.size = fw->size;
 
 	skl_dsp_strip_extended_manifest(&stripped_fw);
 
@@ -210,7 +211,7 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, unsigned int offset)
 		uuid_bin = (uuid_le *)mod_entry->uuid.id;
 		memcpy(&module->uuid, uuid_bin, sizeof(module->uuid));
 
-		module->id = i;
+		module->id = (i | (index << 12));
 		module->is_loadable = mod_entry->type.load_type;
 
 		list_add_tail(&module->list, &skl->uuid_list);
diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c
index 6de4c027a65b..6e9c634cf84f 100644
--- a/sound/soc/intel/skylake/skl-sst.c
+++ b/sound/soc/intel/skylake/skl-sst.c
@@ -88,7 +88,7 @@ static int skl_load_base_firmware(struct sst_dsp *ctx)
 		}
 	}
 
-	ret = snd_skl_parse_uuids(ctx, SKL_ADSP_FW_BIN_HDR_OFFSET);
+	ret = snd_skl_parse_uuids(ctx, ctx->fw, SKL_ADSP_FW_BIN_HDR_OFFSET, 0);
 	if (ret < 0) {
 		dev_err(ctx->dev,
 				"UUID parsing err: %d\n", ret);
-- 
1.9.1

  parent reply	other threads:[~2016-07-26 12:30 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-26 12:36 [PATCH 00/12] ASoC: Intel: Skylake: Add support for library load Vinod Koul
2016-07-26 12:36 ` [PATCH 01/12] ASoC: Intel: Skylake: Check list empty while getting module info Vinod Koul
2016-08-01 17:07   ` Applied "ASoC: Intel: Skylake: Check list empty while getting module info" to the asoc tree Mark Brown
2016-07-26 12:36 ` [PATCH 02/12] ASoC: Intel: Skylake: Move modules query to runtime Vinod Koul
2016-08-01 17:07   ` Applied "ASoC: Intel: Skylake: Move modules query to runtime" to the asoc tree Mark Brown
2016-07-26 12:36 ` [PATCH 03/12] ASoC: Intel: Skylake: modify skl_get_dsp_ops() Vinod Koul
2016-08-01 17:07   ` Applied "ASoC: Intel: Skylake: modify skl_get_dsp_ops()" to the asoc tree Mark Brown
2016-07-26 12:36 ` [PATCH 04/12] ASoC: Intel: Skylake: split fw and dsp initialization Vinod Koul
2016-08-01 17:07   ` Applied "ASoC: Intel: Skylake: split fw and dsp initialization" to the asoc tree Mark Brown
2016-07-26 12:36 ` [PATCH 05/12] ASoC: Intel: Skylake: add support for tplg manifest load Vinod Koul
2016-08-01 17:07   ` Applied "ASoC: Intel: Skylake: add support for tplg manifest load" to the asoc tree Mark Brown
2016-07-26 12:36 ` Vinod Koul [this message]
2016-08-01 17:07   ` Applied "ASoC: Intel: Skylake: add additional args to module parsing" " Mark Brown
2016-07-26 12:36 ` [PATCH 07/12] ASoC: Intel: Skylake: Parse UUIDs once Vinod Koul
2016-08-01 17:07   ` Applied "ASoC: Intel: Skylake: Parse UUIDs once" to the asoc tree Mark Brown
2016-07-26 12:36 ` [PATCH 08/12] ASoC: Intel: Bxt: Parse UUIDs once Vinod Koul
2016-08-01 17:07   ` Applied "ASoC: Intel: Bxt: Parse UUIDs once" to the asoc tree Mark Brown
2016-07-26 12:36 ` [PATCH 09/12] ASoC: Intel: Skylake: Add library loading IPCs Vinod Koul
2016-08-01 17:07   ` Applied "ASoC: Intel: Skylake: Add library loading IPCs" to the asoc tree Mark Brown
2016-07-26 12:36 ` [PATCH 10/12] ASoC: Intel: Skylake: Add library loading support Vinod Koul
2016-08-05 11:19   ` Applied "ASoC: Intel: Skylake: Add library loading support" to the asoc tree Mark Brown
2016-07-26 12:36 ` [PATCH 11/12] ASoC: Intel: Skylake: Fix a comment style Vinod Koul
2016-08-05 11:19   ` Applied "ASoC: Intel: Skylake: Fix a comment style" to the asoc tree Mark Brown
2016-07-26 12:36 ` [PATCH 12/12] ASoC: Intel: Skylake: Add module processing domain support Vinod Koul
2016-08-05 11:18   ` Applied "ASoC: Intel: Skylake: Add module processing domain support" to the asoc tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469536610-27606-7-git-send-email-vinod.koul@intel.com \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=patches.audio@intel.com \
    --cc=senthilnathanx.veppur@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).