blob: 3dec7529dc96981884003976ed9673365d8be564 [file] [log] [blame]
xiaohu.huang797c4c12024-01-24 18:52:43 +08001/*
2 * Copyright (c) 2021-2022 Amlogic, Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: MIT
5 */
6
7#ifndef __EXCEPTION_HANDLER_H__
8#define __EXCEPTION_HANDLER_H__
9
10#include <stdint.h>
11#include "common.h"
12#include "riscv_encoding.h"
13
14#define RV_PIC_INT_SOFT 3
15#define RV_PIC_INT_TIMER 7
16#define RV_PIC_INT_FIQ 19
17#define RV_PIC_INT_IRQ 20
18#define RV_PIC_INT_FMAC 21
19#define RV_PIC_INT_TSHI 22
20
21#define RV_PIC_INT_IMAC 27
22#define RV_PIC_INT_H2FW 28
23#define RV_PIC_INT_COXT 29
24#define RV_PIC_INT_WAKE 30
25#define RV_PIC_INT_HIQ0 31
26#define RV_PIC_INT_HIQ1 32
27#define RV_PIC_INT_TSIQ 33
28#define RV_PIC_INT_WDIQ 34
29#define RV_PIC_INT_U2D 35
30#define RV_PIC_INT_USB_IDDIG 36
31#define RV_PIC_INT_USB_VBUSDIG 37
32
33#define RV_PIC_LVL_WDIQ 7
34#define RV_PIC_LVL_FIQ 7
35#define RV_PIC_LVL_IRQ 5
36
37#define RV_PIC_LVL_SOFT 7
38#define RV_PIC_LVL_TIMR 7
39#define RV_PIC_LVL_FMAC 6
40#define RV_PIC_LVL_TSHI 6
41
42#define RV_PIC_LVL_IMAC 5
43#define RV_PIC_LVL_H2FW 5
44#define RV_PIC_LVL_COXT 5
45#define RV_PIC_LVL_WAKE 4
46
47#define RV_PIC_LVL_USB_VBUSDIG 3
48#define RV_PIC_LVL_USB_IDDIG 3
49#define RV_PIC_LVL_U2D 3
50
51#define RV_PIC_LVL_HIQ0 3
52#define RV_PIC_LVL_HIQ1 2
53#define RV_PIC_LVL_TSIQ 1
54
xiaohu.huang797c4c12024-01-24 18:52:43 +080055uint32_t interrupt_register_exception(uint32_t mcause, uint32_t sp);
56
57uint32_t interrupt_register_nmi(uint32_t mcause, uint32_t sp);
58
59#endif
60