Skip to content

Commit

Permalink
build: add a Kconfig option for building cold module manifests
Browse files Browse the repository at this point in the history
To execute a non-performance critical part of SOF code base in DRAM
we create an additional "cold" module, that will stay in DRAM next to
the boot module. This patch only adds a Kconfig option and module
manifests in TOML.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
  • Loading branch information
lyakh authored and kv2019i committed Jan 9, 2025
1 parent c1df459 commit 638e59c
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
8 changes: 8 additions & 0 deletions Kconfig.sof
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ config COMPILER_INLINE_FUNCTION_OPTION
help
When enabled, -fno-inline-function option is not passed to compiler

config COLD_STORE_EXECUTE_DRAM
bool "Execute and use cold data and code in DRAM"
help
Non-performance critical data and code can be kept in DRAM to be
accessed and executed there without copying to SRAM. Select this
option to enable this feature to save SRAM and to speed up SRAM
copying of performance-critical data and code.

rsource "src/Kconfig"

# See zephyr/modules/Kconfig
Expand Down
4 changes: 2 additions & 2 deletions src/ipc/ipc4/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,9 +966,9 @@ const struct comp_driver *ipc4_get_comp_drv(uint32_t module_id)
uint32_t lib_idx = LIB_MANAGER_GET_LIB_ID(module_id);

if (lib_idx == 0) {
/* module_id 0 is used for base fw which is in entry 1 */
/* module_id 0 is used for base fw which is in entry 1 or 2 */
if (!module_id)
entry_index = 1;
entry_index = 1 + IS_ENABLED(CONFIG_COLD_STORE_EXECUTE_DRAM);
else
entry_index = module_id;

Expand Down
14 changes: 14 additions & 0 deletions tools/rimage/config/lnl.toml.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@

index = __COUNTER__

#if CONFIG_COLD_STORE_EXECUTE_DRAM
[[module.entry]]
name = "COLD"
uuid = "D406D134-C3C1-402C-8AEC-6821C0C2B0E6"
affinity_mask = "3"
instance_count = "1"
domain_types = "0"
load_type = "0"
module_type = "0"
auto_start = "0"

index = __COUNTER__
#endif

[[module.entry]]
name = "BASEFW"
uuid = "0E398C32-5ADE-BA4B-93B1-C50432280EE4"
Expand Down
14 changes: 14 additions & 0 deletions tools/rimage/config/mtl.toml.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@

index = __COUNTER__

#if CONFIG_COLD_STORE_EXECUTE_DRAM
[[module.entry]]
name = "COLD"
uuid = "D406D134-C3C1-402C-8AEC-6821C0C2B0E6"
affinity_mask = "3"
instance_count = "1"
domain_types = "0"
load_type = "0"
module_type = "0"
auto_start = "0"

index = __COUNTER__
#endif

[[module.entry]]
name = "BASEFW"
uuid = "0E398C32-5ADE-BA4B-93B1-C50432280EE4"
Expand Down
14 changes: 14 additions & 0 deletions tools/rimage/config/ptl.toml.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ auto_start = "0"

index = __COUNTER__

#if CONFIG_COLD_STORE_EXECUTE_DRAM
[[module.entry]]
name = "COLD"
uuid = "D406D134-C3C1-402C-8AEC-6821C0C2B0E6"
affinity_mask = "3"
instance_count = "1"
domain_types = "0"
load_type = "0"
module_type = "0"
auto_start = "0"

index = __COUNTER__
#endif

[[module.entry]]
name = "BASEFW"
uuid = "0E398C32-5ADE-BA4B-93B1-C50432280EE4"
Expand Down

0 comments on commit 638e59c

Please sign in to comment.