Skip to contentSkip to conversation

ASoC: SOF: IPC Abstraction for FW loading

PATCH In review Ranjani Sridharan 2 participants 12 messages Apr 25, 2022 – Apr 29, 2022

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover ASoC: SOF: IPC Abstraction for FW loading

This series introduces IPC abstraction for FW loading in the SOF driver in preparation for supporting the new IPC version in the SOF firmware.

Peter Ujfalusi (10):
ASoC: SOF: Introduce IPC dependent ops for firmware handling, loading
ASoC: SOF: ipc3-loader: Implement firmware parsing and loading
ASoC: SOF: ipc: Add check for fw_loader ops
ASoC: SOF: loader: Switch to use the fw_loader ops
ASoC: SOF: amd: renoir: Do not set the load_module ops
ASoC: SOF: imx: Do not set the load_module ops
ASoC: SOF: Intel: bdw/byt/pci-tng: Do not set the load_module ops
ASoC: SOF: mediatek: mt8195: Do not set the load_module ops
ASoC: SOF: loader: Remove snd_sof_parse_module_memcpy() as it is not
used
ASoC: SOF: loader: Call optional query_fw_configuration on first boot

 sound/soc/sof/Makefile                 |   2 +-
 sound/soc/sof/amd/renoir.c             |   3 -
 sound/soc/sof/imx/imx8.c               |   6 +-
 sound/soc/sof/imx/imx8m.c              |   3 +-
 sound/soc/sof/intel/bdw.c              |   3 -
 sound/soc/sof/intel/byt.c              |   6 -
 sound/soc/sof/intel/pci-tng.c          |   3 -
 sound/soc/sof/ipc.c                    |  57 +--
 sound/soc/sof/ipc3-loader.c            | 416 ++++++++++++++++++++++
 sound/soc/sof/ipc3-priv.h              |  24 ++
 sound/soc/sof/ipc3.c                   |  62 +++-
 sound/soc/sof/loader.c                 | 471 +------------------------
 sound/soc/sof/mediatek/mt8195/mt8195.c |   2 -
 sound/soc/sof/sof-priv.h               |  24 +-
 14 files changed, 539 insertions(+), 543 deletions(-)
 create mode 100644 sound/soc/sof/ipc3-loader.c
 create mode 100644 sound/soc/sof/ipc3-priv.h
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/10 ASoC: SOF: Introduce IPC dependent ops for firmware handling, loading

From: Peter Ujfalusi <[email protected]>

The parsing and loading of firmware modules/components are IPC dependent operations as the organization of the firmware depends on the IPC it is supporting.

---
 sound/soc/sof/sof-priv.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
sound/soc/sof/sof-priv.h +21 -0
index 382187e89e54..1df0b1473661 100644
@@ -364,6 +364,25 @@ struct sof_ipc_pm_ops {
 	int (*ctx_restore)(struct snd_sof_dev *sdev);
 };
 
+/**
+ * struct sof_ipc_fw_loader_ops - IPC/FW-specific loader ops
+ * @validate:		Function pointer for validating the firmware image
+ * @parse_ext_manifest:	Function pointer for parsing the manifest of the firmware
+ * @load_fw_to_dsp:	Optional function pointer for loading the firmware to the
+ *			DSP.
+ *			The function implements generic, hardware independent way
+ *			of loading the initial firmware and its modules (if any).
+ * @query_fw_configuration: Optional function pointer to query information and
+ *			configuration from the booted firmware.
+ *			Executed after the first successful firmware boot.
+ */
+struct sof_ipc_fw_loader_ops {
+	int (*validate)(struct snd_sof_dev *sdev);
+	size_t (*parse_ext_manifest)(struct snd_sof_dev *sdev);
+	int (*load_fw_to_dsp)(struct snd_sof_dev *sdev);
+	int (*query_fw_configuration)(struct snd_sof_dev *sdev);
+};
+
 struct sof_ipc_tplg_ops;
 struct sof_ipc_pcm_ops;
 
@@ -372,6 +391,7 @@ struct sof_ipc_pcm_ops;
  * @tplg:	Pointer to IPC-specific topology ops
  * @pm:		Pointer to PM ops
  * @pcm:	Pointer to PCM ops
