Commit Graph

46 Commits

Author SHA1 Message Date
Marc Herbert ea1b65dae4 sof_ri_info: fix "full_bytes" comment in the source
Zero functional change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-03-04 12:04:28 +02:00
Marc Herbert 2d405d70a7 sof_ri_info: add MTL production key
Extracted from v2.8 v2.8.x/sof-ipc4-v2.8/mtl/intel-signed/sof-mtl.ri

Verified on v2.8.1 https://github.com/thesofproject/sof-bin/pull/162

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-03-04 12:04:28 +02:00
Yong Zhi 40f6de58da sof_ri_info: fix imr size for cnl
Fix the typo for 8MB imr size.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2024-01-17 11:57:45 +02:00
Peter Ujfalusi a951579bb2 sof_ri_info: Decode the Signed package info extension
Print out some information from the Signed package info extension, the most
important information being is the partition_usage which is used to select
key slot to be used for verification.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-10-25 20:39:47 +03:00
Kai Vehmanen afb2d913ca sof_ri_info: add ADL-N product key information
Add ability to recognize the ADL-N product key.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-04-04 14:56:04 +03:00
Marc Herbert 367df306b6 sof_ri_info: minor BinReader logging fix to support pathlib
Switch to an f-string which automatically converts the argument to a
string.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-24 16:15:12 +01:00
Marc Herbert 5a30534aab sof_ri_info: add platform aliases to DSP_MEM_SPACE_EXT
Fixes this error:
```
No platform found in name "sof-rpl.ri"; unknown memory layout.
```

... and shows the Memory Layout.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-17 16:38:38 +03:00
Marc Herbert 1e4236be68 tools: make sof_ri_info.py a usable library that can be imported
2 small changes required:

- Stop calling sys.exit(1) in case of error not to exit the importer
- Change EraseVars() to return the checksum value instead of printing
  it. Move the print() to the main() function

This is required by the new sof-bin tests that compare signed with
unsigned binaries; submitted in
https://github.com/thesofproject/sof-bin/pull/105

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-11 13:34:01 +03:00
Marc Herbert 5dfaf0bf80 sof_ri_info: memory layout: find 'tgl' in ___/build_tgl_xcc/sof.ri
Extend the search for the platform code in directory names when there is
no sof-tgl.ri match.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-07-07 11:53:11 +01:00
Marc Herbert 0f365400eb sof_ri_info: explain why memory layout is empty
It was not obvious at all that the expected memory layout is inferred
from the filename.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-07-07 11:53:11 +01:00
Dirk Su d2a3ec2273 sof_ri_info: add ADL Intel prod key to list of known keys
Extracted from
https://github.com/thesofproject/sof-bin/blob/main/v1.9.x/sof-v1.9.2/intel-signed/sof-adl.ri

Signed-off-by: Dirk Su <dirk.su@canonical.com>
2021-12-14 10:38:18 +00:00
Marc Herbert 7aa1b28070 sof_ri_info: assert Python version is 3.6 or above.
As reported by Bartosz, Python 3.5.2 fails with the relatively cryptic
TypeError: invalid file: PosixPath('sof-tgl.ri'). Make this failure much
less cryptic.

As of December 2021 Python 3.5 is completely out of support and 3.6 will
be soon https://www.python.org/downloads/

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-12-08 20:45:07 +00:00
Marc Herbert 2c208b52fb sof_ri_info: add JSL Intel prod key to list of known keys
Extracted from
https://github.com/thesofproject/sof-bin/blob/main/v1.9.x/sof-v1.9.2/intel-signed/sof-jsl.ri

Note previous sof-jsl.ri releases were signed with the ICL key:
https://github.com/thesofproject/sof/issues/4916

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-11-21 22:38:23 +00:00
Marc Herbert e14ec39124 sof_ri_info: change "Other" to "Unknown key"
Now grepping for 'key' always works.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-11-21 22:38:23 +00:00
Marc Herbert f8ca8536fd sof_ri_info: add new --erase_vars feature for reproducible builds
sof_ri_info.py  --erase_vars reproducible.ri sof.ri

replaces variable fields (signature and date right now) by constants.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert d9b7d9f6eb sof_ri_info: new attributes signature and date start and length
Signature and date are (for now) the only variable fields when
re-signing with the same tool so their locations matter.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert a43cf1aff0 sof_ri_info: pylint: disable=invalid-name, missing-function-docstring
Add:

