From 6948fba9e527f5fdca48c2504fb2d16c108059ea Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Wed, 8 Feb 2023 10:02:55 -0800 Subject: [PATCH 1/3] 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 --- src/adsp_config.c | 5 +++++ src/include/rimage/sof/user/manifest.h | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 7f7fccb..e52231b 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -2193,6 +2193,11 @@ static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx, if (ret < 0) return err_key_parse("load_type", NULL); + mod_man->type.init_config = parse_uint32_hex_key(mod_entry, &ctx_entry, + "init_config", 1, &ret); + if (ret < 0) + return err_key_parse("init_config", NULL); + mod_man->type.auto_start = parse_uint32_hex_key(mod_entry, &ctx_entry, "auto_start", 1, &ret); if (ret < 0) diff --git a/src/include/rimage/sof/user/manifest.h b/src/include/rimage/sof/user/manifest.h index 9d410ca..e49a76f 100644 --- a/src/include/rimage/sof/user/manifest.h +++ b/src/include/rimage/sof/user/manifest.h @@ -26,13 +26,18 @@ #define SOF_MAN_MOD_TYPE_BUILTIN 0 #define SOF_MAN_MOD_TYPE_MODULE 1 +/* module init config */ +#define SOF_MAN_MOD_INIT_CONFIG_BASE_CFG 0 /* Base config only */ +#define SOF_MAN_MOD_INIT_CONFIG_BASE_CFG_WITH_EXT 1 /* Base config with extension */ + struct sof_man_module_type { uint32_t load_type:4; /* SOF_MAN_MOD_TYPE_ */ uint32_t auto_start:1; uint32_t domain_ll:1; uint32_t domain_dp:1; uint32_t lib_code:1; - uint32_t rsvd_:24; + uint32_t init_config:4; /* SOF_MAN_MOD_INIT_CONFIG_ */ + uint32_t rsvd_:20; }; /* segment flags.type */ From c1c04f1dc07f85f466dcd8c7473b69814cd9872d Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Wed, 8 Feb 2023 10:05:51 -0800 Subject: [PATCH 2/3] config: tgl-cavs: set init_config for smart test Smart amp needs the base config extension during init. Signed-off-by: Ranjani Sridharan --- config/tgl-cavs.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 6fcac3d..cacd83d 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -276,6 +276,7 @@ count = 12 domain_types = "0" load_type = "0" module_type = "13" + init_config = "1" auto_start = "0" sched_caps = [1, 0x00008000] From 587603e5e4f8f59a24d6a4d67595d991dc2317db Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Wed, 8 Feb 2023 10:06:49 -0800 Subject: [PATCH 3/3] config: mtl: Set init_config for smart amp Smart amp needs the base config extension during module init. Signed-off-by: Ranjani Sridharan --- config/mtl.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/mtl.toml b/config/mtl.toml index a805159..758f6f3 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -402,6 +402,7 @@ count = 16 instance_count = "1" domain_types = "0" load_type = "0" + init_config = "1" module_type = "13" auto_start = "0" sched_caps = [1, 0x00008000]