+ * @fw_loader:	Pointer to Firmware Loader ops
  *
  * @tx_msg:	Function pointer for sending a 'short' IPC message
  * @set_get_data: Function pointer for set/get data ('large' IPC message). This
@@ -391,6 +411,7 @@ struct sof_ipc_ops {
 	const struct sof_ipc_tplg_ops *tplg;
 	const struct sof_ipc_pm_ops *pm;
 	const struct sof_ipc_pcm_ops *pcm;
+	const struct sof_ipc_fw_loader_ops *fw_loader;
 
 	int (*tx_msg)(struct snd_sof_dev *sdev, void *msg_data, size_t msg_bytes,
 		      void *reply_data, size_t reply_bytes, bool no_pm);
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/10 ASoC: SOF: ipc3-loader: Implement firmware parsing and loading

In reply to Ranjani Sridharan

From: Peter Ujfalusi <[email protected]>

Add the IPC3 dependent implementation of validating the firmware image, parsing the ext manifest and to load modules via memcpy.

The code introduced by this commit is the IPC dependent code from the loader.c, which is going to be removed later.

---
 sound/soc/sof/Makefile      |   2 +-
 sound/soc/sof/ipc3-loader.c | 416 ++++++++++++++++++++++++++++++++++++
 sound/soc/sof/ipc3-priv.h   |  24 +++
 sound/soc/sof/ipc3.c        |  62 +++++-
 4 files changed, 498 insertions(+), 6 deletions(-)
 create mode 100644 sound/soc/sof/ipc3-loader.c
 create mode 100644 sound/soc/sof/ipc3-priv.h
sound/soc/sof/Makefile +1 -1
index 18acbc001b9a..e7dc47b01437 100644
@@ -2,7 +2,7 @@
 
 snd-sof-objs := core.o ops.o loader.o ipc.o pcm.o pm.o debug.o topology.o\
 		control.o trace.o iomem-utils.o sof-audio.o stream-ipc.o\
-		ipc3-topology.o ipc3.o ipc3-control.o ipc3-pcm.o
+		ipc3-topology.o ipc3-control.o ipc3.o ipc3-pcm.o ipc3-loader.o
 ifneq ($(CONFIG_SND_SOC_SOF_CLIENT),)
 snd-sof-objs += sof-client.o
 endif
sound/soc/sof/ipc3-loader.c new file +416 -0

416 lines not on this page · raw message

sound/soc/sof/ipc3-priv.h new file +24 -0
new file mode 100644
index 000000000000..a9b9201508a5
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
+/*
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * Copyright(c) 2021 Intel Corporation. All rights reserved.
+ */
+
+#ifndef __SOUND_SOC_SOF_IPC3_PRIV_H
+#define __SOUND_SOC_SOF_IPC3_PRIV_H
+
+#include "sof-priv.h"
+
+/* IPC3 specific ops */
+extern const struct sof_ipc_fw_loader_ops ipc3_loader_ops;
+
+/* helpers for fw_ready and ext_manifest parsing */
+int sof_ipc3_get_ext_windows(struct snd_sof_dev *sdev,
+			     const struct sof_ipc_ext_data_hdr *ext_hdr);
+int sof_ipc3_get_cc_info(struct snd_sof_dev *sdev,
+			 const struct sof_ipc_ext_data_hdr *ext_hdr);
+int sof_ipc3_validate_fw_version(struct snd_sof_dev *sdev);
+
+#endif
sound/soc/sof/ipc3.c +57 -5

98 lines not on this page · raw message

Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/10 ASoC: SOF: ipc: Add check for fw_loader ops

In reply to Ranjani Sridharan

From: Peter Ujfalusi <[email protected]>

Add checks for the mandatory fw_loader ops.

---
 sound/soc/sof/ipc.c | 6 ++++++
 1 file changed, 6 insertions(+)
sound/soc/sof/ipc.c +6 -0
index 48ea58dbc998..8fbd72c40359 100644
@@ -220,6 +220,12 @@ struct snd_sof_ipc *snd_sof_ipc_init(struct snd_sof_dev *sdev)
 		return NULL;
 	}
 
