• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 HPMicro
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef _SOC_H
17 #define _SOC_H
18 #include "soc_common.h"
19 
20 /*
21  * Get the response interrupt number via mcause.
22  * id = mcause & MCAUSE_INT_ID_MASK
23  */
24 #define MCAUSE_INT_ID_MASK                            0x7FFFFFF
25 #define MSIP                                          0x2000000
26 #define MTIMERCMP                                     0xE6000008UL
27 #define MTIMER                                        0xE6000000UL
28 
29 
30 #define RISCV_SYS_MAX_IRQ                              11
31 #define RISCV_PLIC_VECTOR_CNT                          127
32 
33 #define HPM2LITEOS_IRQ(hpm_irq) (hpm_irq + RISCV_SYS_MAX_IRQ)
34 #define LITEOS2HPM_IRQ(liteos_irq) (liteos_irq - RISCV_SYS_MAX_IRQ)
35 
36 #endif
37