Skip to content

Add SOF support for M7 core on NXP i.MX8MP#10556

Draft
dbaluta wants to merge 6 commits intothesofproject:mainfrom
dbaluta:m7_sof
Draft

Add SOF support for M7 core on NXP i.MX8MP#10556
dbaluta wants to merge 6 commits intothesofproject:mainfrom
dbaluta:m7_sof

Conversation

@dbaluta
Copy link
Collaborator

@dbaluta dbaluta commented Feb 19, 2026

This patchseries enables SOF support on M7 core of i.MX8MP. Note that on i.MX8MP there is an HIFI4 core which is already supported with SOF.

This depends on Zephyr PR: zephyrproject-rtos/zephyr#104250

This adds platform files necessary to run SOF
on CM7 core of i.MX8MP.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Add configuration option to support build for i.MX8MP CM7 core.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This includes required sources in order to build imx8mp cm7
support.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Similar with support for imx8mp adsp, the cm7 instance uses
sdma3 and HOST_DMA.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This enables host_dma, sdma3 and sai3 nodes and their respective
drivers.

Also, we enable CONFIG_ROMSTART_RELOCATION_ROM option in order to put
romstart section into ITCM (because M7 gets its first instruction at
adress 0 in ITCM).

Note that we temporarily disable COMP_ASRC because there is a conflict
between NXP HAL and SOF ASRC headers.

e.g NXP HAL defines:

 #define ASRC ((ASRC_Type *)ASRC_BASE)

and ASRC modules uses:

 #if SOF_USE_MIN_HIFI(5, ASRC)

which results in a compilation error.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This builds SOF binary firmware for M7 core on i.MX8MP.
Resulted firmware name is: sof-imx8m_cm7.ri

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Copilot AI review requested due to automatic review settings February 19, 2026 09:24
@dbaluta dbaluta marked this pull request as draft February 19, 2026 09:24
Copy link

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

This pull request adds SOF (Sound Open Firmware) support for the M7 core on the NXP i.MX8MP platform. The i.MX8MP has both an HIFI4 DSP core (already supported) and an M7 core, and this PR enables SOF on the M7 core. The implementation follows a similar pattern to the existing imx95 M7 platform support.

Changes:

  • Add platform-specific implementation for imx8m_cm7 (platform.c, clock configuration, header files)
  • Extend DMA configuration to support both MIMX8ML8_ADSP and MIMX8ML8_M7
  • Add build configuration, board overlay/conf files, and rimage configuration for the new platform

Reviewed changes

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

Show a summary per file
File Description
zephyr/lib/dma.c Extended DMA configuration conditional to include M7 core
zephyr/CMakeLists.txt Added build configuration for imx8m_cm7 platform
tools/rimage/config/imx8m_cm7.toml Added rimage configuration defining memory zones
src/platform/imx8m_cm7/platform.c New platform initialization code for M7 core
src/platform/imx8m_cm7/linker/data-sections.ld Linker script for firmware metadata section
src/platform/imx8m_cm7/lib/clk.c Clock configuration implementation
src/platform/imx8m_cm7/include/platform/trace/trace.h Platform trace header (placeholder)
src/platform/imx8m_cm7/include/platform/platform.h Platform configuration defines
src/platform/imx8m_cm7/include/platform/lib/memory.h Memory layout and configuration
src/platform/imx8m_cm7/include/platform/lib/mailbox.h Mailbox region definitions
src/platform/imx8m_cm7/include/platform/lib/dma.h DMA header (placeholder)
src/platform/imx8m_cm7/include/platform/lib/clk.h Clock configuration header
src/platform/Kconfig Added IMX8M_CM7 Kconfig option
scripts/xtensa-build-zephyr.py Added imx8m_cm7 platform configuration
app/boards/imx8mp_evk_mimx8ml8_m7_ddr.overlay Device tree overlay for board configuration
app/boards/imx8mp_evk_mimx8ml8_m7_ddr.conf Board-specific configuration options

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

{
KEEP (*(*.fw_metadata))
. = ALIGN(16);
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The .fw_metadata section should use GROUP_ROM_LINK_IN instead of GROUP_DATA_LINK_IN. The fw_metadata (windows variable in platform.c) is declared as const, indicating it's read-only data that should be placed in ROM. The imx95 platform uses GROUP_ROM_LINK_IN for the same purpose, which is the correct approach for read-only metadata.

Suggested change
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
} GROUP_ROM_LINK_IN(ROMABLE_REGION)

Copilot uses AI. Check for mistakes.
static const struct freq_table platform_cpu_freq[] = {
{
.freq = CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC,
.ticks_per_msec = CONFIG_SYS_CLOCK_TICKS_PER_SEC * 1000,
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The ticks_per_msec calculation appears incorrect. It should be CONFIG_SYS_CLOCK_TICKS_PER_SEC / 1000 (ticks per millisecond), not multiplied by 1000. Looking at the imx8m platform, it uses a direct value of 800000 (for 800MHz), which represents ticks per millisecond. The current calculation would result in ticks per nanosecond.

Suggested change
.ticks_per_msec = CONFIG_SYS_CLOCK_TICKS_PER_SEC * 1000,
.ticks_per_msec = CONFIG_SYS_CLOCK_TICKS_PER_SEC / 1000,

Copilot uses AI. Check for mistakes.
Comment on lines +367 to +370
zephyr_library_sources(
${SOF_SRC_PATH}/schedule/zephyr_ll.c
)

Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The zephyr_ll.c scheduler source is already included automatically via the schedule subdirectory CMakeLists.txt (line 240 in this file calls add_subdirectory for schedule, which includes zephyr_ll.c at line 37 of src/schedule/CMakeLists.txt). This explicit inclusion is redundant and could potentially cause build issues due to duplicate symbols. Other similar platforms like imx95 (CONFIG_SOC_MIMX9596_M7) don't explicitly include this file.

Suggested change
zephyr_library_sources(
${SOF_SRC_PATH}/schedule/zephyr_ll.c
)

Copilot uses AI. Check for mistakes.
#include <kernel/abi.h>
#include <kernel/ext_manifest.h>
#include <sof/drivers/mu.h>
#include <zephyr/cache.h>
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The zephyr/cache.h header is included but doesn't appear to be used anywhere in this file. Consider removing this unused include.

Suggested change
#include <zephyr/cache.h>

Copilot uses AI. Check for mistakes.
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.

1 participant

Comments