+	if (!ops->fw_loader || !ops->fw_loader->validate ||
+	    !ops->fw_loader->parse_ext_manifest) {
+		dev_err(sdev->dev, "Missing IPC firmware loading ops\n");
+		return NULL;
+	}
+
 	if (!ops->pcm) {
 		dev_err(sdev->dev, "Missing IPC PCM ops\n");
 		return NULL;
Signature · 1 line
2.25.1
#4 lore raw

PATCH 4/10 ASoC: SOF: loader: Switch to use the fw_loader ops

In reply to Ranjani Sridharan

From: Peter Ujfalusi <[email protected]>

Since we have the fw_loader ops implementation for IPC3, we can start using it and remove most of the IPC dependent code from the file.

---
 sound/soc/sof/ipc.c      |  51 ------
 sound/soc/sof/loader.c   | 383 +--------------------------------------
 sound/soc/sof/sof-priv.h |   1 -
 3 files changed, 8 insertions(+), 427 deletions(-)
sound/soc/sof/ipc.c +0 -51
index 8fbd72c40359..a6ec4b5a4923 100644
@@ -137,57 +137,6 @@ void snd_sof_ipc_reply(struct snd_sof_dev *sdev, u32 msg_id)
 }
 EXPORT_SYMBOL(snd_sof_ipc_reply);
 
