Lines Matching refs:sdev

14 static int ipc3_fw_ext_man_get_version(struct snd_sof_dev *sdev,  in ipc3_fw_ext_man_get_version()  argument
20 memcpy(&sdev->fw_ready.version, &v->version, sizeof(v->version)); in ipc3_fw_ext_man_get_version()
21 sdev->fw_ready.flags = v->flags; in ipc3_fw_ext_man_get_version()
24 return sof_ipc3_validate_fw_version(sdev); in ipc3_fw_ext_man_get_version()
27 static int ipc3_fw_ext_man_get_windows(struct snd_sof_dev *sdev, in ipc3_fw_ext_man_get_windows() argument
34 return sof_ipc3_get_ext_windows(sdev, &w->ipc_window.ext_hdr); in ipc3_fw_ext_man_get_windows()
37 static int ipc3_fw_ext_man_get_cc_info(struct snd_sof_dev *sdev, in ipc3_fw_ext_man_get_cc_info() argument
44 return sof_ipc3_get_cc_info(sdev, &cc->cc_version.ext_hdr); in ipc3_fw_ext_man_get_cc_info()
47 static int ipc3_fw_ext_man_get_dbg_abi_info(struct snd_sof_dev *sdev, in ipc3_fw_ext_man_get_dbg_abi_info() argument
53 if (sdev->first_boot) in ipc3_fw_ext_man_get_dbg_abi_info()
54 dev_dbg(sdev->dev, in ipc3_fw_ext_man_get_dbg_abi_info()
63 static int ipc3_fw_ext_man_get_config_data(struct snd_sof_dev *sdev, in ipc3_fw_ext_man_get_config_data() argument
78 dev_dbg(sdev->dev, "manifest can hold up to %d config elements\n", elems_counter); in ipc3_fw_ext_man_get_config_data()
82 dev_dbg(sdev->dev, "get index %d token %d val %d\n", in ipc3_fw_ext_man_get_config_data()
92 if (sdev->first_boot && elem->value) in ipc3_fw_ext_man_get_config_data()
93 ret = snd_sof_dbg_memory_info_init(sdev); in ipc3_fw_ext_man_get_config_data()
96 dev_info(sdev->dev, in ipc3_fw_ext_man_get_config_data()
102 dev_err(sdev->dev, in ipc3_fw_ext_man_get_config_data()
112 static ssize_t ipc3_fw_ext_man_size(struct snd_sof_dev *sdev, const struct firmware *fw) in ipc3_fw_ext_man_size() argument
134 dev_dbg(sdev->dev, "Unexpected extended manifest magic number: %#x\n", in ipc3_fw_ext_man_size()
139 static size_t sof_ipc3_fw_parse_ext_man(struct snd_sof_dev *sdev) in sof_ipc3_fw_parse_ext_man() argument
141 const struct firmware *fw = sdev->basefw.fw; in sof_ipc3_fw_parse_ext_man()
151 if (remaining < 0 || remaining > sdev->basefw.fw->size) in sof_ipc3_fw_parse_ext_man()
153 ext_man_size = ipc3_fw_ext_man_size(sdev, fw); in sof_ipc3_fw_parse_ext_man()
162 dev_err(sdev->dev, in sof_ipc3_fw_parse_ext_man()
174 dev_dbg(sdev->dev, "found sof_ext_man header type %d size %#x\n", in sof_ipc3_fw_parse_ext_man()
179 dev_err(sdev->dev, in sof_ipc3_fw_parse_ext_man()
188 ret = ipc3_fw_ext_man_get_version(sdev, elem_hdr); in sof_ipc3_fw_parse_ext_man()
191 ret = ipc3_fw_ext_man_get_windows(sdev, elem_hdr); in sof_ipc3_fw_parse_ext_man()
194 ret = ipc3_fw_ext_man_get_cc_info(sdev, elem_hdr); in sof_ipc3_fw_parse_ext_man()
197 dev_dbg(sdev->dev, "Probe info (not parsed)\n"); in sof_ipc3_fw_parse_ext_man()
200 ret = ipc3_fw_ext_man_get_dbg_abi_info(sdev, elem_hdr); in sof_ipc3_fw_parse_ext_man()
203 ret = ipc3_fw_ext_man_get_config_data(sdev, elem_hdr); in sof_ipc3_fw_parse_ext_man()
206 ret = snd_sof_dsp_parse_platform_ext_manifest(sdev, elem_hdr); in sof_ipc3_fw_parse_ext_man()
209 dev_info(sdev->dev, in sof_ipc3_fw_parse_ext_man()
216 dev_err(sdev->dev, in sof_ipc3_fw_parse_ext_man()
227 dev_err(sdev->dev, "error: sof_ext_man header is inconsistent\n"); in sof_ipc3_fw_parse_ext_man()
235 static int sof_ipc3_parse_module_memcpy(struct snd_sof_dev *sdev, in sof_ipc3_parse_module_memcpy() argument
243 dev_dbg(sdev->dev, "new module size %#x blocks %#x type %#x\n", in sof_ipc3_parse_module_memcpy()
253 dev_err(sdev->dev, "not enough data remaining\n"); in sof_ipc3_parse_module_memcpy()
261 dev_warn(sdev->dev, in sof_ipc3_parse_module_memcpy()
263 dev_warn(sdev->dev, " type %#x offset %#x\n", in sof_ipc3_parse_module_memcpy()
278 dev_err(sdev->dev, "%s: bad type %#x for block %#x\n", in sof_ipc3_parse_module_memcpy()
283 dev_dbg(sdev->dev, "block %d type %#x size %#x ==> offset %#x\n", in sof_ipc3_parse_module_memcpy()
288 dev_err(sdev->dev, "%s: invalid block size %#x\n", in sof_ipc3_parse_module_memcpy()
292 ret = snd_sof_dsp_block_write(sdev, block->type, offset, in sof_ipc3_parse_module_memcpy()
295 dev_err(sdev->dev, "%s: write to block type %#x failed\n", in sof_ipc3_parse_module_memcpy()
301 dev_err(sdev->dev, "%s: not enough data remaining\n", __func__); in sof_ipc3_parse_module_memcpy()
315 static int sof_ipc3_load_fw_to_dsp(struct snd_sof_dev *sdev) in sof_ipc3_load_fw_to_dsp() argument
317 u32 payload_offset = sdev->basefw.payload_offset; in sof_ipc3_load_fw_to_dsp()
318 const struct firmware *fw = sdev->basefw.fw; in sof_ipc3_load_fw_to_dsp()
329 load_module = sof_ops(sdev)->load_module; in sof_ipc3_load_fw_to_dsp()
331 dev_dbg(sdev->dev, "Using generic module loading\n"); in sof_ipc3_load_fw_to_dsp()
334 dev_dbg(sdev->dev, "Using custom module loading\n"); in sof_ipc3_load_fw_to_dsp()
342 dev_err(sdev->dev, "%s: fw size smaller than header size\n", __func__); in sof_ipc3_load_fw_to_dsp()
349 dev_err(sdev->dev, "%s: not enough data for a module\n", in sof_ipc3_load_fw_to_dsp()
358 ret = load_module(sdev, module); in sof_ipc3_load_fw_to_dsp()
360 dev_err(sdev->dev, "%s: invalid module %d\n", __func__, count); in sof_ipc3_load_fw_to_dsp()
365 dev_err(sdev->dev, "%s: not enough data remaining\n", __func__); in sof_ipc3_load_fw_to_dsp()
378 static int sof_ipc3_validate_firmware(struct snd_sof_dev *sdev) in sof_ipc3_validate_firmware() argument
380 u32 payload_offset = sdev->basefw.payload_offset; in sof_ipc3_validate_firmware()
381 const struct firmware *fw = sdev->basefw.fw; in sof_ipc3_validate_firmware()
386 dev_err(sdev->dev, in sof_ipc3_validate_firmware()
396 dev_err(sdev->dev, "invalid firmware signature\n"); in sof_ipc3_validate_firmware()
402 dev_err(sdev->dev, in sof_ipc3_validate_firmware()
408 dev_dbg(sdev->dev, "header size=0x%x modules=0x%x abi=0x%x size=%zu\n", in sof_ipc3_validate_firmware()