Changing the name of the structure type is a prelude to separating
information about the elf file from the information used during creation
of a manifest.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
A new memory_alias structure containing memory address alias configurations
has been created. It was placed in the memory_config structure.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Added name_val structure representing name/value tuple. Added function
print_enum which displays the name of the enum corresponding to a given
value. Added print_flags function which display names of flags constituting
a given value.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
There was no dram_offset value in any configuration file. It also wasn't
used anywhere in the code. So the code reading it from the tolm file has
been removed.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
The man_create_modules function may return an error that was ignored. Added
check of a return value.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
cAVS 1.5, 1.8 and 2.0 are supported by Zephyr, their configurations
need alias definitions.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Now that rimage can distinguish between Zephyr and XTOS builds, we
can use memory alias specifiers with both.
This reverts commit 1e0a85b44a.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The fseek function returns -1 to signal an error. Return value was assigned
to a variable without a sign, so the error could not be detected.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Added error handling where it was missing. According to the documentation,
the fseek function returns a non-zero value on error. The conditions for
checking this value have been corrected.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Fields related to hash computing have been removed from the image
structure. Removed openssl headers from rimage.h, which made it necessary
to add some missing includes in several files.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Switched to use new hash functions. The parameter list for the rimage_sign
and rimage_verify functions has been simplified. The necessary information
is now included in the hash_context structure. In addition, code fragments
that may be common to different versions of the manifest have been
separated.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Prepared a new set of functions for computing digest with error handling.
The hash context has been placed into a separate structure. This allows
to conveniently pass the calculated digest along with its length and used
algorithm.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
The version fields in the fw_ext_man_cavs_header structure describe version
of the structure itself, not the image. The correct version number has been
set.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Modified the strtoul function parameter to automatically recognize
the value format. This will avoid the situation when a decimal value
is parsed as hexadecimal.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
A new function create_file_name has been created that prepares the name
of the output file with the given extensions. Unlike the previous solution,
it checks whether the new name will fit in the output buffer.
A new file_utils.c file has been prepared, into which generic functions to
simplify the use of files will be moved.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
A set of functions which make it easier to parse toml files has been
separated into a new file.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
In image re-signing mode or if there are no input files, the memory
allocated for heap_adsp was not released.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
The init_config is used to indicate if base config extension is
used (1) or not (0). Its default value is used if not specified
in module config, the default value for init_config should be zero
instead of one.
Signed-off-by: Chao Song <chao.song@linux.intel.com>
We don't include ROM sections into the output image. If conversion is
applied to them, they end up in the SRAM address range, which then
generates corrupted images.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
tgl.toml and tgl-h.toml are only used for xtos builds.
Suggested-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Set cached and uncached address aliases for all Intel ADSP platforms,
supported by Zephyr.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
A recent commit ec649f37d6 ("Convert all ELF addresses to cached
for calculations") had a bug: it assumed a call to
parse_uint32_hex_key() for an absent key would return an error by
default, which isn't the case. To force it set the default return
code to an error value.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use some of the reserved bits to add a new field, init_config, in struct
sof_man_module_type. This will be used to specify the type of payload
that the module expects. For now, the 2 options are to have the base
config only or the base config with an extension that contains the pin
formats. This can be extended in the future to support additional
options for modules that need more than the base config or base config +
extension.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Rimage calculates sizes of ELF sections, for which it has to use
addresses from the same address space: either all cached or all
uncached. The ELF image itself can contain mixed addresses. Convert
all to cached for internal calculations.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The load_type in extended manifest is used to indicate
if a module is a built-in module(0) or a loadable(1)
module.
We don't have loadable module yet, so load_type should
be zero for all modules.
Signed-off-by: Chao Song <chao.song@linux.intel.com>
The module_type member in module config should be assigned
according to the mod_type enum. Previously, for tgl and tgl-h,
it is assigned in an incremental way, which is wrong. MTL assigns
module_type in the correct way, so align the module_type with
mtl for tgl and tgl-h in this patch.
Signed-off-by: Chao Song <chao.song@linux.intel.com>