/* ------------------------------------------ * Copyright (c) 2016, Synopsys, Inc. All rights reserved. * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1) Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2) Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation and/or * other materials provided with the distribution. * 3) Neither the name of the Synopsys, Inc., nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * \version 2016.05 * \date 2014-06-20 * \author Wayne Ren(Wei.Ren@synopsys.com) --------------------------------------------- */ /** * \file * \ingroup ARC_HAL_CORE_COMM * \brief header file including common core definitions */ /** * \addtogroup ARC_HAL_CORE_COMM * @{ */ #ifndef _ARC_HAL_CORE_H_ #define _ARC_HAL_CORE_H_ #include "inc/arc/arc_feature_config.h" /** * \name exception number definitions * @{ */ /* ARC exception number */ #define EXC_NO_RESET (0) /*!< reset vector, the entry of power up and reset */ #define EXC_NO_MEM_ERR (1) /*!< external memory bus error */ #define EXC_NO_INS_ERR (2) /*!< illegal instruction or illegal instruction sequence */ #define EXC_NO_MAC_CHK (3) /*!< machine check error */ #define EXC_NO_TLB_MISS_I (4) /*!< instruction TLB missing exception, useless without MMU */ #define EXC_NO_TLB_MISS_D (5) /*!< data TLB missing exception, useless without MMU */ #define EXC_NO_PRO_VIO (6) /*!< protection violation */ #define EXC_NO_PRI_VIO (7) /*!< privilege violation */ #define EXC_NO_SWI (8) /*!< software interrupt */ #define EXC_NO_TRAP (9) /*!< trap */ #define EXC_NO_EXT (10) /*!< extension exception */ #define EXC_NO_DIV_ZER0 (11) /*!< divide by zero */ #define EXC_NO_DC_ERR (12) /*!< data cache consistency error */ #define EXC_NO_MAL_ALIGN (13) /*!< misaligned data access */ #define EXC_NO_RESERVE0 (14) /*!< reserved */ #define EXC_NO_RESERVE1 (15) /*!< reserved */ /* extension interrupts */ #define EXC_NO_16 (16) /*!< interrupt vector 16 */ #define EXC_NO_17 (17) /*!< interrupt vector 17 */ #define EXC_NO_18 (18) /*!< interrupt vector 18 */ #define EXC_NO_19 (19) /*!< interrupt vector 19 */ #define EXC_NO_20 (20) /*!< interrupt vector 20 */ #define EXC_NO_21 (21) /*!< interrupt vector 21 */ #define EXC_NO_22 (22) /*!< interrupt vector 22 */ #define EXC_NO_23 (23) /*!< interrupt vector 23 */ #define EXC_NO_24 (24) /*!< interrupt vector 24 */ #define EXC_NO_25 (25) /*!< interrupt vector 25 */ #define EXC_NO_26 (26) /*!< interrupt vector 26 */ #define EXC_NO_27 (27) /*!< interrupt vector 27 */ #define EXC_NO_28 (28) /*!< interrupt vector 28 */ #define EXC_NO_29 (29) /*!< interrupt vector 29 */ #define EXC_NO_30 (30) /*!< interrupt vector 30 */ #define EXC_NO_31 (31) /*!< interrupt vector 31 */ /* ... ARC supports 255 interrupt vectors at most */ #define EXC_NO_255 (255) /*!< interrupt vector 255 */ /** @} */ /** * \name exception vector offset * @{ */ #define EXC_NO_TO_OFFSET(no) (no << 2) /* ARC exception vector offset */ #define EXC_VECTOR_RESET (0x00) /*!< EXC_NO_RESET offset */ #define EXC_VECTOR_MEM_ERR (0x04) /*!< EXC_NO_MEM_ERR offset */ #define EXC_VECTOR_INS_ERR (0x08) /*!< EXC_NO_INS_ERR offset */ #define EXC_VECTOR_MAC_CHK (0x0c) /*!< EXC_NO_MAC_CHK offset */ #define EXC_VECTOR_TLB_MISS_I (0x10) /*!< EXC_NO_TLB_MISS_I offset */ #define EXC_VECTOR_TLB_MISS_D (0x14) /*!< EXC_NO_TLB_MISS_D offset */ #define EXC_VECTOR_PRO_VIO (0x18) /*!< EXC_NO_PRO_VIO offset */ #define EXC_VECTOR_PRI_VIO (0x1c) /*!< EXC_NO_PRI_VIO offset */ #define EXC_VECTOR_SWI (0x20) /*!< EXC_NO_SWI offset */ #define EXC_VECTOR_TRAP (0x24) /*!< EXC_NO_TRAP offset */ #define EXC_VECTOR_EXT (0x28) /*!< EXC_NO_EXT offset */ #define EXC_VECTOR_DIV_ZER0 (0x2c) /*!< EXC_NO_DIV_ZER0 offset */ #define EXC_VECTOR_DC_ERR (0x30) /*!< EXC_NO_DC_ERR offset */ #define EXC_VECTOR_MAL_ALIGN (0x34) /*!< EXC_NO_MAL_ALIGN offset */ #define EXC_VECTOR_RESERVE0 (0x38) /*!< EXC_NO_RESERVE0 offset */ #define EXC_VECTOR_RESERVE1 (0x3c) /*!< EXC_NO_RESERVE1 offset */ /** @} */ /** * \name build configuration register * @{ */ #define AUX_BCR_VER (0x60) /*!< build configuration register version */ #define AUX_BCR_BTA (0x63) /*!< build configuration for BTA LINK */ #define AUX_BCR_VECBASE (0x68) /*!< build configuration for interrupt vector base */ #define AUX_BCR_MPU (0x6d) /*!< build configuration for memory protection unit */ #define AUX_BCR_RF (0x6e) /*!< build configuration for core registers */ #define AUX_BCR_D_CACHE (0x72) /*!< build configuration for data cache */ #define AUX_BCR_DCCM (0x74) /*!< build configuration for DCCM */ #define AUX_BCR_TIMERS (0x75) /*!< build configuration for processor timers */ #define AUX_BCR_AP (0x76) /*!< build configuration for actionpoints */ #define AUX_BCR_I_CACHE (0x77) /*!< build configuration for instruction cache */ #define AUX_BCR_ICCM (0x78) /*!< build configuration for ICCM */ #define AUX_BCR_DSP (0x7a) /*!< build configuration for DSP */ #define AUX_BCR_MUL (0x7b) /*!< build configuration for multiply */ #define AUX_BCR_SWAP (0x7c) /*!< build configuration for swap */ #define AUX_BCR_NORM (0x7d) /*!< build configuration for normalize */ #define AUX_BCR_MIXMAX (0x7e) /*!< build configuration for MIN/MAX */ #define AUX_BCR_BARREL (0x7f) /*!< build configuration for barrel shift */ #define AUX_BCR_ISA (0xc1) /*!< build configuration for ISA configuration */ #define AUX_BCR_STACK (0xc5) /*!< build configuration for stack region */ #define AUX_BCR_ERP (0xc7) /*!< build configuration for error protection */ #define AUX_BCR_FPU (0xc8) /*!< build configuration for floating-point unit */ #define AUX_BCR_CPORT (0xc9) /*!< build configuration for code protection */ #define AUX_BCR_BS (0xcb) /*!< build configuration for bitstream */ #define AUX_BCR_AGU (0xcc) /*!< build configuration for address generate unit */ #define AUX_BCR_DMAC (0xcd) /*!< build configuration for DMA */ #define AUX_BCR_CONNECT_SYSTEM (0xd0) /*!< build configuration for arc connect */ #define AUX_BCR_CONNECT_SEMA (0xd1) /*!< build configuration for inter-core semaphore */ #define AUX_BCR_CONNECT_MESSAGE (0xd2) /*!< build configuration for inter-code message */ #define AUX_BCR_CONNECT_PMU (0xd3) /*!< build configuration for power management unit */ #define AUX_BCR_CONNECT_GFRC (0xd6) /*!< build configuration for global free running counter */ #define AUX_BCR_CAL_STORE (0xd9) /*!< build configuration for calibration parameter storage */ #define AUX_BCR_CONNECT_ICI (0xe0) /*!< build configuration for inter-core interrupt unit */ #define AUX_BCR_CONNECT_ICD (0xe1) /*!< build configuration for inter-core debug unit */ #define AUX_BCR_CONNECT_PDM (0xe3) /*!< build configuration for power domain management unit*/ #define AUX_BCR_RTT (0xf2) /*!< build configuration for real-time trace */ #define AUX_BCR_IRQ (0xf3) /*!< build configuration for interrupt */ #define AUX_BCR_PCT (0xf5) /*!< build configuration for performance counters */ #define AUX_BCR_CC (0xf6) /*!< build configuration for performance counters */ #define AUX_BCR_PDM_DVFS (0xf7) /*!< build configuration for PDM and DVFS */ #define AUX_BCR_SEC_BUILD (0xdb) /* from 0xF5 and 0xF6 */ #define AUX_BCR_IFQUEUE (0xfe) /*!< build configuration for instruction fetch queue */ #define AUX_BCR_SMART (0xff) /*!< build configuration for SmaRT debug feature */ /** @} */ #define AUX_SEC_STAT (0x9) #define AUX_SEC_STAT_BIT_SSC (0) #define AUX_SEC_STAT_BIT_NSRT (1) #define AUX_SEC_STAT_BIT_NSRU (2) #define AUX_SEC_STAT_BIT_IRM (3) #define AUX_SEC_STAT_BIT_SUE (4) #define AUX_SEC_STAT_BIT_NIC (5) /** * \name status register STATUS32 * @{ */ #define AUX_STATUS32 (0xa) #define AUX_STATUS32_P0 (0xb) /* STATUS32 bit-field definition */ #define AUX_STATUS_BIT_AE (5) /*!< processor is in an exception */ #define AUX_STATUS_BIT_DE (6) /*!< delayed branch is pending */ #define AUX_STATUS_BIT_U (7) /*!< user mode */ #define AUX_STATUS_BIT_L (12) /*!< zero-overhead loop enable */ #define AUX_STATUS_BIT_IE (31) /*!< interrupt enable */ /* masks correspond to STATUS32 bit-field */ #define AUX_STATUS_MASK_AE (1<