Add SOF support for M7 core on NXP i.MX8MP#10556
Add SOF support for M7 core on NXP i.MX8MP#10556dbaluta wants to merge 5 commits intothesofproject:mainfrom
Conversation
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
| } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) | |
| } GROUP_ROM_LINK_IN(ROMABLE_REGION) |
There was a problem hiding this comment.
This is not true, look at src/platform/imx95/linker/data-sections.ld
lgirdwood
left a comment
There was a problem hiding this comment.
LGTM. Btw, have you considered any AI converted HiFi SIMD to ARM SIMD support for some modules ? This should be doable and interesting to see if it gets it right.
| #ifndef __PLATFORM_LIB_CLK_H__ | ||
| #define __PLATFORM_LIB_CLK_H__ | ||
|
|
||
| #define CLK_MAX_CPU_HZ 800000000 |
There was a problem hiding this comment.
@dbaluta we should be able to get rid of a lot of this with native zephyr drivers, I think still some local drivers using atm.
I haven't thought about this but this sounds like a good idea! |
|
|
||
| config IMX8M_CM7 | ||
| bool "Build for NXP i.MX8MP CM7 core" | ||
| select ZEPHYR_LOG |
There was a problem hiding this comment.
this looks a bit untraditional - would it be better to enable logging in platform config?
There was a problem hiding this comment.
True, will remove.
|
@dbaluta any update for non draft ? |
Update west.yml to bring in Zephyr support for i.MX8MP CM7 core. Signed-off-by: Daniel Baluta <daniel.baluta@oss.nxp.com>
19afabf to
a97549c
Compare
This adds platform files necessary to run SOF on CM7 core of i.MX8MP. 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>
|
Changes since v1:
|
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