1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */ 2c978b524SChris Zankel /* 3c978b524SChris Zankel * Copyright (c) 2006 Tensilica, Inc. All Rights Reserved. 4c978b524SChris Zankel */ 5c978b524SChris Zankel 6c978b524SChris Zankel #ifndef _XTENSA_REGS_H 7c978b524SChris Zankel #define _XTENSA_REGS_H 8c978b524SChris Zankel 9c978b524SChris Zankel /* Special registers */ 10c978b524SChris Zankel 11c978b524SChris Zankel #define IBREAKA 128 12c978b524SChris Zankel #define DBREAKA 144 13c978b524SChris Zankel #define DBREAKC 160 14c978b524SChris Zankel 15c978b524SChris Zankel /* Special names for read-only and write-only interrupt registers */ 16c978b524SChris Zankel 17c978b524SChris Zankel #define INTREAD 226 18c978b524SChris Zankel #define INTSET 226 19c978b524SChris Zankel #define INTCLEAR 227 20c978b524SChris Zankel 21c978b524SChris Zankel /* EXCCAUSE register fields */ 22c978b524SChris Zankel 23c978b524SChris Zankel #define EXCCAUSE_EXCCAUSE_SHIFT 0 24c978b524SChris Zankel #define EXCCAUSE_EXCCAUSE_MASK 0x3F 25c978b524SChris Zankel 26c978b524SChris Zankel #define EXCCAUSE_ILLEGAL_INSTRUCTION 0 27c978b524SChris Zankel #define EXCCAUSE_SYSTEM_CALL 1 28c978b524SChris Zankel #define EXCCAUSE_INSTRUCTION_FETCH_ERROR 2 29c978b524SChris Zankel #define EXCCAUSE_LOAD_STORE_ERROR 3 30c978b524SChris Zankel #define EXCCAUSE_LEVEL1_INTERRUPT 4 31c978b524SChris Zankel #define EXCCAUSE_ALLOCA 5 32c978b524SChris Zankel #define EXCCAUSE_INTEGER_DIVIDE_BY_ZERO 6 33c978b524SChris Zankel #define EXCCAUSE_SPECULATION 7 34c978b524SChris Zankel #define EXCCAUSE_PRIVILEGED 8 35c978b524SChris Zankel #define EXCCAUSE_UNALIGNED 9 36c978b524SChris Zankel #define EXCCAUSE_INSTR_DATA_ERROR 12 37c978b524SChris Zankel #define EXCCAUSE_LOAD_STORE_DATA_ERROR 13 38c978b524SChris Zankel #define EXCCAUSE_INSTR_ADDR_ERROR 14 39c978b524SChris Zankel #define EXCCAUSE_LOAD_STORE_ADDR_ERROR 15 40c978b524SChris Zankel #define EXCCAUSE_ITLB_MISS 16 41c978b524SChris Zankel #define EXCCAUSE_ITLB_MULTIHIT 17 42c978b524SChris Zankel #define EXCCAUSE_ITLB_PRIVILEGE 18 43c978b524SChris Zankel #define EXCCAUSE_ITLB_SIZE_RESTRICTION 19 44c978b524SChris Zankel #define EXCCAUSE_FETCH_CACHE_ATTRIBUTE 20 45c978b524SChris Zankel #define EXCCAUSE_DTLB_MISS 24 46c978b524SChris Zankel #define EXCCAUSE_DTLB_MULTIHIT 25 47c978b524SChris Zankel #define EXCCAUSE_DTLB_PRIVILEGE 26 48c978b524SChris Zankel #define EXCCAUSE_DTLB_SIZE_RESTRICTION 27 49c978b524SChris Zankel #define EXCCAUSE_LOAD_CACHE_ATTRIBUTE 28 50c978b524SChris Zankel #define EXCCAUSE_STORE_CACHE_ATTRIBUTE 29 51c978b524SChris Zankel #define EXCCAUSE_COPROCESSOR0_DISABLED 32 52c978b524SChris Zankel #define EXCCAUSE_COPROCESSOR1_DISABLED 33 53c978b524SChris Zankel #define EXCCAUSE_COPROCESSOR2_DISABLED 34 54c978b524SChris Zankel #define EXCCAUSE_COPROCESSOR3_DISABLED 35 55c978b524SChris Zankel #define EXCCAUSE_COPROCESSOR4_DISABLED 36 56c978b524SChris Zankel #define EXCCAUSE_COPROCESSOR5_DISABLED 37 57c978b524SChris Zankel #define EXCCAUSE_COPROCESSOR6_DISABLED 38 58c978b524SChris Zankel #define EXCCAUSE_COPROCESSOR7_DISABLED 39 59c978b524SChris Zankel #define EXCCAUSE_LAST 63 60c978b524SChris Zankel 61c978b524SChris Zankel /* PS register fields */ 62c978b524SChris Zankel 63c978b524SChris Zankel #define PS_WOE_BIT 18 64c978b524SChris Zankel #define PS_CALLINC_SHIFT 16 65c978b524SChris Zankel #define PS_CALLINC_MASK 0x00030000 66c978b524SChris Zankel #define PS_OWB_SHIFT 8 67c978b524SChris Zankel #define PS_OWB_MASK 0x00000F00 68c978b524SChris Zankel #define PS_RING_SHIFT 6 69c978b524SChris Zankel #define PS_RING_MASK 0x000000C0 70c978b524SChris Zankel #define PS_UM_BIT 5 71c978b524SChris Zankel #define PS_EXCM_BIT 4 72c978b524SChris Zankel #define PS_INTLEVEL_SHIFT 0 73c978b524SChris Zankel #define PS_INTLEVEL_MASK 0x0000000F 74c978b524SChris Zankel 75c978b524SChris Zankel /* DBREAKCn register fields */ 76c978b524SChris Zankel 77c978b524SChris Zankel #define DBREAKC_MASK_BIT 0 78c978b524SChris Zankel #define DBREAKC_MASK_MASK 0x0000003F 79c978b524SChris Zankel #define DBREAKC_LOAD_BIT 30 80c978b524SChris Zankel #define DBREAKC_LOAD_MASK 0x40000000 81c978b524SChris Zankel #define DBREAKC_STOR_BIT 31 82c978b524SChris Zankel #define DBREAKC_STOR_MASK 0x80000000 83c978b524SChris Zankel 84c978b524SChris Zankel /* DEBUGCAUSE register fields */ 85c978b524SChris Zankel 86c978b524SChris Zankel #define DEBUGCAUSE_DEBUGINT_BIT 5 /* External debug interrupt */ 87c978b524SChris Zankel #define DEBUGCAUSE_BREAKN_BIT 4 /* BREAK.N instruction */ 88c978b524SChris Zankel #define DEBUGCAUSE_BREAK_BIT 3 /* BREAK instruction */ 89c978b524SChris Zankel #define DEBUGCAUSE_DBREAK_BIT 2 /* DBREAK match */ 90c978b524SChris Zankel #define DEBUGCAUSE_IBREAK_BIT 1 /* IBREAK match */ 91c978b524SChris Zankel #define DEBUGCAUSE_ICOUNT_BIT 0 /* ICOUNT would incr. to zero */ 92c978b524SChris Zankel 93c978b524SChris Zankel #endif /* _XTENSA_SPECREG_H */ 94c978b524SChris Zankel 95