soc: Add support for the WCH CH32V303

Adds support for building an image for the ch32v303.

Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
This commit is contained in:
Miguel Gazquez 2025-02-11 14:17:06 +01:00 committed by Benjamin Cabé
commit be9549be60
15 changed files with 444 additions and 1 deletions

View file

@ -0,0 +1,32 @@
/*
* Copyright (c) 2024 Michael Hope
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/toolchain.h>
#ifndef CONFIG_VECTOR_TABLE_SIZE
#error "VECTOR_TABLE_SIZE must be defined"
#endif
/* Exports */
GTEXT(__start)
/* Imports */
GTEXT(__initialize)
SECTION_FUNC(vectors, ivt)
.option norvc
/* Jump to 0x08000008, into the main flash zone where j __start is */
lui x5, 0x8000
jr 0x8(x5)
j __start
.rept CONFIG_VECTOR_TABLE_SIZE
.word _isr_wrapper
.endr
SECTION_FUNC(vectors, __start)
li a0, 0xf
csrw mtvec, a0
j __initialize