Commit Graph

321 Commits

Author SHA1 Message Date
Ranjani Sridharan 1e0a85b44a config:tgl/tglh: Do not set cached/uncached address aliases
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>
2023-02-10 19:00:14 +02:00
Guennadi Liakhovetski 9b507ecc82 config: set cached and uncached aliases for affected platforms
Set cached and uncached address aliases for all Intel ADSP platforms,
supported by Zephyr.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-02-10 15:06:15 +00:00
Guennadi Liakhovetski def9d51d7d Fix regression - make default return code an error
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>
2023-02-10 15:06:15 +00:00
Ranjani Sridharan d48ae7aada config: mtl: Set init_config for smart amp
Smart amp needs the base config extension during module init.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-02-09 12:06:52 +00:00
Ranjani Sridharan b5d762290f config: tgl-cavs: set init_config for smart test
Smart amp needs the base config extension during init.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-02-09 12:06:52 +00:00
Ranjani Sridharan 15ea48177a src: adsp_config: Use reserved bits for module init config
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>
2023-02-09 12:06:52 +00:00
Guennadi Liakhovetski ec649f37d6 Convert all ELF addresses to cached for calculations
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>
2023-02-09 12:03:58 +00:00
Chao Song 7bc3cfc946 config: mtl: add smart amp test module config
This patch adds smart amp test module config for mtl.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-02-01 14:50:59 +02:00
Chao Song 3da7739b5f config: correct module config load_type
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>
2023-02-01 14:50:14 +02:00
Chao Song bc7d49dcfc config: align module_type with mtl for tgl and tgl-h
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>
2023-02-01 14:50:14 +02:00
Jaska Uimonen bdf48ee7e6 config: tgl-cavs: add fir and iir eq module config
This patch adds module config for fir and iir eq module.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2023-01-24 15:37:41 +00:00
Guennadi Liakhovetski ba8534bb23 Fix bitmap according to the IMR type
When the IMR type is set to 4, the default bitmap field #4 must be
0x10.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-04 11:07:30 +00:00
Guennadi Liakhovetski f3eef3cfb6 Fix IMR type parsing
The IMR type can be specified either in the TOML configuration file
or on the command line. The command line value should override the
one from the configuration file. But the current code overwrites the
configuration file value with the default value even if no value has
been specified on the command line, which is wrong. Fix this by using
the default value when reading the configuration file and only
overwriting it when the respective command line parameter is used.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-04 11:07:30 +00:00
Guennadi Liakhovetski bdba8259fe Add a command line option to set an Intel-specific PV bit
Add a '-p' command line flag to set Intel reserved bit in IMR area.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-04 11:07:30 +00:00
Chao Song 1c48208850 config: tgl-cavs: add smart amp test module config
This patch adds module config for smart amp test module.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2022-12-21 14:59:50 +00:00
Tinghan Shen 082b6261c9 config: Add mt8188.toml
Add mt8188.toml to support sof-mt8188.ri binary build.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
2022-12-15 11:48:52 +08:00
Gongjun Song 65f345a52e rimage: add src support
Add src's params to rimage

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
2022-11-25 14:56:53 +00:00
Rander Wang fe5b959adb rimage: correct module type
Currently some module types are incorrect and it was set by the change
sequence. The module type is used by windows driver not Linux driver.
It is defined in the following enum definition in cavs_ext_manifest.h.

UpDwMix module type is 5, Mux is 6 kpb is 11, and Selector is 12. The
module ASRC, GAIN, PROBE are type of efx (9) according to spec.

