From 0f329ae65732c3f832842cde5aea139d933f5691 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Sun, 8 Dec 2019 20:17:16 -0800 Subject: [PATCH 1/3] boards: up_squared_adsp: prepare for Xtensa HAL module This is in preparation for having Xtensa HAL as a Zephyr module, instead of a library in the toolchain. This is to make sure the bootloader can find the HAL header files. Signed-off-by: Daniel Leung --- boards/xtensa/up_squared_adsp/bootloader/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boards/xtensa/up_squared_adsp/bootloader/CMakeLists.txt b/boards/xtensa/up_squared_adsp/bootloader/CMakeLists.txt index e11ee03262fe..a2023cffe5ee 100644 --- a/boards/xtensa/up_squared_adsp/bootloader/CMakeLists.txt +++ b/boards/xtensa/up_squared_adsp/bootloader/CMakeLists.txt @@ -39,3 +39,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${BOARD_DIR}/bootloader/boot_ldr.x) + +if(CONFIG_XTENSA_HAL) + target_link_libraries(bootloader PRIVATE XTENSA_HAL) +endif() From f6d6bb03e4a61ddf57f7938ac42ccc2a406cf6da Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Sun, 8 Dec 2019 20:21:43 -0800 Subject: [PATCH 2/3] boards: up_squared_adsp: use __asm__ instead of asm The keyword asm is not standard when -std=c99, so use __asm__ instead. Signed-off-by: Daniel Leung --- boards/xtensa/up_squared_adsp/bootloader/boot_loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/xtensa/up_squared_adsp/bootloader/boot_loader.c b/boards/xtensa/up_squared_adsp/bootloader/boot_loader.c index 767616f2ee8f..ceaa48293fe0 100644 --- a/boards/xtensa/up_squared_adsp/bootloader/boot_loader.c +++ b/boards/xtensa/up_squared_adsp/bootloader/boot_loader.c @@ -24,7 +24,7 @@ extern void _ResetVector(); static inline void idelay(int n) { while (n--) { - asm volatile("nop"); + __asm__ volatile("nop"); } } From 9e4d24c956e0ef56540a378f6720c6ccef961d45 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Sun, 8 Dec 2019 20:25:01 -0800 Subject: [PATCH 3/3] boards: up_squared_adsp: add orphan sections to linker script There are a few orphan sections that appears when building with SDK v0.11. So add them to the linker script. Signed-off-by: Daniel Leung --- boards/xtensa/up_squared_adsp/bootloader/boot_ldr.x | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boards/xtensa/up_squared_adsp/bootloader/boot_ldr.x b/boards/xtensa/up_squared_adsp/bootloader/boot_ldr.x index 94e669f86b11..2e07635c37c2 100644 --- a/boards/xtensa/up_squared_adsp/bootloader/boot_ldr.x +++ b/boards/xtensa/up_squared_adsp/bootloader/boot_ldr.x @@ -153,6 +153,7 @@ SECTIONS __stack = 0xBE000000 + (1 * 0x1000); __wnd0 = ((((((0xBE000000 + 0x8000) + 0x2000) + 0x800) + 0x800) + 0x1000) + 0x2000); __wnd0_size = (0x1000 + 0x1000); + .comment 0 : { *(.comment) } .debug 0 : { *(.debug) } .line 0 : { *(.line) } .debug_srcinfo 0 : { *(.debug_srcinfo) } @@ -170,6 +171,8 @@ SECTIONS .debug_funcnames 0 : { *(.debug_funcnames) } .debug_typenames 0 : { *(.debug_typenames) } .debug_varnames 0 : { *(.debug_varnames) } + .debug_ranges 0 : { *(.debug_ranges) } + .xtensa.info 0 : { *(.xtensa.info) } .xt.insn 0 : { KEEP (*(.xt.insn))