Skip to content

Conversation

@kv2019i
Copy link
Collaborator

@kv2019i kv2019i commented Sep 12, 2024

Definitions of mm_heap.h interface are not needed in Zephyr builds. To avoid pulling in XTOS definitions when building with CONFIG_SOF_ZEPHYR_STRICT_HEADERS=n, add a no-op version for Zephyr.

@lgirdwood
Copy link
Member

@kv2019i some build errors:

D:\a\sof\sof\zephyr-sdk-0.16.4_windows-x86_64\zephyr-sdk-0.16.4\xtensa-nxp_imx_adsp_zephyr-elf\bin\xtensa-nxp_imx_adsp_zephyr-elf-gcc.exe -DCC_OPTIMIZE_FLAGS=\"-O2\" -DCPU_MIMX8QM6AVUFF_dsp -DKERNEL -DK_HEAP_MEM_POOL_SIZE=2048 -DNDEBUG -DXCC_TOOLS_VERSION=\"zephyr\" -D__ZEPHYR__=1 -DRELATIVE_FILE=\"../sof/src/platform/imx8/lib/memory.c\" -ID:/a/sof/sof/workspace/build-imx8/zephyr/include/generated/zephyr -ID:/a/sof/sof/workspace/zephyr/include -ID:/a/sof/sof/workspace/build-imx8/zephyr/include/generated -ID:/a/sof/sof/workspace/zephyr/soc/nxp/imx -ID:/a/sof/sof/workspace/zephyr/soc/nxp/imx/imx8/adsp -ID:/a/sof/sof/workspace/zephyr/soc/nxp/imx/imx8/adsp/include -ID:/a/sof/sof/workspace/zephyr/soc/nxp/imx/. -ID:/a/sof/sof/workspace/zephyr/soc/nxp/imx/imx8 -ID:/a/sof/sof/workspace/zephyr/soc/nxp/imx/imx8/include -ID:/a/sof/sof/workspace/sof/zephyr/include -ID:/a/sof/sof/workspace/sof/src/platform/imx8/include -ID:/a/sof/sof/workspace/modules/hal/nxp/mcux/mcux-sdk/devices/MIMX8QM6 -ID:/a/sof/sof/workspace/modules/hal/nxp/mcux/mcux-sdk/devices/MIMX8QM6/drivers -ID:/a/sof/sof/workspace/modules/hal/nxp/mcux/mcux-sdk/devices/MIMX8QM6/scfw_api -ID:/a/sof/sof/workspace/modules/hal/nxp/mcux/mcux-sdk/drivers/common -ID:/a/sof/sof/workspace/modules/hal/nxp/mcux/mcux-sdk/drivers/sai -ID:/a/sof/sof/workspace/modules/hal/nxp/mcux/mcux-sdk/drivers/irqsteer -ID:/a/sof/sof/workspace/modules/hal/nxp/mcux/mcux-sdk/drivers/edma_rev2 -ID:/a/sof/sof/workspace/modules/hal/nxp/mcux/mcux-sdk/drivers/esai -ID:/a/sof/sof/workspace/zephyr/modules/hal_nxp/. -ID:/a/sof/sof/workspace/modules/hal/xtensa/include -ID:/a/sof/sof/workspace/modules/hal/xtensa/XTENSA_HAL -ID:/a/sof/sof/workspace/modules/hal/xtensa/zephyr/soc/nxp_imx_adsp -ID:/a/sof/sof/workspace/sof/tools/rimage/src/include -ID:/a/sof/sof/workspace/sof/src/include -ID:/a/sof/sof/workspace/sof/src/arch/xtensa/include -ID:/a/sof/sof/workspace/sof/third_party/include -ID:/a/sof/sof/workspace/sof/xtos/include -isystem D:/a/sof/sof/workspace/zephyr/lib/libc/minimal/include -isystem D:/a/sof/sof/workspace/zephyr/lib/libc/common/include -isystem d:/a/sof/sof/zephyr-sdk-0.16.4_windows-x86_64/zephyr-sdk-0.16.4/xtensa-nxp_imx_adsp_zephyr-elf/bin/../lib/gcc/xtensa-nxp_imx_adsp_zephyr-elf/12.2.0/include -isystem d:/a/sof/sof/zephyr-sdk-0.16.4_windows-x86_64/zephyr-sdk-0.16.4/xtensa-nxp_imx_adsp_zephyr-elf/bin/../lib/gcc/xtensa-nxp_imx_adsp_zephyr-elf/12.2.0/include-fixed -fno-strict-aliasing -O2 -imacros D:/a/sof/sof/workspace/build-imx8/zephyr/include/generated/zephyr/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always --sysroot=D:/a/sof/sof/zephyr-sdk-0.16.4_windows-x86_64/zephyr-sdk-0.16.4/xtensa-nxp_imx_adsp_zephyr-elf/xtensa-nxp_imx_adsp_zephyr-elf -imacros D:/a/sof/sof/workspace/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -Werror -fno-asynchronous-unwind-tables -fstrict-overflow -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=D:/a/sof/sof/workspace/sof/app=CMAKE_SOURCE_DIR -fmacro-prefix-map=D:/a/sof/sof/workspace/zephyr=ZEPHYR_BASE -fmacro-prefix-map=D:/a/sof/sof/workspace=WEST_TOPDIR -ffunction-sections -fdata-sections -mlongcalls -std=c99 -nostdinc -fno-inline-functions -std=gnu99 -MD -MT modules/sof/CMakeFiles/modules_sof.dir/D_/a/sof/sof/workspace/sof/src/platform/imx8/lib/memory.c.obj -MF modules\sof\CMakeFiles\modules_sof.dir\D_\a\sof\sof\workspace\sof\src\platform\imx8\lib\memory.c.obj.d -o modules/sof/CMakeFiles/modules_sof.dir/D_/a/sof/sof/workspace/sof/src/platform/imx8/lib/memory.c.obj -c D:/a/sof/sof/workspace/sof/src/platform/imx8/lib/memory.c
D:/a/sof/sof/workspace/sof/src/platform/imx8/lib/memory.c:15:37: error: array type has incomplete element type 'struct block_hdr'
   15 | static SHARED_DATA struct block_hdr sys_rt_block64[HEAP_SYS_RT_COUNT64];
      |                                     ^~~~~~~~~~~~~~
