Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSP Ops tester - Take 3 #4874

Merged
merged 10 commits into from
Jul 30, 2024
2 changes: 1 addition & 1 deletion sound/soc/sof/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

snd-sof-y := 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\
fw-file-profile.o
fw-file-profile.o debug-dsp-ops.o

# IPC implementations
ifneq ($(CONFIG_SND_SOC_SOF_IPC3),)
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sof/amd/acp-loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ int acp_sof_dsp_run(struct snd_sof_dev *sdev)
}
EXPORT_SYMBOL_NS(acp_sof_dsp_run, SND_SOC_SOF_AMD_COMMON);

int acp_sof_load_signed_firmware(struct snd_sof_dev *sdev)
int acp_sof_load_signed_firmware(struct snd_sof_dev *sdev, const char *fw_name)
{
struct snd_sof_pdata *plat_data = sdev->pdata;
struct acp_dev_data *adata = plat_data->hw_pdata;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sof/amd/acp.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void amd_sof_acp_remove(struct snd_sof_dev *sdev);
/* DSP Loader callbacks */
int acp_sof_dsp_run(struct snd_sof_dev *sdev);
int acp_dsp_pre_fw_run(struct snd_sof_dev *sdev);
int acp_sof_load_signed_firmware(struct snd_sof_dev *sdev);
int acp_sof_load_signed_firmware(struct snd_sof_dev *sdev, const char *fw_filename);
int acp_get_bar_index(struct snd_sof_dev *sdev, u32 type);

/* Block IO callbacks */
Expand Down
22 changes: 18 additions & 4 deletions sound/soc/sof/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,14 @@ static int sof_init_environment(struct snd_sof_dev *sdev)
static int sof_probe_continue(struct snd_sof_dev *sdev)
{
struct snd_sof_pdata *plat_data = sdev->pdata;
struct sof_dsp_power_state state = {
.state = SOF_DSP_PM_D3,
};
int ret;

/* set initial power state to D3 */
sdev->dsp_power_state = state;

/* Initialize loadable file paths and check the environment validity */
ret = sof_init_environment(sdev);
if (ret)
Expand Down Expand Up @@ -456,8 +462,19 @@ static int sof_probe_continue(struct snd_sof_dev *sdev)
goto ipc_err;
}

/*
* skip loading/booting firmware and registering the machine driver when DSP OPS testing
* is enabled with IPC4. Normal audio operations will be unavailable in this mode.
*/
if (sof_debug_check_flag(SOF_DBG_DSP_OPS_TEST_MODE) &&
sdev->pdata->ipc_type == SOF_IPC_TYPE_4) {
sdev->dsp_test_mode_enabled = true;
sdev->probe_completed = true;
return 0;
}

/* load the firmware */
ret = snd_sof_load_firmware(sdev);
ret = snd_sof_load_firmware(sdev, NULL);
if (ret < 0) {
dev_err(sdev->dev, "error: failed to load DSP firmware %d\n",
ret);
Expand Down Expand Up @@ -582,9 +599,6 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
/* initialize sof device */
sdev->dev = dev;

/* initialize default DSP power state */
sdev->dsp_power_state.state = SOF_DSP_PM_D0;

sdev->pdata = plat_data;
sdev->first_boot = true;
dev_set_drvdata(dev, sdev);
Expand Down
Loading
Loading