| * Copyright (c) 2021 Henrik Brix Andersen <henrik@brixandersen.dk> |
| * SPDX-License-Identifier: Apache-2.0 |
| #include <zephyr/toolchain.h> |
| SECTION_FUNC(reset, __reset) |
| /* Zerorize zero register */ |
| /* Disable counter access outside M-mode */ |
| #endif /* CONFIG_USERSPACE */ |
| /* Allow mcycle and minstret counters to increment */ |
| * Simplify dummy machine trap code by not having to decode |
| * Temporarily setup a dummy machine trap vector to catch (and ignore) |
| * Store Access faults due to unimplemented peripherals. |
| la x7, __dummy_trap_handler |
| /* Attempt to zerorize all IO peripheral registers */ |
| /* Restore previous machine trap vector */ |
| /* Jump to __initialize */ |
| SECTION_FUNC(reset, __dummy_trap_handler) |