1 /* 2 3 Copyright (c) 2010 - 2023, Nordic Semiconductor ASA All rights reserved. 4 5 SPDX-License-Identifier: BSD-3-Clause 6 7 Redistribution and use in source and binary forms, with or without 8 modification, are permitted provided that the following conditions are met: 9 10 1. Redistributions of source code must retain the above copyright notice, this 11 list of conditions and the following disclaimer. 12 13 2. Redistributions in binary form must reproduce the above copyright 14 notice, this list of conditions and the following disclaimer in the 15 documentation and/or other materials provided with the distribution. 16 17 3. Neither the name of Nordic Semiconductor ASA nor the names of its 18 contributors may be used to endorse or promote products derived from this 19 software without specific prior written permission. 20 21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE 24 ARE DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE 25 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 POSSIBILITY OF SUCH DAMAGE. 32 33 */ 34 35 #ifndef _CORE_VPR_H 36 #define _CORE_VPR_H 37 38 #ifndef __ASSEMBLY__ 39 #include <stdint.h> 40 #endif 41 42 #include "riscv_encoding.h" 43 44 #define __MTVT_PRESENT 1 45 46 /* =========================================================================================================================== */ 47 /* ================ CSR declaration ================ */ 48 /* =========================================================================================================================== */ 49 #define CSR_MCYCLE 0xB00 50 #define CSR_MINSTRET 0xB02 51 #define CSR_MCYCLEH 0xB80 52 #define CSR_MINSTRETH 0xB82 53 #define CSR_MVENDORID 0xF11 54 #define CSR_MARCHID 0xF12 55 #define CSR_MIMPID 0xF13 56 #define CSR_MHARTID 0xF14 57 #define CSR_MSTATUS 0x300 58 #define CSR_MISA 0x301 59 #define CSR_MEDELEG 0x302 60 #define CSR_MIDELEG 0x303 61 #define CSR_MIE 0x304 62 #define CSR_MTVEC 0x305 63 #define CSR_MCOUNTEREN 0x306 64 #define CSR_MTVT 0x307 65 #define CSR_MSCRATCH 0x340 66 #define CSR_MEPC 0x341 67 #define CSR_MCAUSE 0x342 68 #define CSR_MTVAL 0x343 69 #define CSR_MIP 0x344 70 #define CSR_MNXTI 0x345 71 #define CSR_MINTSTATUS 0x346 72 #define CSR_MSCRATCHCSW 0x348 73 #define CSR_MSCRATCHCSWL 0x349 74 #define CSR_MCLICBASE 0x350 75 #define CSR_DCSR 0x7b0 76 #define CSR_DPC 0x7b1 77 #define CSR_UCYCLE 0xc00 78 #define CSR_UINSTRET 0xc02 79 #define CSR_UCYCLEH 0xc80 80 #define CSR_UINSTRETH 0xc82 81 82 // Nordic custom CSRs 83 #define CSR_NORDIC_CTRL 0x7c0 84 #define CSR_NORDIC_SLEEP 0x7c1 85 #define CSR_NORDIC_DISFTR 0x7c2 86 #define CSR_NORDIC_VIOPINS 0x7c3 87 88 #define VTIM_CNTMODE0 0x7d0 89 #define VTIM_CNTMODE1 0x7d1 90 #define VTIM_CNT 0x7d2 91 #define VTIM_CNTTOP 0x7d3 92 #define VTIM_CNTADD 0x7d4 93 #define VTIM_CNT0 0x7d5 94 #define VTIM_CNTADD0 0x7d6 95 #define VTIM_CNT1 0x7d7 96 #define VTIM_CNTADD1 0x7d8 97 98 #define VIO_OUT 0x7e0 99 #define VIO_DIR 0x7e1 100 #define VIO_IN 0x7e2 101 #define VIO_INMODE 0x7e3 102 #define VIO_OUTB 0x7e4 103 #define VIO_DIRB 0x7e5 104 #define VIO_DIROUT 0x7e6 105 #define VIO_DIROUTB 0x7e7 106 #define VIO_OUTTGL 0x7e8 107 #define VIO_DIRTGL 0x7e9 108 #define VIO_OUTBTGL 0x7ea 109 #define VIO_DIRBTGL 0x7eb 110 #define VIO_DIROUTTGL 0x7ec 111 #define VIO_DIROUTBTGL 0x7ed 112 #define VIO_OUTBS 0x7ee 113 #define VIO_DIRBS 0x7ef 114 #define VIO_DIROUTBS 0x7f0 115 116 #define VEVIF_VTASKS 0x7f1 117 #define VEVIF_VSUBSCRIBE 0x7f2 118 #define VEVIF_VEVENTS 0x7f3 119 #define VEVIF_VPUBLISH 0x7f4 120 #define VEVIF_VINTEN 0x7f5 121 #define VEVIF_VEVENTSB 0x7f6 122 #define VEVIF_VEVENTSBS 0x7f7 123 124 #endif /* _CORE_VPR_H */