soc: gd32vf103: Link soc-specific before common code
For a proper initialisation, the soc-specific `__nuclei_start` has to be executed before the common `__start`. To ensure that `__nuclei_start` is linked first, I added the linker section init. Signed-off-by: Greter Raffael <rgreter@baumer.com>
This commit is contained in:
parent
43490289ff
commit
8460ed093e
|
@ -4,4 +4,6 @@
|
|||
zephyr_sources(entry.S)
|
||||
zephyr_sources(soc.c)
|
||||
|
||||
zephyr_linker_sources(ROM_START SORT_KEY 0x0 init.ld)
|
||||
|
||||
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/riscv/common/linker.ld CACHE INTERNAL "")
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <zephyr/arch/riscv/csr.h>
|
||||
|
||||
GTEXT(__nuclei_start)
|
||||
SECTION_FUNC(vectors, __nuclei_start)
|
||||
SECTION_FUNC(init, __nuclei_start)
|
||||
/* Disable Global Interrupt */
|
||||
csrc mstatus, MSTATUS_MIE
|
||||
/* Jump to logical address first to ensure correct operation of RAM region */
|
||||
|
|
7
soc/riscv/gd_gd32/gd32vf103/init.ld
Normal file
7
soc/riscv/gd_gd32/gd32vf103/init.ld
Normal file
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Andes Technology Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
KEEP(*(.init.*))
|
Loading…
Reference in a new issue