Write firmware file micro version to manifest for cAVS platforms - #91
Write firmware file micro version to manifest for cAVS platforms#91mengdonglin wants to merge 1 commit into
Conversation
|
thesofproject/sof#5760 is the PR let CMake pass FW file micro version to rimage. |
SOF CMake defines SOF_MAJOR, SOF_MINOR and SOF_MICRO for 3 fields of firmware file version major.minor.micro This patch changes hotfix_version to micro_version in headers to align with SOF CMake, and adds fw_ver_micro to firmware image context. If SOF CMake passes firmware file micro version in the version string, rimage will write it to different manifest headers for cAVS platforms. If micro version isn't passed to rimage, it's 0 by default. This feature will allow sof_ri_info.py to dump entire file version from a FW binary for cAVS platforms. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
| uint32_t len; /* sizeof(Extend Manifest) in bytes */ | ||
| uint16_t version_major; /* Version of Extended Manifest structure */ | ||
| uint16_t version_minor; /* Version of Extended Manifest structure */ | ||
| uint16_t version_micro; /* Version of Extended Manifest structure */ |
There was a problem hiding this comment.
Wont this break manifest parsing on Windows ? @RanderWang can you comment.
There was a problem hiding this comment.
@lgirdwood Rander is on vacation this week. Let's wait for his comments next week. Hope I'm not breaking Windows. Thank you for raising this risk!
There was a problem hiding this comment.
Windows driver will take version_micro as num_module_entries we don't change header file used by windows, and this will result to error.
There was a problem hiding this comment.
Windows driver will take version_micro as num_module_entries we don't change header file used by windows, and this will result to error.
This only applies to the extended manifest. So I think we can skip the micro version only for cavs extended manifest.
There was a problem hiding this comment.
To avoid breaking Windows, I wrote a new PR #92 that will not change manifest header definitions but write the micro version to the unused hotfix_version field of manifest header. Can you help review the new PR#92?
| &image.fw_ver_micro); | ||
|
|
||
| if (ret != 2) { | ||
| if (ret != 2 && ret != 3) { |
There was a problem hiding this comment.
The return value of sscanf is the number of receiving arguments successfully assigned or EOF, I don't think we should allow partial assignment. the ret here must be 3 for successful condition.
There was a problem hiding this comment.
@aiChaoSONG Thanks for your comments. This is to be compatible with current SOF CMake that only passes 2 version arguments (major.minor) to rimage. If this rimage PR gets merged at first, SOF building will fail as CMake doesn't pass 3 version arguments (major.minor.micro) as rimage expects.
If SOF CMake thesofproject/sof#5760 can also be merged, I can update rimage to only support 3 version arguments.
There was a problem hiding this comment.
Even the PR get merged, it will not be used, rimage is a submodule of SOF, unless rimage is upgraded on SOF side, new changes will never be used. so it's safe.
You can check that SOF currently uses rimage@ee5c3e1, but the newest rimage commit is 05be213
There was a problem hiding this comment.
I see. Thanks! I Will update PR after Rander comments if this PR will impact Windows.
|
Close this PR and submitted a new PR #92 to address all review comments. @lgirdwood @aiChaoSONG @RanderWang |
Fix #90
SOF CMake defines SOF_MAJOR, SOF_MINOR and SOF_MICRO for 3 fields
of firmware file version major.minor.micro
This patch changes hotfix_version to micro_version in headers to align
with SOF CMake, and adds fw_ver_micro to firmware image context.
If SOF CMake passes firmware file micro version in the version string,
rimage will write it to different manifest headers for cAVS platforms.
If micro version isn't passed to rimage, it's 0 by default.
This feature will allow sof_ri_info.py to dump entire file version from
a FW binary for cAVS platforms.
There will be a SOF PR to let CMake pass FW file micro version to rimage.