-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC: SOF: Firmware (file) layout profile support (including the generic IPC type naming) #4308
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: Firmware (file) layout profile support (including the generic IPC type naming) #4308
Conversation
|
Looks like |
|
On the CI machine: on a arch machine: so CI is using custom layout for this machine. |
|
I can fix this by forcing similar symlinking for IPC4, so link Is this acceptable solution? |
Change the enum names for the IPC types to be more descriptive and drop tying the IPC4 to Intel SoCs. Add defines to avoid build breakage while the related code is modified to use the new enum names. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Clarify the description of the ipc_type module parameter and drop the Intel CAVS in favor of IPC4. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Drop the Intel from the IPC type Kconfig option Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Use the new SOF_IPC_TYPE_3, SOF_IPC_TYPE_4 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Use the new SOF_IPC_TYPE_3 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Use the new SOF_IPC_TYPE_3 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Use the new SOF_IPC_TYPE_3, SOF_IPC_TYPE_4 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Use the new SOF_IPC_TYPE_4 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Use the new SOF_IPC_TYPE_3 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The SOF stack now uses the generic names for the IPC type, the defines can be dropped. 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>
The firmware file (and libraries for IPC4) and topology file location is different for IPC versions which works well currently but it also places constraints on file system layout changes since the default paths are wired in the kernel. IPC4 complicates this single set of paths per IPC implementations since on Intel platforms it should be possible to use reference firmware or SOF, both implementing IPC4. With the current implementation it is also problematic to implement seamless fallback to different firmware file layout for the same IPC type and to have means to use other IPC versions in case the default/requested one has not firmware file available. With the proposed firmware profile layout machine descriptors will provide two identification strings: name of the vendor (amd, imx, intel, mediatek), name of the platform (apl, tgl, rmb, imx8, mt8188, etc). From these strings the paths and firmware file name is constructed in a standardized way. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The purpose of the library is to craft the paths and firmware file name for the IPC version. After creating the paths we will try to open the default firmware image ad check it's magic number to make sure it is matching with the expected IPC type. The sof_create_default_fw_layout_profile() will try to first create the strings for the requested IPC type. If no layout profile was found for the IPC type then we will try to probe other IPC types as a fallback. 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>
…escriptors 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>
…rofile Create the default firmware layout profile based on the vendor and platform strings in descriptors and use the default profile for paths and firmware name. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
…file Create the default firmware layout profile based on the vendor and platform strings in descriptors and use the default profile for paths and firmware name. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
…ofile Create the default firmware layout profile based on the vendor and platform strings in descriptors and use the default profile for paths and firmware name. 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>
…ename 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>
…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>
|
Changes since v1:
|
168ad26 to
cbcdda8
Compare
Why is this a problem? a) the first Intel layout was defined by our colleagues with the 'firmware tester'. it is what it is. Can we please go back to the problem statement?
Edit |
kv2019i
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like @plbossart 's comments need to be addressed first. If we drop the idea of generic lookup path, I guess a minimal version of fw-file-layout.c that would just try the different IPC fw+tplg entries in order (if they are defined), would still be possible. E.g. for platforms where both IPC3 and IPC4 entries are defined, kernel would try to use IPC4 first, check fw+tplg and if available, use those, and if not, fallback to IPC3.
sound/soc/sof/imx/imx8.c
Outdated
| .ipc_default = SOF_IPC_TYPE_3, | ||
| .default_fw_path = { | ||
| [SOF_IPC] = "imx/sof", | ||
| [SOF_IPC_TYPE_3] = "imx/sof", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the PR could be kept smaller by accepting that SOF_IPC continues to be used to refer to 3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is more intuitive for the first look to have SOF_IPC_TYPE_3 than SOF_IPC
IPC4 is SOF_IPC, it is IPC type used by SOF.
| if (i == ipc_type || !(desc->ipc_supported_mask & BIT(i))) | ||
| continue; | ||
|
|
||
| ret = fw_layout_for_ipc_type(dev, i, desc, fw_path_postfix, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is the magic bit that allows to choose IPC major version based on available installed FW.
UPDATE: i.e. this would allow us to add SOF2.6 binaries to sof-bin release for distributions, and when this kernel hits a system with SOF2.6 installed, a portion of systems would move to use IPC4 and the new SOF2.6 release while older platforms would continue to use stable SOF2.2 binaries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we could change the default IPC type to IPC4 for everything in pci-tgl.c and provide only selected platform's IPC4 firmware (where we have good coverage of topologies). That would work fine.
This would also allow the possibility (if ever needed) to change the location of the SOF firmware things to
/lib/firmware/sof/< vendor >/< ipc_type >/.../
if the profile is described in kernel.
But looks like this is an overshot, so I'll try to scale it back.
ad525ae to
cbcdda8
Compare
|
Closing, completely new approach will be pushed |
Hi,
This PR contains #4301 as the first 10 patch, the new content is starting at
ASoC: SOF: pci-cnl: Correct the firmware filename for cfl and cmlCurrently we have a set of string arrays to define the default paths and firmware filename for a platform (in
struct sof_dev_desc) per IPC type - so we can have one set of strings for a given IPC type.The fact that these strings are defined in the kernel, it is posing restriction on the file placement in filesystem level and prevent backwards, forwards compatibility in case a new layout is required or decided.
IPC3 has a standardized and stable filesystem layout among all vendors and platforms:
note:
fw_path_postfix: used by Intel for community key signed binaries.IPC4 at the moment have two Intel layouts and no generic vendor neutral one. Moving these to a generic one would require interlocked update of firmware and kernel, which is realistically not a possibility in most cases.
This set proposes a solution which will allow multiple filesystem layout per IPC type, all generated and defined in core for a standardized presentation.
Device descriptions will include only a vendor name and platform name, for example:
or
The strings are going to be created by the core.
With this change the kernel can support multiple filesystem layout per IPC type and can discover the one which is deployed on the system.
We can also fall back to other IPC type in case the requested one not found on the filesystem (we can only check for the firmware image at this point).