zephyr/soc/xtensa/intel_adsp/common/bootloader.cmake
Andy Ross f5267d9ff2 soc/intel_adsp: Honor CONFIG_KERNEL_BINARY_NAME
Turns out that the user can configure the "zephyr.elf" name via
kconfig to be "something_else.elf" instead.  And there's a test the
does this.  Use the right variable; don't hardcode.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-08 19:25:25 -05:00

26 lines
1.1 KiB
CMake

# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
set(SOC_FAMILY intel_adsp)
add_subdirectory(bootloader)
set(ELF_FIX ${SOC_DIR}/${ARCH}/${SOC_FAMILY}/common/fix_elf_addrs.py)
add_custom_target(
process_elf ALL
DEPENDS base_module
DEPENDS ${ZEPHYR_FINAL_EXECUTABLE}
COMMAND ${CMAKE_OBJCOPY} --dump-section .data=mod-apl.bin $<TARGET_FILE:base_module>
COMMAND ${CMAKE_OBJCOPY} --add-section .module=mod-apl.bin --set-section-flags .module=load,readonly ${CMAKE_BINARY_DIR}/zephyr/${KERNEL_ELF_NAME} ${CMAKE_BINARY_DIR}/zephyr/${KERNEL_ELF_NAME}.mod
# Adjust final section addresses so they all appear in the cached region.
COMMAND ${ELF_FIX} ${CMAKE_OBJCOPY} ${CMAKE_BINARY_DIR}/zephyr/${KERNEL_ELF_NAME}.mod
)
add_custom_target(
process_bootloader ALL
DEPENDS bootloader boot_module
COMMAND ${CMAKE_OBJCOPY} --dump-section .data=mod-boot.bin $<TARGET_FILE:boot_module>
COMMAND ${CMAKE_OBJCOPY} --add-section .module=mod-boot.bin --set-section-flags .module=load,readonly $<TARGET_FILE:bootloader> ${CMAKE_BINARY_DIR}/zephyr/bootloader.elf.mod
)