... to reduce pylint warnings to a usable amount.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert 85aa873198 sof_ri_info: minor reader.info() additions and tweaks
These changes are visible only in -v mode.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert 31b3a39202 sof_ri_info: print error messages on stderr
stderr is often highlighted with a different color.
This also makes the usual >/dev/null redirection possible.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert 2dbec9f2b2 sof_ri_info: show file offsets for most components + some lengths
File offsets were critical in finding the serious begin_off bug fixed in
the same series. The information is already there so just show it.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert 06187791d7 sof_ri_info: fix adsp_mft_cse_entry.entry_file_offset
Fixes the adsp_mft_cse_entry Component added by
commit 8885b465df ("tools: sof-ri-info: move parsing adsp mft outside
cse mft").

`adsp_mft_cse_entry.entry_file_offset` did not account for the extended
manifest.

Also fix the large `reader.ext_mft_length + entry_offset`
copy/paste/diverge

That variable did not seem to be used anywhere yet but it's wrong value
was confusing and time-consuming when debugging.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert c66e26a9cf sof_ri_info: fix wrong begin_off in parse_mft_extension()
This broke parsing any extension past the first one.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Pan Xiuli a571fdb8e9 tools: sof_ri_info: add EHL support
Add EHL prod key
Add EHL memory layout

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2021-01-12 22:16:44 +00:00
Pan Xiuli 06d126f8f4 tools: sof_ri_info: update TGL memory layout
change old TGL to TGL-LP, add new TGL-H

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2021-01-12 22:16:44 +00:00
Pan Xiuli 0767ffaf85 tools: sof_ri_info: fix memory layout match
For sof-tgl.ri and sof-tgl-h.ri the old match function will
always return tgl layout. Add suffix in match to make sure
we always match the right name.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2021-01-12 22:16:44 +00:00
Pan Xiuli 586caa79f5 tools: sof_ri_info: add new community key for TGL+ platforms
Add the 3K community key for TGL+ platforms.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2021-01-12 22:16:44 +00:00
Pan Xiuli 5ebf036d01 tools: sof_ri_info: update the full_bytes usage
make the full_bytes can output bytes in format we need in
KNOWN_KEYS

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2021-01-12 22:16:44 +00:00
Yong Zhi d9ce1cb48f tools: sof-ri-info: define memory layout for JSL platform
Add jsl entry to DSP_MEM_SPACE_EXT[].

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2020-09-30 10:44:45 +01:00
Kai-Chuan Hsieh 8675d4cb9f tools: add TGL key signature to sof_ri_info
Provide output info if evaluated FW image was signed with
TGL production key.

Signed-off-by: Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com>
2020-07-16 13:39:45 +01:00
Marcin Maka caae629f79 tools: sof-ri-info: make cse mft parsing optional
It is a special --no_cse mode useful in case the cse part is
unparsable for any reason. Cse manifest parsing is skipped and
Adsp part is parsed only.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka 58e244ee88 tools: sof-ri-info: add more verbose info about parsing progress
Running with -v option now gives more information about
the parsing progress which makes debug easier.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka a28525b23b tools: sof-ri-info: fix css mft parsing for bin with ext mft
CSS Manifest header must be created with file offset adjusted
by extended manifest size to loop through extensions correctly.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka 3f39319549 tools: sof-ri-info: remove trailing zeroes from strings
Strings are padded with zeroes in the binary input file,
so rstrip used after decode removes them, otherwise such
a string cuts the output if inserted as argument in the
middle.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka 5c3d0225a9 tools: sof-ri-info: display memory map
Information about modules memory occupation is displayed
when memory layout of the target platform is known
(determined by the fw binary name).

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka ebf381658f tools: sof-ri-info: compact layout of module entry info
More compact output is better for binaries containing
many module entries.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka ec13b0828f tools: sof-ri-info: add modules only mode
Additional parameters added:

no_modules - works like previous 'headers' option where
modules are excluded from output

no_headers - excludes cse manifest headers from output
and dumps info about the adsp modules only

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka 8885b465df tools: sof-ri-info: move parsing adsp mft outside cse mft
There might be binaries where cse mft is not included.
And adsp mft begins at std offset 0x2000 from the optional
extended manifest.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka dcefb7f753 tools: sof-ri-info: log via info method only
All logging dispatched via Reader info method is more
consistent and better controlable.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka 4b7523c8c9 tools: sof-ri-info: use colors for terminal output only
Do not use colors if stdout is not a tty.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Karol Trzcinski 4b8593322e tools: ext_manifest: Read manifest from sof_ri_info script
This tool must be able to read extended manifest content
and move to next manifest in proper way.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-21 20:36:14 +01:00
Karol Trzcinski 24ecd41e29 tools: Reformat extended manifest parsing
After reformat it will be easier to add new data of supported
extended manifest.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-21 20:36:14 +01:00
Janusz Jankowski d7ad0c134d tools: sof_ri_info: make executable
Script is meant to be used as standalone tool,
so it should have executable file attribute.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-04-02 20:51:37 +01:00
Lech Betlej aea593b128 tools: add community key signature to sof_ri_info
A public key signature of community key used to sign FW
binaries is added. The script can provide on output info if
evaluated FW image was signed with the key.

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2019-12-20 17:07:07 +01:00
Marcin Maka 3aa7b21a2b tools: sof_ri_info: display fw extension parameters
Detailed information from Platform Fx Extension, part
of the manifest may be useful for a deeper signed image
analysis.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-12-20 11:47:14 +01:00
Lech Betlej 98d7ab2162 tools: add APL key signature to sof_ri_info
A public key signature of Intel production key used to sign APL
binaries is added. The script can provide on output info if
evaluated FW image was signed with the key.

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2019-12-10 11:51:03 +01:00
Marcin Maka 99d397b1ec tools: add sof-ri-info to print fw image manifests content
This script parses manifests included in sof binary and prints
extracted metadata in readable form.

It is particularly useful to get information about image signature
parameters.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-12-04 13:04:12 +01:00