D:/a/sof/sof/workspace/sof/src/platform/imx8/lib/memory.c:16:37: error: array type has incomplete element type 'struct block_hdr'

@kv2019i kv2019i changed the title zephyr: sof/lib/mm_heap.h added Zephyr version [DNM] zephyr: sof/lib/mm_heap.h added Zephyr version Sep 17, 2024
The platform memory.c defines "sof->memory_map" which is used by
the XTOS allocator code (sof/src/lib/alloc.c). The NXP Zephyr
build targets no longer use this allocator, so the platform memory
definitions are no longer needed.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Definitions of mm_heap.h interface are not needed in Zephyr builds. To
avoid pulling in XTOS definitions when building with
CONFIG_SOF_ZEPHYR_STRICT_HEADERS=n, add a no-op version for Zephyr.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
@kv2019i kv2019i force-pushed the 202409-sof-lib-mm-heap-h branch from aaa3bcc to b643d10 Compare September 18, 2024 11:26
@kv2019i kv2019i changed the title [DNM] zephyr: sof/lib/mm_heap.h added Zephyr version zephyr: sof/lib/mm_heap.h added Zephyr version Sep 18, 2024
@kv2019i
Copy link
Collaborator Author

kv2019i commented Sep 18, 2024

@iuliana-prodan @dbaluta Can you check the nxp patch? I build tested and seems to be fine now (let's see if CI agrees). I didn't remove the file yet as at least one imx target was still using XTOS, but please check.

@lgirdwood
Copy link
Member

@iuliana-prodan @dbaluta Can you check the nxp patch? I build tested and seems to be fine now (let's see if CI agrees). I didn't remove the file yet as at least one imx target was still using XTOS, but please check.

Looks like most CI has run now and results look fine, just pending final CI reports.

@kv2019i
Copy link
Collaborator Author

kv2019i commented Sep 19, 2024

@lgirdwood let's wait for someone from @thesofproject/nxp to ack. This is not urgent PR and I can only build test on the nxp target, so I can wait for feedback.

Copy link
Contributor

@LaurentiuM1234 LaurentiuM1234 left a comment

Choose a reason for hiding this comment

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

As far as I'm aware platform_init_memmap() is not used in Zephyr so including memory.c in the build wasn't necessary. Anyways, thanks for the cleanup work you've been doing lately. Tested on imx8 with an aplay, no logs.

@kv2019i kv2019i merged commit d98f0d4 into thesofproject:main Sep 19, 2024
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.

5 participants