1 // Copyright (C) 2022 Beken Corporation 2 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // you may not use this file except in compliance with the License. 4 // You may obtain a copy of the License at 5 // 6 // http://www.apache.org/licenses/LICENSE-2.0 7 // 8 // Unless required by applicable law or agreed to in writing, software 9 // distributed under the License is distributed on an "AS IS" BASIS, 10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // See the License for the specific language governing permissions and 12 // limitations under the License. 13 14 #ifndef _SOC_H 15 #define _SOC_H 16 17 #include "soc_common.h" 18 19 #define RISCV_PLIC_VECTOR_CNT (63) 20 #define RISCV_SYS_MAX_IRQ (0) 21 22 #define F_LREG flw 23 #define F_SREG fsw 24 25 #define FREGBYTES 4 26 27 #ifndef REGBYTES 28 #define REGBYTES 4 29 #endif 30 31 #ifdef __riscv_flen 32 #define FPU_CONTEXT_SIZE (2 + 32 * (FREGBYTES / REGBYTES)) /* (ucode,fcsr,f0~f31) */ 33 #else 34 #define FPU_CONTEXT_SIZE (2) 35 #endif 36 37 38 #ifndef MTIMER 39 #define MTIMER 0xE6000000 40 #endif 41 #ifndef MTIMERCMP 42 #define MTIMERCMP 0xE6000008 43 #endif 44 #endif 45