Skip to content

Commit 19afabf

Browse files
dbalutaDaniel Baluta
authored andcommitted
build: Add support for building SOF on imx8mp with cm7
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>
1 parent e738f04 commit 19afabf

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

scripts/xtensa-build-zephyr.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ class PlatformConfig:
216216
"hifi4_mscale_v2_0_2_prod",
217217
RIMAGE_KEY = "key param ignored by imx8m"
218218
),
219+
"imx8m_cm7" : PlatformConfig(
220+
"imx", "imx8mp_evk/mimx8ml8/m7/ddr",
221+
"", "", "", ""
222+
),
219223
"imx8ulp" : PlatformConfig(
220224
"imx", "imx8ulp_evk/mimx8ud7/adsp",
221225
f"RI-2023.11{xtensa_tools_version_postfix}",
@@ -953,6 +957,15 @@ def build_platforms():
953957
platform_dict,
954958
STAGING_DIR / "sof-info" / platform
955959
)
960+
961+
# SOF marks ELF sections in the range [SOF_MODULE_DRAM_LINK_START, SOF_MODULE_DRAM_LINK_END]
962+
# as "detached". On imx8m_cm7 that address range overlaps with the M7 ITCM, so rimage would
963+
# incorrectly classify ITCM sections as detached. Pass -d to ignore detached classification
964+
if platform == "imx8m_cm7":
965+
existing = platform_wcfg.get("rimage.extra-args") or ""
966+
platform_wcfg.set("rimage.extra-args",
967+
shlex.join(shlex.split(existing) + ["-d"]))
968+
956969
platf_build_environ['WEST_CONFIG_LOCAL'] = str(wcfg_path)
957970

958971
# Make sure the build logs don't leave anything hidden
@@ -1304,7 +1317,7 @@ def gzip_compress(fname, gzdst=None):
13041317
# Don't run sof_ri_info and ignore silently .ri files that don't have one.
13051318
RI_INFO_UNSUPPORTED = []
13061319

1307-
RI_INFO_UNSUPPORTED += ['imx8', 'imx8x', 'imx8m', 'imx8ulp', 'imx95']
1320+
RI_INFO_UNSUPPORTED += ['imx8', 'imx8x', 'imx8m', 'imx8m_cm7', 'imx8ulp', 'imx95']
13081321
RI_INFO_UNSUPPORTED += ['rn', 'acp_6_0']
13091322
RI_INFO_UNSUPPORTED += ['mt8186', 'mt8188', 'mt8195', 'mt8196', 'mt8365']
13101323
RI_INFO_UNSUPPORTED += ['qemu_xtensa', 'qemu_xtensa_mmu']

tools/rimage/config/imx8m_cm7.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version = [1, 0]
2+
3+
[adsp]
4+
name = "imx8m_cm7"
5+
6+
[[adsp.mem_zone]]
7+
type = "IRAM"
8+
base = "0x0000000"
9+
size = "0x2000"
10+
host_offset = "0x0"
11+
[[adsp.mem_zone]]
12+
type = "SRAM"
13+
base = "0x80000000"
14+
size = "0x100000"
15+
host_offset = "0x0"

0 commit comments

Comments
 (0)