Lines Matching +full:ipc +full:- +full:3
1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
14 #include "sof-priv.h"
19 struct snd_sof_pdata *plat_data = sdev->pdata; in snd_sof_load_firmware_raw()
25 if (sdev->basefw.fw) in snd_sof_load_firmware_raw()
29 plat_data->fw_filename_prefix, in snd_sof_load_firmware_raw()
30 plat_data->fw_filename); in snd_sof_load_firmware_raw()
32 return -ENOMEM; in snd_sof_load_firmware_raw()
34 ret = request_firmware(&sdev->basefw.fw, fw_filename, sdev->dev); in snd_sof_load_firmware_raw()
37 dev_err(sdev->dev, in snd_sof_load_firmware_raw()
39 dev_err(sdev->dev, in snd_sof_load_firmware_raw()
40 " download it from https://github.com/thesofproject/sof-bin/\n"); in snd_sof_load_firmware_raw()
43 dev_dbg(sdev->dev, "request_firmware %s successful\n", in snd_sof_load_firmware_raw()
48 ext_man_size = sdev->ipc->ops->fw_loader->parse_ext_manifest(sdev); in snd_sof_load_firmware_raw()
51 sdev->basefw.payload_offset = ext_man_size; in snd_sof_load_firmware_raw()
54 dev_dbg(sdev->dev, "firmware doesn't contain extended manifest\n"); in snd_sof_load_firmware_raw()
57 dev_err(sdev->dev, "error: firmware %s contains unsupported or invalid extended manifest: %d\n", in snd_sof_load_firmware_raw()
77 ret = sdev->ipc->ops->fw_loader->validate(sdev); in snd_sof_load_firmware_memcpy()
79 dev_err(sdev->dev, "error: invalid FW header\n"); in snd_sof_load_firmware_memcpy()
86 dev_err(sdev->dev, "error: failed to reset DSP\n"); in snd_sof_load_firmware_memcpy()
91 if (sdev->ipc->ops->fw_loader->load_fw_to_dsp) { in snd_sof_load_firmware_memcpy()
92 ret = sdev->ipc->ops->fw_loader->load_fw_to_dsp(sdev); in snd_sof_load_firmware_memcpy()
94 dev_err(sdev->dev, "Firmware loading failed\n"); in snd_sof_load_firmware_memcpy()
102 release_firmware(sdev->basefw.fw); in snd_sof_load_firmware_memcpy()
103 sdev->basefw.fw = NULL; in snd_sof_load_firmware_memcpy()
113 init_waitqueue_head(&sdev->boot_wait); in snd_sof_run_firmware()
115 /* (re-)enable dsp dump */ in snd_sof_run_firmware()
116 sdev->dbg_dump_printed = false; in snd_sof_run_firmware()
117 sdev->ipc_dump_printed = false; in snd_sof_run_firmware()
119 /* create read-only fw_version debugfs to store boot version info */ in snd_sof_run_firmware()
120 if (sdev->first_boot) { in snd_sof_run_firmware()
121 ret = snd_sof_debugfs_buf_item(sdev, &sdev->fw_version, in snd_sof_run_firmware()
122 sizeof(sdev->fw_version), in snd_sof_run_firmware()
126 dev_err(sdev->dev, "snd_sof_debugfs_buf_item failed\n"); in snd_sof_run_firmware()
134 dev_err(sdev->dev, "failed pre fw run op\n"); in snd_sof_run_firmware()
138 dev_dbg(sdev->dev, "booting DSP firmware\n"); in snd_sof_run_firmware()
149 * now wait for the DSP to boot. There are 3 possible outcomes: in snd_sof_run_firmware()
152 * 3. FW boots but fw_ready op fails. in snd_sof_run_firmware()
154 ret = wait_event_timeout(sdev->boot_wait, in snd_sof_run_firmware()
155 sdev->fw_state > SOF_FW_BOOT_IN_PROGRESS, in snd_sof_run_firmware()
156 msecs_to_jiffies(sdev->boot_timeout)); in snd_sof_run_firmware()
161 return -EIO; in snd_sof_run_firmware()
164 if (sdev->fw_state == SOF_FW_BOOT_READY_FAILED) in snd_sof_run_firmware()
165 return -EIO; /* FW boots but fw_ready op failed */ in snd_sof_run_firmware()
167 dev_dbg(sdev->dev, "firmware boot complete\n"); in snd_sof_run_firmware()
173 dev_err(sdev->dev, "error: failed post fw run op\n"); in snd_sof_run_firmware()
177 if (sdev->ipc->ops->post_fw_boot) in snd_sof_run_firmware()
178 return sdev->ipc->ops->post_fw_boot(sdev); in snd_sof_run_firmware()
187 release_firmware(sdev->basefw.fw); in snd_sof_fw_unload()
188 sdev->basefw.fw = NULL; in snd_sof_fw_unload()