diff --git a/bsp/qemu-virt64-aarch64/SConstruct b/bsp/qemu-virt64-aarch64/SConstruct index 658dcf291d..54f12e3636 100644 --- a/bsp/qemu-virt64-aarch64/SConstruct +++ b/bsp/qemu-virt64-aarch64/SConstruct @@ -40,5 +40,9 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT) +if GetDepend('RT_USING_SMART'): + # use smart link.lds + env['LINKFLAGS'] = env['LINKFLAGS'].replace('link.lds', 'link_smart.lds') + # make a building DoBuilding(TARGET, objs) diff --git a/bsp/qemu-virt64-aarch64/drivers/board.c b/bsp/qemu-virt64-aarch64/drivers/board.c index 5fc2aa111f..07caa4d64b 100644 --- a/bsp/qemu-virt64-aarch64/drivers/board.c +++ b/bsp/qemu-virt64-aarch64/drivers/board.c @@ -14,11 +14,14 @@ #include #include #include + #ifdef RT_USING_SMART #include #include #endif + #include "board.h" +#include #ifdef RT_USING_FDT #include "interrupt.h" diff --git a/bsp/qemu-virt64-aarch64/link.lds b/bsp/qemu-virt64-aarch64/link.lds index c591903454..3adad6e44c 100644 --- a/bsp/qemu-virt64-aarch64/link.lds +++ b/bsp/qemu-virt64-aarch64/link.lds @@ -2,7 +2,6 @@ OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64 OUTPUT_ARCH(aarch64) SECTIONS { - /*. = 0x60080000; */ . = 0x40080000; /* . = 0xffff000000080000; */ diff --git a/bsp/qemu-virt64-aarch64/link_smart.lds b/bsp/qemu-virt64-aarch64/link_smart.lds new file mode 100644 index 0000000000..3df5a76afc --- /dev/null +++ b/bsp/qemu-virt64-aarch64/link_smart.lds @@ -0,0 +1,109 @@ +OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64") +OUTPUT_ARCH(aarch64) +SECTIONS +{ + /* . = 0x40080000; */ + . = 0xffff000000080000; + + __text_start = .; + .text : + { + KEEP(*(.text.entrypoint)) + KEEP(*(.vectors)) + *(.text) + *(.text.*) + + /* section information for utest */ + . = ALIGN(8); + __rt_utest_tc_tab_start = .; + KEEP(*(UtestTcTab)) + __rt_utest_tc_tab_end = .; + + /* section information for finsh shell */ + . = ALIGN(8); + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + . = ALIGN(8); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; + . = ALIGN(8); + + /* section information for modules */ + . = ALIGN(8); + __rtmsymtab_start = .; + KEEP(*(RTMSymTab)) + __rtmsymtab_end = .; + + /* section information for initialization */ + . = ALIGN(8); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + } =0 + __text_end = .; + + .ARM.exidx : + { + __exidx_start = .; + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + __exidx_end = .; + } + + __rodata_start = .; + .rodata : { *(.rodata) *(.rodata.*) } + __rodata_end = .; + + . = ALIGN(8); + .ctors : + { + PROVIDE(__ctors_start__ = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__ctors_end__ = .); + } + + .dtors : + { + PROVIDE(__dtors_start__ = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE(__dtors_end__ = .); + } + + . = ALIGN(8); + __data_start = .; + .data : + { + *(.data) + *(.data.*) + } + __data_end = .; + + . = ALIGN(8); + __bss_start = .; + .bss : + { + *(.bss) + *(.bss.*) + *(COMMON) + . = ALIGN(8); + } + . = ALIGN(8); + __bss_end = .; + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + + __data_size = SIZEOF(.data); + __bss_size = SIZEOF(.bss); + + _end = .; +} diff --git a/libcpu/Kconfig b/libcpu/Kconfig index daaad9af90..afd07843d2 100644 --- a/libcpu/Kconfig +++ b/libcpu/Kconfig @@ -89,8 +89,9 @@ config KERNEL_VADDR_START config PV_OFFSET hex "The offset of kernel physical address and virtural address" - default 0xa0000000 if ARCH_ARM - default 0x0 if ARCH_RISCV + default 0x1000040000000 if ARCH_ARMV8 + default 0xa0000000 if ARCH_ARM + default 0x0 if ARCH_RISCV depends on ARCH_MM_MMU config RT_IOREMAP_LATE