-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC: SOF: IPC fallback and extended IPC file profile #4603
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
ASoC: SOF: IPC fallback and extended IPC file profile #4603
Conversation
Move the sof_of_machine_select() function to sof-of-dev.c file and provide an inline stub in case of non OF builds. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Relocate the machine handling functions from sof-audio.c to core.c to maintain code separation. While doing the move, drop the redundant IS_ERR_OR_NULL(plat_data->pdev_mach) check from sof_machine_unregister() Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Add a struct sof_loadable_file_profile which can be filled by platforms (sof-acpi-dev.c, sof-of-dev.c and sof-acpi-dev.c) to be able to use common, generic code to handle path customization. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Store the default IPC type and the firmware and topology path overrides to ipc_file_profile_base Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Store the default IPC type and the firmware and topology path overrides to ipc_file_profile_base Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Store the default IPC type and the overrides to ipc_file_profile_base Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Use the information stored in ipc_file_profile_base by platforms to construct the paths, filenames that are going to be used to load the firmware and topology files. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The core is now using the information from ipc_file_profile_base to create the paths for the loadable files, no need to set it in here anymore. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The core is now using the information from ipc_file_profile_base to create the paths for the loadable files, no need to set it in here anymore. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The core is now using the information from ipc_file_profile_base to create the paths for the loadable files, no need to set it in here anymore. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Add sof_init_environment() as a helper function to contain path and ops initialization. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
… missing If a firmware file is missing for the selected IPC type then try to switch to other supported IPC type and check if that one can be used instead. If for example a platform is changed to IPC4 as default version but the given machine does not yet have the needed topology file created then we will fall back to IPC3 which should have all the needed files. Relocate the sof_init_environment() to be done at a later phase, in sof_probe_continue(). This will only have changes in behavior if CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE is enabled (Intel HDA platforms) by not failing the module probe, but it is not going to be different case compared to for example failed firmware booting or topology loading error. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Manage the ipc4_data allocation in code instead of devm since the ops_init might be called more than once due to IPC type fallback. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
…4_data Manage the ipc4_data allocation in code instead of devm since the ops_init might be called more than once due to IPC type fallback. This needs to be squashed for upstreaming if the ipc type fallback is sent earlier. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
…ions With the SND_SOC_SOF_ALLOW_FALLBACK_TO_NEWER_IPC_VERSION the IPC version fallback behavior can be modified. If it is not enabled (default) then the fallback only considers older and supported IPC version If it is enabled then all supported IPC version (even newer ones) will be tested and if conditions met, will be selected. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The currently used paths and firmware name reflects the reference firmware
convention:
default_fw_path: intel/avs/{platform_name}
default_lib_path: intel/avs-lib/{platform_name}
default_tplg_path: intel/avs-tplg
default_fw_filename: dsp_basefw.bin
The SOF supports building the firmware for cAVS2.5 platforms using IPC4 and
it is the preferred IPC4 implementation to be used on these devices.
Change the paths and firmware names to reflect this:
default_fw_path: intel/sof-ipc4/{platform_name}
default_lib_path: intel/sof-ipc4-lib/{platform_name}
default_tplg_path: intel/sof-ipc4-tplg
default_fw_filename: sof-{platform_name}.ri
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
All three platform described by pci-cnl.c (CNL, CFL and CML) uses the same firmware image (sof-cnl.ri). Packaging is handling the different file names by using symbolic links: sof-cfl.ri -> sof-cnl.ri sof-cml.ri -> sof-cnl.ri For IPC4 the firmware and lib path should be: intel/avs/cfl -> intel/avs/cnl intel/avs-lib/cfl -> intel/avs-lib/cnl Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Add two identification strings to the device descriptor: name of the vendor (amd, imx, intel, mediatek), name of the platform (apl, tgl, rmb, imx8, mt8188, etc). These strings will be used to construct the paths and file names to be used for loading firmware files (DSP firmware, topologies, firmware libraries). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Set the vendor and platform names in sof_dev_desc, which will be used to create the default firmware layout profile paths and firmware name. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Set the vendor and platform names in sof_dev_desc, which will be used to create the default firmware layout profile paths and firmware name. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Set the vendor and platform names in sof_dev_desc, which will be used to create the default firmware layout profile paths and firmware name. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
…tors Set the vendor and platform names in sof_dev_desc, which will be used to create the default firmware layout profile paths and firmware name. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The current way of setting the default paths and file names for firmware files are to have strings in the sof_dev_desc struct for the each supported IPC version and for each platform. For IPC3 we have a standard pattern among vendors and platforms: firmware path: <vendor>/sof</fw_path_postfix> firmware name: sof-<platform>.ri topology path: <vendor>/sof-tplg/ With IPC4 we have three pattern variations: SOF generic: firmware path: <vendor>/sof-ipc4/<platform></fw_path_postfix> firmware name: sof-<platform>.ri firmware lib path: <vendor>/sof-ipc4-lib/<platform></fw_path_postfix> topology path: <vendor>/sof-ipc4-tplg/ SOF for Intel ACE platforms: firmware path: intel/sof-ipc4/<platform></fw_path_postfix> firmware name: sof-<platform>.ri firmware lib path: intel/sof-ipc4-lib/<platform></fw_path_postfix> topology path: intel/sof-ace-tplg/ Intel ACE firmware: firmware path: intel/avs/<platform></fw_path_postfix> firmware name: dsp_basefw.bin firmware lib path: intel/avs/<platform></fw_path_postfix> topology path: intel/avs-tplg/ With the 'vendor' and 'platform' string provided in sof_dev_desc we can generate any of these layouts and we can even pick the one which is available on the filesystem without a need to provide kernel parameters or modify the kernel. It can ease up moving to a new layout while providing backwards compatibility with existing sof-bin packages in case of IPC4. Moving the current Intel ACE layout to a generic IPC4 layout would be easy since the kernel will just figure out that now the files are in a differnt directory (the tplg files). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
…descriptor The core no longer uses the default_fw_path, default_tplg_path and default_fw_filename. The paths and filename is created based on the vendor and platform strings. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
…descriptor The core no longer uses the default_fw_path, default_tplg_path and default_fw_filename. The paths and filename is created based on the vendor and platform strings. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
…m descriptor The core no longer uses the default_fw_path, default_tplg_path and default_fw_filename. The paths and filename is created based on the vendor and platform strings. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
…from descriptor The core no longer uses the default_fw_path, default_tplg_path and default_fw_filename. The paths and filename is created based on the vendor and platform strings. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
…re name The default_fw_path, default_tplg_path, default_lib_path and default_fw_filename are no longer used, they can be removed from sof_dev_desc. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
|
@ujfalusi do you mind closing obsolete PRs, I can't keep up with 4 PRs on the same topics. Thanks! |
This draft PR contains 3 topics: Both of the open PRs received(ing) quite a bit of pushback, the new stuff in the draft will cause even more eyebrows to be lifted. But, if you think that these should be combined then I can close the other two, but I would like to have the #4382 merged separately to be able to send ti upstream asap. |
|
I can't review 4 PRs that look similar, it's just confusing. It was already confusing and review fatigue hit 2 months ago already. |
OK, let me close this and I will open this when the other two is done. |
Hi,
this PR contains
#4331
and
#4382
On top of these it implements support for different file layouts per IPC type (for IPC4 to be specific):
If IPC4 is selected then the kernel will test the profiles and picks the one which has all the files needed for the board.
on TGL these are the paths: