Skip to content

Commit 3c64fdf

Browse files
committed
arch: microblaze: add CMake files for building arch
Internal references: FWRIVERHD-4554 Signed-off-by: Alp Sayin <alpsayin@gmail.com>
1 parent 8fd6432 commit 3c64fdf

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

arch/microblaze/CMakeLists.txt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright (c) 2023 Advanced Micro Devices, Inc. (AMD)
2+
# Copyright (c) 2023 Alp Sayin <alpsayin@gmail.com>
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
6+
# Set output binary format
7+
set_property(GLOBAL PROPERTY PROPERTY_OUTPUT_FORMAT elf32-microblaze)
8+
9+
add_subdirectory(core)
10+
zephyr_include_directories(include)
11+
12+
if(DEFINED CONFIG_BIG_ENDIAN)
13+
set(extended_objdump_endianness "-EB")
14+
else()
15+
set(extended_objdump_endianness "-EL")
16+
endif()
17+
18+
if(DEFINED CONFIG_OUTPUT_DISASSEMBLY)
19+
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
20+
COMMAND $<TARGET_PROPERTY:bintools,disassembly_command>
21+
${extended_objdump_endianness}
22+
"-hSst"
23+
${disassembly_type}
24+
$<TARGET_PROPERTY:bintools,disassembly_flag_infile>${KERNEL_ELF_NAME}
25+
$<TARGET_PROPERTY:bintools,disassembly_flag_outfile>extended_${KERNEL_LST_NAME}
26+
$<TARGET_PROPERTY:bintools,disassembly_flag_final>
27+
)
28+
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
29+
COMMAND $<TARGET_PROPERTY:bintools,disassembly_command>
30+
${extended_objdump_endianness}
31+
"-hSst"
32+
${disassembly_type}
33+
$<TARGET_PROPERTY:bintools,disassembly_flag_infile>zephyr_pre0.elf
34+
$<TARGET_PROPERTY:bintools,disassembly_flag_outfile>extended_zephyr_pre0.lst
35+
$<TARGET_PROPERTY:bintools,disassembly_flag_final>
36+
)
37+
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
38+
COMMAND $<TARGET_PROPERTY:bintools,disassembly_command>
39+
${extended_objdump_endianness}
40+
"-hSst"
41+
${disassembly_type}
42+
$<TARGET_PROPERTY:bintools,disassembly_flag_infile>zephyr_pre1.elf
43+
$<TARGET_PROPERTY:bintools,disassembly_flag_outfile>extended_zephyr_pre1.lst
44+
$<TARGET_PROPERTY:bintools,disassembly_flag_final>
45+
)
46+
endif()

arch/microblaze/core/CMakeLists.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright (c) 2023 Advanced Micro Devices, Inc. (AMD)
2+
# Copyright (c) 2023 Alp Sayin <alpsayin@gmail.com>
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
6+
zephyr_library()
7+
8+
zephyr_library_sources(
9+
cache.c
10+
cpu_idle.c
11+
crt0.S
12+
exception.S
13+
fatal.c
14+
irq_manage.c
15+
isr.S
16+
emulate_isr.S
17+
microblaze_disable_exceptions.S
18+
microblaze_disable_dcache.S
19+
microblaze_disable_icache.S
20+
microblaze_disable_interrupts.S
21+
microblaze_enable_exceptions.S
22+
microblaze_enable_interrupts.S
23+
microblaze_enable_dcache.S
24+
microblaze_enable_icache.S
25+
prep_c.c
26+
reboot.c
27+
reset.S
28+
swap.S
29+
thread.c
30+
)
31+
32+
zephyr_library_sources_ifdef(CONFIG_IRQ_OFFLOAD irq_offload.c)

0 commit comments

Comments
 (0)