Skip to content

Write firmware file micro version to manifest for cAVS platforms - #92

Merged
lgirdwood merged 1 commit into
thesofproject:mainfrom
mengdonglin:micro-version-v2
May 9, 2022
Merged

Write firmware file micro version to manifest for cAVS platforms#92
lgirdwood merged 1 commit into
thesofproject:mainfrom
mengdonglin:micro-version-v2

Conversation

@mengdonglin

Copy link
Copy Markdown
Contributor

Fix #90
This is v2 of #91

SOF CMake can extract FW file version from latest git tag and defines
SOF_MAJOR, SOF_MINOR and SOF_MICRO for 3 version fields. But rimage only
gets major and minor version from SOF CMake and writes them into the
standard firmware manifest header of cAVS platforms.

This patch make rimage also get the micro version from SOF CMake, and
write it to the unused hotfix_version field of manifest header.

This update will enable sof_ri_info.py to dump entire file version from
a FW binary for cAVS platforms. So we can check if a FW release candidate
is built from the correct git tag.

Updates from v1:

  • not change definition of any manifest headers to avoid breaking Windows.
  • rimage requires SOF CMake to pass all 3 version fields

@RanderWang RanderWang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aiChaoSONG aiChaoSONG left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I suggest two things:

  • compile sof firmware, and read the firmware with sof_ri_info tool to check if the sof_micro number is really there
  • compile sof firmware, and put it to windows to see if there is any error.

@mengdonglin

Copy link
Copy Markdown
Contributor Author

LGTM, but I suggest two things:

  • compile sof firmware, and read the firmware with sof_ri_info tool to check if the sof_micro number is really there
    Thanks for the reminder :) I've checked this. With this PR and SOF CMake update, sof_ri_info.py can show the micro version properly. Here is the test result:
    For v2.1-rc1:
    cavs0015 (ADSP Manifest) file offset 0x2300 name ADSPFW build ver 2.1.0.1 feature mask 0xffff image flags 0x0
    For v2.1.1:
    cavs0015 (ADSP Manifest) file offset 0x2300 name ADSPFW build ver 2.1.1.1 feature mask 0xffff image flags 0x0
  • compile sof firmware, and put it to windows to see if there is any error.
    I think this will need your help and confirmation from @RanderWang Thank you!

Comment thread src/rimage.c
&image.fw_ver_micro);

if (ret != 2) {
if (ret != 3) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be very useful to change the error message a bit. So when there is SOF + rimage mismatch (which will happen in some places) the build failure message is enough to immediately make the difference between an old, 2-fields rimage versus a new, 3 fields rimage. No need to go and try to guess the git versions that were used.

fprintf(stderr,
   "error: cannot parse firmware version major.minor.micro\n");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marc-hb Thank you! I updated the PR to revise the error message as you suggested. The help message for file version is also updated.

SOF CMake can extract FW file version from latest git tag and defines
SOF_MAJOR, SOF_MINOR and SOF_MICRO for 3 version fields. But rimage only
gets major and minor version from SOF CMake and writes them into the
standard firmware manifest header of cAVS platforms.

This patch make rimage also get the micro version from SOF CMake, and
write it to the unused hotfix_version field of manifest header.

This update will enable sof_ri_info.py to dump entire file version from
a FW binary for cAVS platforms. So we can check if a FW release candidate
is built from the correct git tag.

Signed-off-by: mengdonglin <mengdong.lin@intel.com>

update
@lgirdwood
lgirdwood merged commit 9d45332 into thesofproject:main May 9, 2022
@lgirdwood

Copy link
Copy Markdown
Member

@mengdonglin rimage submodule will need an update PR for sof. Thanks

@mengdonglin

Copy link
Copy Markdown
Contributor Author

@mengdonglin rimage submodule will need an update PR for sof. Thanks

@lgirdwood Thank you! I submitted PR thesofproject/sof#5791 to update rimage submodule commit for SOF. Please review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add SOF micro version to ADSP manifest header

5 participants