enum mod_type {
        ebasefw = 0,
        emixin,
        emixout,
        ecopier,
        epeakvol,
        eupdwmix,
        emux,
        esrc,
        ewov,
        efx,
        eaec,
        ekpb,
        emicselect,
        efxf,   /*i.e.SmartAmp */
        eaudclass,
        efakecopier,
        eiodriver,
        ewhm,
        egdbstub,
        esensing,
        emax,
        einvalid = emax
} ;

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-11-22 16:39:04 +01:00
Rander Wang f51ff46635 rimage: remove incorrect module order check
The original check for "i - 1 == type" is used to make
sure that all modules in toml file are in order from 0
to max continuously. But the problem is that some modules
are not supported now or some modules share the same module
type of efx, so this check is incorrect.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-11-22 16:39:04 +01:00
Ievgen Ganakov 6623073ca8 config: mtl: add kpb module
Add KPB module config

Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
2022-11-08 09:25:12 +00:00
Ievgen Ganakov 85a2d1ebc9 config: mtl: add kd module
Add KD module config

Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
2022-11-08 09:25:12 +00:00
Kwasowiec, Fabiola 3ee717eebc probe: mtl.toml invaliv probe type
error: invalid type 16error: key 'module' parsing error
probe module type is 10,which is treated hexally

Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
2022-10-13 15:26:46 +02:00
Kwasowiec, Fabiola 1f4a36e21f mux: fix module type
error: invalid type /error: key 'module' parsing error

Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
2022-10-13 14:51:27 +02:00
Kwasowiec, Fabiola dcfd11bc4d mux: add mux cfg to list of modules
No mux in the manifest

Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
2022-10-10 16:19:43 +02:00
Jaska Uimonen d957e0368b rimage: make ace15 signing to support openssl3
Ace signing is currently missing openssl3 support, so let's add it.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2022-09-28 12:16:15 +01:00
Damian Nikodem a1b6e6db33 manifest: add fw_ver_micro to manifest
Pass fw_ver_micro value to manifest.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2022-09-09 14:52:33 +01:00
Adrian Bonislawski fb28357912 config: mtl: add probe module
Add probe module to mtl config

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-08-30 11:19:44 +01:00
Adrian Bonislawski 542924d70c config: tgl-h-cavs: add probe module
Add probe module to tgl-h-cavs config

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-08-30 11:19:44 +01:00
Adrian Bonislawski 5b076f1738 config: tgl-cavs: add probe module
Add probe module to tgl-cavs config

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-08-30 11:19:44 +01:00
Arsen Eloglian 6b4848e25d mtl: Add UPDWMIX module to the manifest
Added Up Down Mixer module to config/mtl.toml
Increased modules count.

Signed-off-by: Arsen Eloglian <ArsenX.Eloglian@intel.com>
2022-08-11 14:12:40 +02:00
Dobrowolski, PawelX d50aefcb63 manifest max size for loadable modules
Library manager during loading modules needs manifest max size

Signed-off-by: Dobrowolski, PawelX <pawelx.dobrowolski@intel.com>
2022-07-20 20:45:55 +01:00
Rander Wang d94cfc9cc6 mtl: add MicSel support
Add MicSel config int mtl.toml

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-07-01 09:52:10 +01:00
jxstelter 5504179137 Add lib_code module type.
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>
2022-06-28 11:09:17 +01:00
Jaska Uimonen 12bb327122 toml: add tgl-h config file for IPC4
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>
2022-06-24 10:49:02 +01:00
Krzysztof Frydryk 452847ddc0 mtl: Add SRC module to the manifest
Added SRC module to config/mtl.toml.

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2022-06-21 13:28:50 +01:00
Jaska Uimonen 02abc5d342 rimage: ace signing functions need openssl 3.0 guards
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>
2022-06-17 10:13:37 +01:00
Jaska Uimonen 73a9d7c897 rimage: fix openssl 3.0 support in ver25 signing
Fix a misunderstanding with openssl APIs and don't "double sign" the
binary.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2022-06-17 10:13:37 +01:00
Krzysztof Frydryk 8ba3d17296 adsp_config: fix name parsing error in parse_signed_pkg_ace_v1_5
Fix name parsing error in parse_signed_pkg_ace_v1_5

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2022-05-26 14:37:38 +01:00
Adrian Warecki fe4dcaa62c mtl: Add ASRC module to the manifest
Added ASRC module to config/mtl.toml

Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
2022-05-26 14:37:38 +01:00
Marcin Szkudlinski af947cb63d config: Add toml config for mtl
This patch will add mtl support

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-05-26 14:37:38 +01:00
bkolodzi c484d99abf rimage: add ACE V1.5 handling
Add ACE 1.5 set of functions to support v3.0 manifest

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2022-05-26 14:37:38 +01:00
Balakishorepati 1b233f68bd config: add rmb toml file to support rembrandt build
Add rmb toml file to support sof-rmb.ri binary build

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
2022-05-23 09:55:32 +01:00
mengdonglin 9d453321f8 Write firmware file micro version to manifest for cAVS platforms
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
2022-05-09 10:07:56 +01:00
Tinghan Shen 05be213d46 config: Add mt8186.toml
Add mt8186.toml to support sof-mt8186.ri binary build