-int snd_sof_ipc_valid(struct snd_sof_dev *sdev)
-{
-	struct sof_ipc_fw_ready *ready = &sdev->fw_ready;
-	struct sof_ipc_fw_version *v = &ready->version;
-
-	dev_info(sdev->dev,
-		 "Firmware info: version %d:%d:%d-%s\n",  v->major, v->minor,
-		 v->micro, v->tag);
-	dev_info(sdev->dev,
-		 "Firmware: ABI %d:%d:%d Kernel ABI %d:%d:%d\n",
-		 SOF_ABI_VERSION_MAJOR(v->abi_version),
-		 SOF_ABI_VERSION_MINOR(v->abi_version),
-		 SOF_ABI_VERSION_PATCH(v->abi_version),
-		 SOF_ABI_MAJOR, SOF_ABI_MINOR, SOF_ABI_PATCH);
-
-	if (SOF_ABI_VERSION_INCOMPATIBLE(SOF_ABI_VERSION, v->abi_version)) {
-		dev_err(sdev->dev, "error: incompatible FW ABI version\n");
-		return -EINVAL;
-	}
-
-	if (SOF_ABI_VERSION_MINOR(v->abi_version) > SOF_ABI_MINOR) {
-		if (!IS_ENABLED(CONFIG_SND_SOC_SOF_STRICT_ABI_CHECKS)) {
-			dev_warn(sdev->dev, "warn: FW ABI is more recent than kernel\n");
-		} else {
-			dev_err(sdev->dev, "error: FW ABI is more recent than kernel\n");
-			return -EINVAL;
-		}
-	}
-
-	if (ready->flags & SOF_IPC_INFO_BUILD) {
-		dev_info(sdev->dev,
-			 "Firmware debug build %d on %s-%s - options:\n"
-			 " GDB: %s\n"
-			 " lock debug: %s\n"
-			 " lock vdebug: %s\n",
-			 v->build, v->date, v->time,
-			 (ready->flags & SOF_IPC_INFO_GDB) ?
-				"enabled" : "disabled",
-			 (ready->flags & SOF_IPC_INFO_LOCKS) ?
-				"enabled" : "disabled",
-			 (ready->flags & SOF_IPC_INFO_LOCKSV) ?
-				"enabled" : "disabled");
-	}
-
-	/* copy the fw_version into debugfs at first boot */
-	memcpy(&sdev->fw_version, v, sizeof(*v));
-
-	return 0;
-}
-EXPORT_SYMBOL(snd_sof_ipc_valid);
-
 struct snd_sof_ipc *snd_sof_ipc_init(struct snd_sof_dev *sdev)
 {
 	struct snd_sof_ipc *ipc;
sound/soc/sof/loader.c +8 -375

413 lines not on this page · raw message

sound/soc/sof/sof-priv.h +0 -1
index 1df0b1473661..38cdca6a10fd 100644
@@ -623,7 +623,6 @@ static inline void snd_sof_ipc_msgs_rx(struct snd_sof_dev *sdev)
 {
 	sdev->ipc->ops->rx_msg(sdev);
 }
-int snd_sof_ipc_valid(struct snd_sof_dev *sdev);
 int sof_ipc_tx_message(struct snd_sof_ipc *ipc, void *msg_data, size_t msg_bytes,
 		       void *reply_data, size_t reply_bytes);
 int sof_ipc_tx_message_no_pm(struct snd_sof_ipc *ipc, void *msg_data, size_t msg_bytes,
Signature · 1 line
2.25.1
#5 lore raw

PATCH 5/10 ASoC: SOF: amd: renoir: Do not set the load_module ops

In reply to Ranjani Sridharan

From: Peter Ujfalusi <[email protected]>

The used firmware loader (snd_sof_load_firmware_memcpy) can use the generic module loading, which is by default uses the same implementation as the snd_sof_parse_module_memcpy.

No need to set the callback for this platform.

---
 sound/soc/sof/amd/renoir.c | 3 ---
 1 file changed, 3 deletions(-)
sound/soc/sof/amd/renoir.c +0 -3
index 275f266c5e4d..70190365328c 100644
@@ -136,9 +136,6 @@ struct snd_sof_dsp_ops sof_renoir_ops = {
 	.block_read		= acp_dsp_block_read,
 	.block_write		= acp_dsp_block_write,
 
-	/* Module loading */
-	.load_module		= snd_sof_parse_module_memcpy,
-
 	/*Firmware loading */
 	.load_firmware		= snd_sof_load_firmware_memcpy,
 	.pre_fw_run		= acp_dsp_pre_fw_run,
Signature · 1 line
2.25.1
#6 lore raw

PATCH 6/10 ASoC: SOF: imx: Do not set the load_module ops

In reply to Ranjani Sridharan

From: Peter Ujfalusi <[email protected]>

The used firmware loader (snd_sof_load_firmware_memcpy) can use the generic module loading, which is by default uses the same implementation as the snd_sof_parse_module_memcpy.

No need to set the callback for iMX.

---
 sound/soc/sof/imx/imx8.c  | 6 ++----
 sound/soc/sof/imx/imx8m.c | 3 +--
 2 files changed, 3 insertions(+), 6 deletions(-)
sound/soc/sof/imx/imx8.c +2 -4
index ba2fbed93f1d..2844d9a8040a 100644
@@ -510,9 +510,8 @@ static struct snd_sof_dsp_ops sof_imx8_ops = {
 	.ipc_msg_data	= sof_ipc_msg_data,
 	.set_stream_data_offset = sof_set_stream_data_offset,
 
-	/* module loading */
-	.load_module	= snd_sof_parse_module_memcpy,
 	.get_bar_index	= imx8_get_bar_index,
+
 	/* firmware loading */
 	.load_firmware	= snd_sof_load_firmware_memcpy,
 
@@ -572,9 +571,8 @@ static struct snd_sof_dsp_ops sof_imx8x_ops = {
 	.ipc_msg_data	= sof_ipc_msg_data,
 	.set_stream_data_offset = sof_set_stream_data_offset,
 
-	/* module loading */
-	.load_module	= snd_sof_parse_module_memcpy,
 	.get_bar_index	= imx8_get_bar_index,
+
 	/* firmware loading */
 	.load_firmware	= snd_sof_load_firmware_memcpy,
 
sound/soc/sof/imx/imx8m.c +1 -2
index 1e95f91a7b22..1243f8a6141e 100644
@@ -436,9 +436,8 @@ static struct snd_sof_dsp_ops sof_imx8m_ops = {
 	.ipc_msg_data	= sof_ipc_msg_data,
 	.set_stream_data_offset = sof_set_stream_data_offset,
 
-	/* module loading */
-	.load_module	= snd_sof_parse_module_memcpy,
 	.get_bar_index	= imx8m_get_bar_index,
+
 	/* firmware loading */
 	.load_firmware	= snd_sof_load_firmware_memcpy,
 
Signature · 1 line
2.25.1
#7 lore raw

PATCH 7/10 ASoC: SOF: Intel: bdw/byt/pci-tng: Do not set the load_module ops

In reply to Ranjani Sridharan

From: Peter Ujfalusi <[email protected]>

The used firmware loader (snd_sof_load_firmware_memcpy) can use the generic module loading, which is by default uses the same implementation as the snd_sof_parse_module_memcpy.

No need to set the callback for these platforms.

---
 sound/soc/sof/intel/bdw.c     | 3 ---
 sound/soc/sof/intel/byt.c     | 6 ------
 sound/soc/sof/intel/pci-tng.c | 3 ---
 3 files changed, 12 deletions(-)
sound/soc/sof/intel/bdw.c +0 -3
index c0a1d4ae8c68..26df780c702e 100644
@@ -613,9 +613,6 @@ static struct snd_sof_dsp_ops sof_bdw_ops = {
 	.pcm_open	= sof_stream_pcm_open,
 	.pcm_close	= sof_stream_pcm_close,
 
-	/* Module loading */
-	.load_module    = snd_sof_parse_module_memcpy,
-
 	/*Firmware loading */
 	.load_firmware	= snd_sof_load_firmware_memcpy,
 
sound/soc/sof/intel/byt.c +0 -6
index 0fd5edb1bdbc..4ed8381eceda 100644
@@ -267,9 +267,6 @@ static struct snd_sof_dsp_ops sof_byt_ops = {
 	.pcm_open	= sof_stream_pcm_open,
 	.pcm_close	= sof_stream_pcm_close,
 
-	/* module loading */
-	.load_module	= snd_sof_parse_module_memcpy,
-
 	/*Firmware loading */
 	.load_firmware	= snd_sof_load_firmware_memcpy,
 
@@ -349,9 +346,6 @@ static struct snd_sof_dsp_ops sof_cht_ops = {
 	.pcm_open	= sof_stream_pcm_open,
 	.pcm_close	= sof_stream_pcm_close,
 
-	/* module loading */
-	.load_module	= snd_sof_parse_module_memcpy,
-
 	/*Firmware loading */
 	.load_firmware	= snd_sof_load_firmware_memcpy,
 
sound/soc/sof/intel/pci-tng.c +0 -3
index f1aae9667834..f0f6d9ba8803 100644
@@ -186,9 +186,6 @@ struct snd_sof_dsp_ops sof_tng_ops = {
 	.pcm_open	= sof_stream_pcm_open,
 	.pcm_close	= sof_stream_pcm_close,
 
-	/* module loading */
-	.load_module	= snd_sof_parse_module_memcpy,
-
 	/*Firmware loading */
 	.load_firmware	= snd_sof_load_firmware_memcpy,
 
Signature · 1 line
2.25.1
#8 lore raw

PATCH 8/10 ASoC: SOF: mediatek: mt8195: Do not set the load_module ops

In reply to Ranjani Sridharan

From: Peter Ujfalusi <[email protected]>

The used firmware loader (snd_sof_load_firmware_memcpy) can use the generic module loading, which is by default uses the same implementation as the snd_sof_parse_module_memcpy.

No need to set the callback for this platform.

---
 sound/soc/sof/mediatek/mt8195/mt8195.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/sof/mediatek/mt8195/mt8195.c +0 -2
index 90ec7b14823b..1766050e39f5 100644
@@ -415,8 +415,6 @@ static struct snd_sof_dsp_ops sof_mt8195_ops = {
 	/* misc */
 	.get_bar_index	= mt8195_get_bar_index,
 
-	/* module loading */
-	.load_module	= snd_sof_parse_module_memcpy,
 	/* firmware loading */
 	.load_firmware	= snd_sof_load_firmware_memcpy,
 
Signature · 1 line
2.25.1
#9 lore raw

PATCH 9/10 ASoC: SOF: loader: Remove snd_sof_parse_module_memcpy() as it is not used

In reply to Ranjani Sridharan

From: Peter Ujfalusi <[email protected]>

The snd_sof_parse_module_memcpy() is no longer used and we have the implementation of it in ipc3-loader.c which is a default mode to load module(s) with IPC3 if the snd_sof_load_firmware_memcpy() is used for loading the firmware.

---
 sound/soc/sof/loader.c   | 85 ----------------------------------------
 sound/soc/sof/sof-priv.h |  2 -
 2 files changed, 87 deletions(-)
sound/soc/sof/loader.c +0 -85
index 478c3a22dfca..8672dcc9cc1e 100644
@@ -11,94 +11,9 @@
 //
 
 #include <linux/firmware.h>
-#include <sound/sof.h>
-#include <sound/sof/ext_manifest.h>
 #include "sof-priv.h"
 #include "ops.h"
 
-/* generic module parser for mmaped DSPs */
-int snd_sof_parse_module_memcpy(struct snd_sof_dev *sdev,
-				struct snd_sof_mod_hdr *module)
-{
-	struct snd_sof_blk_hdr *block;
-	int count, ret;
-	u32 offset;
-	size_t remaining;
-
-	dev_dbg(sdev->dev, "new module size 0x%x blocks 0x%x type 0x%x\n",
-		module->size, module->num_blocks, module->type);
-
-	block = (struct snd_sof_blk_hdr *)((u8 *)module + sizeof(*module));
-
-	/* module->size doesn't include header size */
-	remaining = module->size;
-	for (count = 0; count < module->num_blocks; count++) {
-		/* check for wrap */
-		if (remaining < sizeof(*block)) {
-			dev_err(sdev->dev, "error: not enough data remaining\n");
-			return -EINVAL;
-		}
-
-		/* minus header size of block */
-		remaining -= sizeof(*block);
-
-		if (block->size == 0) {
-			dev_warn(sdev->dev,
-				 "warning: block %d size zero\n", count);
-			dev_warn(sdev->dev, " type 0x%x offset 0x%x\n",
-				 block->type, block->offset);
-			continue;
-		}
-
-		switch (block->type) {
-		case SOF_FW_BLK_TYPE_RSRVD0:
-		case SOF_FW_BLK_TYPE_ROM...SOF_FW_BLK_TYPE_RSRVD14:
-			continue;	/* not handled atm */
-		case SOF_FW_BLK_TYPE_IRAM:
-		case SOF_FW_BLK_TYPE_DRAM:
-		case SOF_FW_BLK_TYPE_SRAM:
-			offset = block->offset;
-			break;
-		default:
-			dev_err(sdev->dev, "error: bad type 0x%x for block 0x%x\n",
-				block->type, count);
-			return -EINVAL;
-		}
-
-		dev_dbg(sdev->dev,
-			"block %d type 0x%x size 0x%x ==>  offset 0x%x\n",
-			count, block->type, block->size, offset);
-
-		/* checking block->size to avoid unaligned access */
-		if (block->size % sizeof(u32)) {
-			dev_err(sdev->dev, "error: invalid block size 0x%x\n",
-				block->size);
-			return -EINVAL;
-		}
-		ret = snd_sof_dsp_block_write(sdev, block->type, offset,
-					      block + 1, block->size);
-		if (ret < 0) {
-			dev_err(sdev->dev, "error: write to block type 0x%x failed\n",
-				block->type);
-			return ret;
-		}
-
-		if (remaining < block->size) {
-			dev_err(sdev->dev, "error: not enough data remaining\n");
-			return -EINVAL;
-		}
-
-		/* minus body size of block */
-		remaining -= block->size;
-		/* next block */
-		block = (struct snd_sof_blk_hdr *)((u8 *)block + sizeof(*block)
-			+ block->size);
-	}
-
-	return 0;
-}
-EXPORT_SYMBOL(snd_sof_parse_module_memcpy);
-
 int snd_sof_load_firmware_raw(struct snd_sof_dev *sdev)
 {
 	struct snd_sof_pdata *plat_data = sdev->pdata;
sound/soc/sof/sof-priv.h +0 -2
index 38cdca6a10fd..a1141ea8d907 100644
@@ -608,8 +608,6 @@ extern struct snd_compress_ops sof_compressed_ops;
 int snd_sof_load_firmware_raw(struct snd_sof_dev *sdev);
 int snd_sof_load_firmware_memcpy(struct snd_sof_dev *sdev);
 int snd_sof_run_firmware(struct snd_sof_dev *sdev);
-int snd_sof_parse_module_memcpy(struct snd_sof_dev *sdev,
-				struct snd_sof_mod_hdr *module);
 void snd_sof_fw_unload(struct snd_sof_dev *sdev);
 
 /*
Signature · 1 line
2.25.1
#10 lore raw

PATCH 10/10 ASoC: SOF: loader: Call optional query_fw_configuration on first boot

In reply to Ranjani Sridharan

From: Peter Ujfalusi <[email protected]>

Execute the firmware information query on the first boot if it is available.

---
 sound/soc/sof/loader.c | 3 +++
 1 file changed, 3 insertions(+)
sound/soc/sof/loader.c +3 -0
index 8672dcc9cc1e..5f51d936b306 100644
@@ -175,6 +175,9 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev)
 	dev_dbg(sdev->dev, "firmware boot complete\n");
 	sof_set_fw_state(sdev, SOF_FW_BOOT_COMPLETE);
 
+	if (sdev->first_boot && sdev->ipc->ops->fw_loader->query_fw_configuration)
+		return sdev->ipc->ops->fw_loader->query_fw_configuration(sdev);
+
 	return 0;
 }
 EXPORT_SYMBOL(snd_sof_run_firmware);
Signature · 1 line
2.25.1
maintainer
#11 lore raw
In reply to Ranjani Sridharan
Quoted 16 lines · Ranjani Sridharan

This series introduces IPC abstraction for FW loading in the SOF driver in preparation for supporting the new IPC version in the SOF firmware.

Peter Ujfalusi (10):
ASoC: SOF: Introduce IPC dependent ops for firmware handling, loading
ASoC: SOF: ipc3-loader: Implement firmware parsing and loading
ASoC: SOF: ipc: Add check for fw_loader ops
ASoC: SOF: loader: Switch to use the fw_loader ops
ASoC: SOF: amd: renoir: Do not set the load_module ops
ASoC: SOF: imx: Do not set the load_module ops
ASoC: SOF: Intel: bdw/byt/pci-tng: Do not set the load_module ops
ASoC: SOF: mediatek: mt8195: Do not set the load_module ops
ASoC: SOF: loader: Remove snd_sof_parse_module_memcpy() as it is not
used
ASoC: SOF: loader: Call optional query_fw_configuration on first boot

Quoted 1 line

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[01/10] ASoC: SOF: Introduce IPC dependent ops for firmware handling, loading

        commit: 61bafd1c4571ceb9cdf1830a257eac873d0b68ee
[02/10] ASoC: SOF: ipc3-loader: Implement firmware parsing and loading
        commit: d2458baa799fff377660d86323dd20a3f4deecb4
[03/10] ASoC: SOF: ipc: Add check for fw_loader ops
        commit: 2a6099a73c943130c6f864c2df9c5607d25f6b6b
[04/10] ASoC: SOF: loader: Switch to use the fw_loader ops
        commit: 143cdcf1780eae05c33184380987d29682ac1ad6
[05/10] ASoC: SOF: amd: renoir: Do not set the load_module ops
        commit: 0da5f110c583551b39471ecedc3fba704c7362a5
[06/10] ASoC: SOF: imx: Do not set the load_module ops
        commit: 499c55fe5f5e5c4d586777e6850f484c1ded3bb8
[07/10] ASoC: SOF: Intel: bdw/byt/pci-tng: Do not set the load_module ops
        commit: a22502fb61b2fdd9ba12e158590a29b6d35ae68a
[08/10] ASoC: SOF: mediatek: mt8195: Do not set the load_module ops
        commit: 77b677d139dbf53fec02e1cfe3cc593f5a5f080a
[09/10] ASoC: SOF: loader: Remove snd_sof_parse_module_memcpy() as it is not used
        commit: 910bd536d3f72d9c39e5ec08e946c11f9bcdc532
[10/10] ASoC: SOF: loader: Call optional query_fw_configuration on first boot
        commit: 1dd4b999dad2d8b8fce257e4c3c3d334a709c933

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark