some sections may use different lma than vma address,
in such case rimage needs to use lma
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
Sometimes they will be different and this will make developer
aware of the differences
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
Try to build extended manifest only when `e` flag will be set,
to prevent error and warning printing during creating optional
part of formware image.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
elf_read_section() returns section size when everything is ok,
so ret value should be reset to 0 after this function call
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Such a solution improve code hermentization and flexibility.
Also such a solution is more relevant because of focus on particular
module during section reading, so there won't be possibility to
implicity scan section 'A' from first module and section 'B' from
second one.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This name is used in different part of source code so should refer
to single place instead by copied.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Extended manifest is a place to store metadata about firmware, known during
compilation time - for example firmware version or used compiler.
Given information are read on host side before firmware startup.
This part of output binary is not signed.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
In many functions there is need to read user section content
and check firmware version or write section content to some
manifest or dictionary. Previously to do it, in each function
was loop to search for proper section in proper module,
then allocate buffer, read content and check for possible error
between each step what is quite overwhelming. After change there
will be one function responsible for this task.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Fixes issue ".init_array" is not copied to ri image making it zero
filled. This causes Zephyr crashing trying to execute functions from
this section.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Fixes following error when compiling code:
...
src/elf.c: In function ‘elf_find_section’:
src/elf.c:469:20: error: initialization discards ‘const’ qualifier
from pointer target type [-Werror=discarded-qualifiers]
469 | Elf32_Ehdr *hdr = &module->hdr;
| ^
cc1: all warnings being treated as errors
...
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This changes the LICENSE file to match the LICENSE file
from the main SOF repo, except they entries for the kconfig
scripts which are not here in this repo.
Signed-off-by: Daniel Leung <danielcp@gmail.com>
Code formatting should be consistent and function arguments
should be aligned to opening parenthesis.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Since both fw.h and manifest.h are being used in the main SOF
repo and also here in the standalone rimage repo, to prevent
them getting out of sync, the SOF main repo is going to use
the ones coming from the rimage repo. So there is no need for
the option anymore.
Signed-off-by: Daniel Leung <danielcp@gmail.com>
This adds the necessary bits to allow building rimage
with CMake with similar configure options as the just
removed autotools files.
Also update README.md for new build instructions.
Signed-off-by: Daniel Leung <danielcp@gmail.com>
CMake is to be used instead of autotools. So remove the autotools
files.
This revert commit f6bf4b0d72 and
commit 0d33e87433
Signed-off-by: Daniel Leung <danielcp@gmail.com>
i.MX8X is very similar with i.MX8. Memory layout is the same
except IRQSTEER address.
Code will be shared but there will be different firmware binaries
named:
* sof-imx8.ri, for i.MX8
* sof-imx8x.ri, for i.MX8X
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This adds the files created after running `autoreconf -i`.
This allows the project to be 'configure'-d and built.
Signed-off-by: Daniel Leung <danielcp@gmail.com>
Since rimage is no longer built with the SOF code, the firmware
version (SOF_MAJOR and SOF_MINOR) and build ID (SOF_BUILD) are
no longer defined during build. So these needs to be passed as
command line arguments.
Signed-off-by: Daniel Leung <danielcp@gmail.com>
This removes the macro PEM_KEY_PREFIX and make rimage to always
require key to be specified in command line.
Signed-off-by: Daniel Leung <danielcp@gmail.com>
The #define in version.h will be passed as command line
argument instead, as the tool has to build on its own.
Signed-off-by: Daniel Leung <danielcp@gmail.com>
This renames the rimage directory to "src". This also moves
the header files into src/include/rimage. This is in
preparation to allow rimage to be built outside of SOF tree,
and it requires some SOF header files. Moving headers under
src/include/rimage makes it obvious that these headers are
for rimage.
Signed-off-by: Daniel Leung <danielcp@gmail.com>
We are going to have more hashing function,
so they should be named after hashing algorithms.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
New version of manifest introduced with TGL platform
uses SHA384 for component hash.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
This argument is needed in case of platforms that have different
modules padding in xcc binaries.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Thats because this function is used also to find optional sections so it will be decided later (outside of this func) if this is actually error
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
Thats because this section is optional in FW, it will be created only with TRACE enabled
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
In case of multiple modules, rimage should not expect these sections
in bootloader module: .bss, .static_log_entries .fw_ready.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>