Signed-off-by: Allen-KH Cheng <Allen-KH.Cheng@mediatek.com>
Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
2022-02-08 10:57:59 +00:00
Andrey Borisovich ee5c3e1deb Added handling of OpenSSL on Windows with MSYS2
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>
2022-02-02 10:13:25 +00:00
Andrey Borisovich 1589641903 Fixed warning of wrong variable type in fprintf
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>
2022-02-02 10:13:25 +00:00
Marc Herbert d0062122a8 Fix confusion in headers between uint8_t arrays and strings
Strings are null terminated, byte arrays not always.

Fixes garbage in debug output issue #86

Add new parse_printable_key() function that takes a uint8_t * argument
instead of char *. Casting the argument on almost every call was a clear
indication of the problem.

Add new DUMP_PRINTABLE_BYTES() to printf uint8_t arrays _and_ their
_optional_ padding.

No change to the .ri output, bit for bit identical.

Here's an example of how the -v output is fixed:

```diff
    mem_zone.host_offset: 0x0

 cse
-         partition_name: 'ADSPADSP.man'
+         partition_name: ADSP
          header_version: 1
           entry_version: 1
              nb_entries: 3
-             entry.name: 'ADSP.man'
+             entry.name: ADSP.man\x00\x00\x00\x00
            entry.offset: 0x58
            entry.length: 0x378
-             entry.name: 'cavs0015.met'
+             entry.name: cavs0015.met
            entry.offset: 0x400
            entry.length: 0x60
-             entry.name: 'cavs0015'
+             entry.name: cavs0015\x00\x00\x00\x00
            entry.offset: 0x480
            entry.length: 0x0

@@ -140,7 +132,7 @@
           exponent_size: 1

 signed_pkg
-                   name: 'ADSP'
+                   name: ADSP
                     vcn: 0
                     svn: 0
                 fw_type: 0
@@ -161,17 +153,17 @@
                  bitmap: 0
                  bitmap: 0
                  bitmap: 0
-              meta.name: 'cavs0015.met^C^B '
+              meta.name: cavs0015.met
               meta.type: 0x3
          meta.hash_algo: 0x2
          meta.hash_size: 0x20
          meta.meta_size: 96

 partition_info
-                   name: 'ADSP'
+                   name: ADSP
            part_version: 0x10000000
             instance_id: 1
-            module.name: 'cavs0015.met^C'
+            module.name: cavs0015.met
        module.meta_size: 0x60
             module.type: 0x3

@@ -186,7 +178,7 @@

 fw_desc.header
               header_id: '$AM1'
-                   name: 'ADSPFW'
+                   name: ADSPFW\x00\x00
      preload_page_count: 0
          fw_image_flags: 0x0
            feature_mask: 0xffff
```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-31 13:18:23 +00:00
Marc Herbert d855fbfe7c Remove unconditional "(1 || verbose)" debug hack in cavs25
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>
2022-01-31 13:18:23 +00:00
Andrey Borisovich ecb6a66932 Update to C99 standard to match SOF. Silenced warning generated by newest GCC compiler related to int cast of char typed values that may result in negative values. Syntax fix in linkage of crypto library to more generic approach. 2022-01-21 17:29:24 +00:00
Adrian Warecki ce69d7bad8 adsp_config: fix invalid format specifier
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>
2022-01-17 16:33:43 +00:00