External libraries can contain processing module code or common library code.
Library manager need to distinguish between both type of modules for proper loading.
Signed-off-by: Jaroslaw Stelter <jaroslaw.stelter@intel.com>
tgl-h target is missing the IPC4 toml config file, so add it.
tgl-h-cavs.toml is a direct copy from tgl-cavs.toml, only the image size
has been changed.
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Ace signing functions need guards for not to use deprecated openssl
functions and thus fail the compilation. Openssl3 implementation
needs to be done as the added stub now returns just -EINVAL.
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
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
Added new MSYS_INSTALL_DIR variable that points to MSYS2 installation
for Windows users. It is used to include POSIX native headers from
/usr/include also required openssl headers.
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Fixed warning where variable passed to fprintf was of type size_t and
fprintf expected format of long int.
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
This is especially a problem considering the -v option outputs non-ASCII
garbage which can break some automation, see issue #86
Fixes commit db40934e57 ("cavs: add support for cavs2.5 code
signing")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This patch fixes an invalid format specifier that causes a numeric value
to be interpreted as a string, resulting in an Segmentation fault.
Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
Such a global variables does not exists, so should not be declared.
It has been deprecated since:
2965908 (manifest: Remove -m option)
Signed-off-by: Trzcinski, Karol <karol.trzcinski@intel.com>
cppcheck gives errors from openssl 1.0 related code that has some old
churn and should be fixed, so fix it.
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
literals are signed by default, so shifting them 32 times is an
overflow, found via cppcheck
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
x param was removed from switch case but not from getopt. So if you use
x rimage silently fails on the switch case.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Refactor the signing and verification functions as they have a lot of
duplicated code and adding openssl 3.0 support without refactor would
make things even more messy.
1) Add common "rimage_read_key" to read the key from file.
2) Variate most important functionality based on different openssl versions:
- rimage_check_key
- rimage_set_modexp
- rimage_sign
- rimage_verify
- rimage_get_key_size
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Add function to resign already signed images. This can
be done with switch "q" as follows:
"rimage -q sof-tgl.ri -o sof-tgl-mod.ri -c tgl.toml -k key.pem"
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Fixes clang failure:
clang: error: -Wl,-EL: 'linker' input unused [-Werror,-Wunused-command-line-argument]
-EL has an effect only when using OUTPUT_FORMAT or --oformat but rimage
uses neither.
The binaries produced by ld version 2.34 are strictly identical before
and after this removal.
It is not clear why -EL was ever added. It was added to src/Makefile.am
by commit 0d33e87433 and to src/CMakeLists.txt by commit 4e3ead0096
but these commits were initial additions of the entire files and they
did not get into detail.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
From the gcc documentation:
'-Wimplicit-fallthrough'
'-Wimplicit-fallthrough' is the same as '-Wimplicit-fallthrough=3'
and '-Wno-implicit-fallthrough' is the same as
'-Wimplicit-fallthrough=0'.
clang supports only the number-less option.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
When some automation script gets some rimage flag wrong then rimage
exits and does not run at all. In such a case we want the build to fail
immediately and see the error at the bottom of the build logs and not
obscured by other, consecutive failures caused by the lack of rimage
output.
Take control of the exit code away from usage() and give it back to
main() where it belongs.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This patch removes the unnecessary and unscalable -x option.
This option aims to add an offset to the .data section of
its parent .module section. This is horrible idea because this
offset will vary depend on the compiler used. It is better and
much easier to just store only the .data section so the offset
is always 0.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This makes is more obvious when the filename is empty, which happened in
bug https://github.com/thesofproject/sof/pull/4711
Also prefix identical log statements with their different __func__
names.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
After commit 916fc2cd73ff: "config: Remove unused adsp structs"
those defines are unused.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Return value, for error case should be unified.
For those functions, default error value is UINT32_MAX.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Developer should know what is ther return value for error cases.
Improved doxydoc may be used eg. by IDE to speed-up code development.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This enum value is used only to distinguish suecreek from other
platforms, which can be done also by platform name.
Manual enumeration, in separate toml files with manual synchronization
in enum definition is quite error prone. After commit
9bf46d3: "rimage: Add support for mt8195" and
9716e10: "config: Add imx8ulp.toml" there are two different
platform with the same enum value 15 specified, which proves such a
thesis.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
After commit 2965908 "manifest: Remove -m option" those
structs are unused. ADSP configuration comes from toml
configuration files.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This patch fixes the potential overflow which may happen during
conversion of signed long. On a platforms where signed long
is only 32 bits the address which is stored in temp_s will experience
overflow.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>