Skip to content

rimage: Add support to ignore detached sections#10624

Open
dbaluta wants to merge 1 commit intothesofproject:mainfrom
dbaluta:add_ignore_detached
Open

rimage: Add support to ignore detached sections#10624
dbaluta wants to merge 1 commit intothesofproject:mainfrom
dbaluta:add_ignore_detached

Conversation

@dbaluta
Copy link
Collaborator

@dbaluta dbaluta commented Mar 13, 2026

There are some non-critical data and code sections that are kept in DRAM to be accessed and executed from there without being copyind to SRAM.

Such sections are marked as detached and linked into a separate "cold.mod" module.

SOF marks sections between: SOF_MODULE_DRAM_LINK_START (0x00000000) to SOF_MODULE_DRAM_LINK_END (0x080000000) but this overalps with ITCM memory on M7 core of i.MX8MP.

Add an option to ignore marking section as detached.

Ideally in the future the dram start/end should be configured per platform.

By default the behavior is unmodified, to enable this option one would need to pass -d to rimage.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new -d CLI option to rimage to optionally skip marking ELF sections as “detached” (e.g., to avoid incorrect DRAM-range-based detachment on platforms where the DRAM link range overlaps other memories).

Changes:

  • Add -d flag and plumb it through struct image into module section parsing.
  • Extend module_parse_sections() API to accept an ignore_detached boolean.
  • Gate out_section->detached computation based on the new flag.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tools/rimage/src/rimage.c Adds -d option handling and passes the new flag into section parsing.
tools/rimage/src/module.c Updates section detachment logic to honor ignore_detached.
tools/rimage/src/include/rimage/rimage.h Adds ignore_detached field to the global image context.
tools/rimage/src/include/rimage/module.h Updates module_parse_sections() declaration to include the new parameter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dbaluta dbaluta force-pushed the add_ignore_detached branch from 0fa3427 to 7d0a655 Compare March 13, 2026 14:57
There are some non-critical data and code sections that
are kept in DRAM to be accessed and executed from there
without being copyind to SRAM.

Such sections are marked as detached and linked into a separate
"cold.mod" module.

SOF marks sections between: SOF_MODULE_DRAM_LINK_START (0x00000000) to
SOF_MODULE_DRAM_LINK_END (0x080000000) but this overalps with ITCM memory
on M7 core of i.MX8MP.

Add an option to ignore marking section as detached.

Ideally in the future the dram start/end should be configured per
platform.

By default the behavior is unmodified, to enable this option
one would need to pass `-d` to rimage.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
@dbaluta dbaluta requested a review from LaurentiuM1234 March 13, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants