zephyr/soc/neorv32/reset.S
Henrik Brix Andersen 63c24d9d34 soc: neorv32: update to support NEORV32 v1.11.1
Update the NEORV32 SoC, peripheral drivers, and board to support NEORV32
v1.11.1. Notable changes include:

- Optional RISC-V ISA Kconfigs are now selected on the board level.
- Peripheral registers are now automatically reset in hardware, no need for
  software initialization code.
- The NEORV32 GPIO controller now supports 32 pins, not 64. Interrupt
  support will be submitted in a separate PR.
- Default board configuration has 64k RAM and is clocked at 18 MHz.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2025-03-10 11:11:22 +01:00

37 lines
668 B
ArmAsm

/*
* Copyright (c) 2021,2025 Henrik Brix Andersen <henrik@brixandersen.dk>
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/toolchain.h>
/* exports */
GTEXT(__reset)
/* imports */
GTEXT(__initialize)
SECTION_FUNC(reset, __reset)
/* Disable interrupts */
csrw mstatus, x0
csrw mie, x0
#ifdef CONFIG_USERSPACE
/* Disable counter access outside M-mode */
csrw mcounteren, x0
#endif /* CONFIG_USERSPACE */
/* Allow mcycle and minstret counters to increment */
li x11, ~5
csrw mcountinhibit, x11
/* Zerorize counters */
csrw mcycle, x0
csrw mcycleh, x0
csrw minstret, x0
csrw minstreth, x0
/* Jump to __initialize */
call __initialize