diff --git a/soc/xtensa/intel_apl_adsp/CMakeLists.txt b/soc/xtensa/intel_apl_adsp/CMakeLists.txt index 5e46b193e6b..be3edaca978 100644 --- a/soc/xtensa/intel_apl_adsp/CMakeLists.txt +++ b/soc/xtensa/intel_apl_adsp/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 -zephyr_library() +zephyr_library_named(${ARCH}_${SOC_NAME}) zephyr_library_include_directories(${ZEPHYR_BASE}/drivers) zephyr_library_sources(adsp.c) zephyr_library_sources(soc.c) diff --git a/soc/xtensa/intel_apl_adsp/bootloader.cmake b/soc/xtensa/intel_apl_adsp/bootloader.cmake deleted file mode 100644 index 5444124938b..00000000000 --- a/soc/xtensa/intel_apl_adsp/bootloader.cmake +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2019 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -add_subdirectory(${SOC_DIR}/${ARCH}/${SOC_FAMILY}/common/bootloader ${build_dir}) - -add_custom_target( - process_elf ALL - DEPENDS base_module - DEPENDS ${ZEPHYR_FINAL_EXECUTABLE} - COMMAND ${CMAKE_OBJCOPY} --dump-section .data=mod-apl.bin ${CMAKE_BINARY_DIR}/zephyr/soc/xtensa/${SOC_FAMILY}/common/bootloader/libbase_module.a - COMMAND ${CMAKE_OBJCOPY} --add-section .module=mod-apl.bin --set-section-flags .module=load,readonly ${CMAKE_BINARY_DIR}/zephyr/zephyr.elf ${CMAKE_BINARY_DIR}/zephyr/zephyr.elf.mod - ) - -add_custom_target( - process_bootloader ALL - DEPENDS bootloader boot_module - COMMAND ${CMAKE_OBJCOPY} --dump-section .data=mod-boot.bin ${CMAKE_BINARY_DIR}/zephyr/soc/xtensa/${SOC_FAMILY}/common/bootloader/libboot_module.a - COMMAND ${CMAKE_OBJCOPY} --add-section .module=mod-boot.bin --set-section-flags .module=load,readonly ${CMAKE_BINARY_DIR}/zephyr/soc/xtensa/${SOC_FAMILY}/common/bootloader/bootloader.elf ${CMAKE_BINARY_DIR}/zephyr/bootloader.elf.mod - ) diff --git a/soc/xtensa/intel_apl_adsp/common/bootloader.cmake b/soc/xtensa/intel_apl_adsp/common/bootloader.cmake index 15d77f0a686..d58dcbe3652 100644 --- a/soc/xtensa/intel_apl_adsp/common/bootloader.cmake +++ b/soc/xtensa/intel_apl_adsp/common/bootloader.cmake @@ -4,27 +4,27 @@ set(SOC_FAMILY intel_apl_adsp) -if(EXISTS ${SOC_DIR}/${ARCH}/${SOC_FAMILY}/common/bootloader/CMakeLists.txt) +if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/bootloader/CMakeLists.txt) if(USING_OUT_OF_TREE_BOARD) set(build_dir boards/${ARCH}/${BOARD}/bootloader) else() unset(build_dir) endif() - add_subdirectory(${SOC_DIR}/${ARCH}/${SOC_FAMILY}/common/bootloader ${build_dir}) + add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/bootloader ${build_dir}) endif() add_custom_target( process_elf ALL DEPENDS base_module DEPENDS ${ZEPHYR_FINAL_EXECUTABLE} - COMMAND ${CMAKE_OBJCOPY} --dump-section .data=mod-apl.bin ${CMAKE_BINARY_DIR}/zephyr/soc/xtensa/${SOC_FAMILY}/common/bootloader/libbase_module.a + COMMAND ${CMAKE_OBJCOPY} --dump-section .data=mod-apl.bin $ COMMAND ${CMAKE_OBJCOPY} --add-section .module=mod-apl.bin --set-section-flags .module=load,readonly ${CMAKE_BINARY_DIR}/zephyr/zephyr.elf ${CMAKE_BINARY_DIR}/zephyr/zephyr.elf.mod ) add_custom_target( process_bootloader ALL DEPENDS bootloader boot_module - COMMAND ${CMAKE_OBJCOPY} --dump-section .data=mod-boot.bin ${CMAKE_BINARY_DIR}/zephyr/soc/xtensa/${SOC_FAMILY}/common/bootloader/libboot_module.a - COMMAND ${CMAKE_OBJCOPY} --add-section .module=mod-boot.bin --set-section-flags .module=load,readonly ${CMAKE_BINARY_DIR}/zephyr/soc/xtensa/${SOC_FAMILY}/common/bootloader/bootloader.elf ${CMAKE_BINARY_DIR}/zephyr/bootloader.elf.mod + COMMAND ${CMAKE_OBJCOPY} --dump-section .data=mod-boot.bin $ + COMMAND ${CMAKE_OBJCOPY} --add-section .module=mod-boot.bin --set-section-flags .module=load,readonly $ ${CMAKE_BINARY_DIR}/zephyr/bootloader.elf.mod ) diff --git a/soc/xtensa/intel_apl_adsp/common/bootloader/CMakeLists.txt b/soc/xtensa/intel_apl_adsp/common/bootloader/CMakeLists.txt index 8d0f85a2721..81a48be7f5d 100644 --- a/soc/xtensa/intel_apl_adsp/common/bootloader/CMakeLists.txt +++ b/soc/xtensa/intel_apl_adsp/common/bootloader/CMakeLists.txt @@ -4,12 +4,12 @@ add_library(base_module base_module.c) target_include_directories(base_module PUBLIC - ${SOC_DIR}/${ARCH}/${SOC_PATH}/include + $/include ) add_library(boot_module boot_module.c) target_include_directories(boot_module PUBLIC - ${SOC_DIR}/${ARCH}/${SOC_PATH}/include + $/include ) add_executable(bootloader @@ -29,8 +29,8 @@ target_include_directories(bootloader PUBLIC ./ ${ZEPHYR_BASE}/include ${TOOLCHAIN_INCLUDES} - ${SOC_DIR}/${ARCH}/${SOC_PATH}/ - ${SOC_DIR}/${ARCH}/${SOC_PATH}/include + $/ + $/include ) set_source_files_properties(boot_entry.S PROPERTIES COMPILE_FLAGS -DASSEMBLY) @@ -40,7 +40,7 @@ target_compile_options(bootloader PUBLIC -fno-inline-functions -mlongcalls -mtex target_link_libraries(bootloader PUBLIC -Wl,--no-check-sections -ucall_user_start -Wl,-static -nostdlib) target_link_libraries(bootloader PRIVATE -lhal -L${zephyr_sdk}/xtensa/intel_apl_adsp/xtensa-zephyr-elf/lib) -target_link_libraries(bootloader PRIVATE -T${SOC_DIR}/${ARCH}/${SOC_FAMILY}/common/bootloader/boot_ldr.x) +target_link_libraries(bootloader PRIVATE -T$/common/bootloader/boot_ldr.x) if(CONFIG_XTENSA_HAL) target_link_libraries(bootloader PRIVATE XTENSA_HAL)