From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
To: lgirdwood@gmail.com, broonie@kernel.org
Cc: alsa-devel@alsa-project.org,
pierre-louis.bossart@linux.intel.com,
ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com,
rander.wang@intel.com
Subject: [PATCH 02/12] ASoC: SOF: Add flag and state which will be used for DSP-less mode
Date: Tue, 4 Apr 2023 12:21:05 +0300 [thread overview]
Message-ID: <20230404092115.27949-3-peter.ujfalusi@linux.intel.com> (raw)
In-Reply-To: <20230404092115.27949-1-peter.ujfalusi@linux.intel.com>
The DSPless mode of the ASoC/SOF driver can be used for hardware
verification and debug on platforms with HDaudio codecs. The DSP mode is
still needed on existing platforms for SSP, DMIC, SoundWire interfaces
managed by the GP-DMA.
This mode is also helpful to compare the legacy HDaudio driver with the
ASoC/SOF driver wrt. codec management and handling. In theory we use the
same code but differences are sometimes seen on jack detection and event
handling.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
---
include/sound/sof.h | 5 +++++
sound/soc/sof/core.c | 9 +++++++++
sound/soc/sof/sof-priv.h | 11 +++++++++++
3 files changed, 25 insertions(+)
diff --git a/include/sound/sof.h b/include/sound/sof.h
index 266e66318f9c..d3c41f87ac31 100644
--- a/include/sound/sof.h
+++ b/include/sound/sof.h
@@ -21,6 +21,7 @@ struct snd_sof_dev;
/**
* enum sof_fw_state - DSP firmware state definitions
* @SOF_FW_BOOT_NOT_STARTED: firmware boot is not yet started
+ * @SOF_DSPLESS_MODE: DSP is not used
* @SOF_FW_BOOT_PREPARE: preparing for boot (firmware loading for exaqmple)
* @SOF_FW_BOOT_IN_PROGRESS: firmware boot is in progress
* @SOF_FW_BOOT_FAILED: firmware boot failed
@@ -31,6 +32,7 @@ struct snd_sof_dev;
*/
enum sof_fw_state {
SOF_FW_BOOT_NOT_STARTED = 0,
+ SOF_DSPLESS_MODE,
SOF_FW_BOOT_PREPARE,
SOF_FW_BOOT_IN_PROGRESS,
SOF_FW_BOOT_FAILED,
@@ -130,6 +132,9 @@ struct sof_dev_desc {
unsigned int ipc_supported_mask;
enum sof_ipc_type ipc_default;
+ /* The platform supports DSPless mode */
+ bool dspless_mode_supported;
+
/* defaults paths for firmware, library and topology files */
const char *default_fw_path[SOF_IPC_TYPE_COUNT];
const char *default_lib_path[SOF_IPC_TYPE_COUNT];
diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c
index 7de8673a01ce..06bcae631612 100644
--- a/sound/soc/sof/core.c
+++ b/sound/soc/sof/core.c
@@ -365,6 +365,15 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
if (sof_core_debug)
dev_info(dev, "sof_debug value: %#x\n", sof_core_debug);
+ if (sof_debug_check_flag(SOF_DBG_DSPLESS_MODE)) {
+ if (plat_data->desc->dspless_mode_supported) {
+ dev_info(dev, "Switching to DSPless mode\n");
+ sdev->dspless_mode_selected = true;
+ } else {
+ dev_info(dev, "DSPless mode is not supported by the platform\n");
+ }
+ }
+
/* check IPC support */
if (!(BIT(plat_data->ipc_type) & plat_data->desc->ipc_supported_mask)) {
dev_err(dev, "ipc_type %d is not supported on this platform, mask is %#x\n",
diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h
index 5f919162a555..1170989bea57 100644
--- a/sound/soc/sof/sof-priv.h
+++ b/sound/soc/sof/sof-priv.h
@@ -48,6 +48,7 @@ struct snd_sof_pcm_stream;
#define SOF_DBG_FORCE_NOCODEC BIT(10) /* ignore all codec-related
* configurations
*/
+#define SOF_DBG_DSPLESS_MODE BIT(15) /* Do not initialize and use the DSP */
/* Flag definitions used for controlling the DSP dump behavior */
#define SOF_DBG_DUMP_REGS BIT(0)
@@ -528,6 +529,16 @@ struct snd_sof_dev {
spinlock_t ipc_lock; /* lock for IPC users */
spinlock_t hw_lock; /* lock for HW IO access */
+ /*
+ * When true the DSP is not used.
+ * It is set under the following condition:
+ * User sets the SOF_DBG_DSPLESS_MODE flag in sof_debug module parameter
+ * and
+ * the platform advertises that it can support such mode
+ * pdata->desc->dspless_mode_supported is true.
+ */
+ bool dspless_mode_selected;
+
/* Main, Base firmware image */
struct sof_firmware basefw;
--
2.40.0
next prev parent reply other threads:[~2023-04-04 9:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-04 9:21 [PATCH 00/12] ASoC: SOF: core/Intel: Introduce DSPless mode Peter Ujfalusi
2023-04-04 9:21 ` [PATCH 01/12] ASoC: SOF: Intel: hda-stream: Do not dereference hstream until it is safe Peter Ujfalusi
2023-04-04 9:21 ` Peter Ujfalusi [this message]
2023-04-04 9:21 ` [PATCH 03/12] ASoC: SOF: Add support for DSPless mode Peter Ujfalusi
2023-04-04 9:21 ` [PATCH 04/12] ASoC: SOF: Intel: hda: Skip interfaces not supported on a platform Peter Ujfalusi
2023-04-04 9:21 ` [PATCH 05/12] ASoC: SOF: Intel: hda: Add support for DSPless mode Peter Ujfalusi
2023-04-04 9:21 ` [PATCH 06/12] ASoC: SOF: Intel: hda: make DSPless mode work with DSP disabled in BIOS Peter Ujfalusi
2023-04-04 9:21 ` [PATCH 07/12] ASoC: SOF: Intel: pci-apl: Allow DSPless mode Peter Ujfalusi
2023-04-04 9:21 ` [PATCH 08/12] ASoC: SOF: Intel: pci-cnl: " Peter Ujfalusi
2023-04-04 9:21 ` [PATCH 09/12] ASoC: SOF: Intel: pci-icl: " Peter Ujfalusi
2023-04-04 9:21 ` [PATCH 10/12] ASoC: SOF: Intel: pci-mtl: " Peter Ujfalusi
2023-04-04 9:21 ` [PATCH 11/12] ASoC: SOF: Intel: pci-skl: " Peter Ujfalusi
2023-04-04 9:21 ` [PATCH 12/12] ASoC: SOF: Intel: pci-tgl: " Peter Ujfalusi
2023-04-04 18:05 ` [PATCH 00/12] ASoC: SOF: core/Intel: Introduce " 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=20230404092115.27949-3-peter.ujfalusi@linux.intel.com \
--to=peter.ujfalusi@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=kai.vehmanen@linux.intel.com \
--cc=lgirdwood@gmail.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=rander.wang@intel.com \
--cc=ranjani.sridharan@linux.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