1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2a439fe51SSam Ravnborg #ifndef _SPARC64_SFAFSR_H 3a439fe51SSam Ravnborg #define _SPARC64_SFAFSR_H 4a439fe51SSam Ravnborg 5a439fe51SSam Ravnborg #include <linux/const.h> 6a439fe51SSam Ravnborg 7a439fe51SSam Ravnborg /* Spitfire Asynchronous Fault Status register, ASI=0x4C VA<63:0>=0x0 */ 8a439fe51SSam Ravnborg 9a439fe51SSam Ravnborg #define SFAFSR_ME (_AC(1,UL) << SFAFSR_ME_SHIFT) 10a439fe51SSam Ravnborg #define SFAFSR_ME_SHIFT 32 11a439fe51SSam Ravnborg #define SFAFSR_PRIV (_AC(1,UL) << SFAFSR_PRIV_SHIFT) 12a439fe51SSam Ravnborg #define SFAFSR_PRIV_SHIFT 31 13a439fe51SSam Ravnborg #define SFAFSR_ISAP (_AC(1,UL) << SFAFSR_ISAP_SHIFT) 14a439fe51SSam Ravnborg #define SFAFSR_ISAP_SHIFT 30 15a439fe51SSam Ravnborg #define SFAFSR_ETP (_AC(1,UL) << SFAFSR_ETP_SHIFT) 16a439fe51SSam Ravnborg #define SFAFSR_ETP_SHIFT 29 17a439fe51SSam Ravnborg #define SFAFSR_IVUE (_AC(1,UL) << SFAFSR_IVUE_SHIFT) 18a439fe51SSam Ravnborg #define SFAFSR_IVUE_SHIFT 28 19a439fe51SSam Ravnborg #define SFAFSR_TO (_AC(1,UL) << SFAFSR_TO_SHIFT) 20a439fe51SSam Ravnborg #define SFAFSR_TO_SHIFT 27 21a439fe51SSam Ravnborg #define SFAFSR_BERR (_AC(1,UL) << SFAFSR_BERR_SHIFT) 22a439fe51SSam Ravnborg #define SFAFSR_BERR_SHIFT 26 23a439fe51SSam Ravnborg #define SFAFSR_LDP (_AC(1,UL) << SFAFSR_LDP_SHIFT) 24a439fe51SSam Ravnborg #define SFAFSR_LDP_SHIFT 25 25a439fe51SSam Ravnborg #define SFAFSR_CP (_AC(1,UL) << SFAFSR_CP_SHIFT) 26a439fe51SSam Ravnborg #define SFAFSR_CP_SHIFT 24 27a439fe51SSam Ravnborg #define SFAFSR_WP (_AC(1,UL) << SFAFSR_WP_SHIFT) 28a439fe51SSam Ravnborg #define SFAFSR_WP_SHIFT 23 29a439fe51SSam Ravnborg #define SFAFSR_EDP (_AC(1,UL) << SFAFSR_EDP_SHIFT) 30a439fe51SSam Ravnborg #define SFAFSR_EDP_SHIFT 22 31a439fe51SSam Ravnborg #define SFAFSR_UE (_AC(1,UL) << SFAFSR_UE_SHIFT) 32a439fe51SSam Ravnborg #define SFAFSR_UE_SHIFT 21 33a439fe51SSam Ravnborg #define SFAFSR_CE (_AC(1,UL) << SFAFSR_CE_SHIFT) 34a439fe51SSam Ravnborg #define SFAFSR_CE_SHIFT 20 35a439fe51SSam Ravnborg #define SFAFSR_ETS (_AC(0xf,UL) << SFAFSR_ETS_SHIFT) 36a439fe51SSam Ravnborg #define SFAFSR_ETS_SHIFT 16 37a439fe51SSam Ravnborg #define SFAFSR_PSYND (_AC(0xffff,UL) << SFAFSR_PSYND_SHIFT) 38a439fe51SSam Ravnborg #define SFAFSR_PSYND_SHIFT 0 39a439fe51SSam Ravnborg 40a439fe51SSam Ravnborg /* UDB Error Register, ASI=0x7f VA<63:0>=0x0(High),0x18(Low) for read 41a439fe51SSam Ravnborg * ASI=0x77 VA<63:0>=0x0(High),0x18(Low) for write 42a439fe51SSam Ravnborg */ 43a439fe51SSam Ravnborg 44a439fe51SSam Ravnborg #define UDBE_UE (_AC(1,UL) << 9) 45a439fe51SSam Ravnborg #define UDBE_CE (_AC(1,UL) << 8) 46a439fe51SSam Ravnborg #define UDBE_E_SYNDR (_AC(0xff,UL) << 0) 47a439fe51SSam Ravnborg 48a439fe51SSam Ravnborg /* The trap handlers for asynchronous errors encode the AFSR and 49a439fe51SSam Ravnborg * other pieces of information into a 64-bit argument for C code 50a439fe51SSam Ravnborg * encoded as follows: 51a439fe51SSam Ravnborg * 52a439fe51SSam Ravnborg * ----------------------------------------------- 53a439fe51SSam Ravnborg * | UDB_H | UDB_L | TL>1 | TT | AFSR | 54a439fe51SSam Ravnborg * ----------------------------------------------- 55a439fe51SSam Ravnborg * 63 54 53 44 42 41 33 32 0 56a439fe51SSam Ravnborg * 57a439fe51SSam Ravnborg * The AFAR is passed in unchanged. 58a439fe51SSam Ravnborg */ 59a439fe51SSam Ravnborg #define SFSTAT_UDBH_MASK (_AC(0x3ff,UL) << SFSTAT_UDBH_SHIFT) 60a439fe51SSam Ravnborg #define SFSTAT_UDBH_SHIFT 54 61a439fe51SSam Ravnborg #define SFSTAT_UDBL_MASK (_AC(0x3ff,UL) << SFSTAT_UDBH_SHIFT) 62a439fe51SSam Ravnborg #define SFSTAT_UDBL_SHIFT 44 63a439fe51SSam Ravnborg #define SFSTAT_TL_GT_ONE (_AC(1,UL) << SFSTAT_TL_GT_ONE_SHIFT) 64a439fe51SSam Ravnborg #define SFSTAT_TL_GT_ONE_SHIFT 42 65a439fe51SSam Ravnborg #define SFSTAT_TRAP_TYPE (_AC(0x1FF,UL) << SFSTAT_TRAP_TYPE_SHIFT) 66a439fe51SSam Ravnborg #define SFSTAT_TRAP_TYPE_SHIFT 33 67a439fe51SSam Ravnborg #define SFSTAT_AFSR_MASK (_AC(0x1ffffffff,UL) << SFSTAT_AFSR_SHIFT) 68a439fe51SSam Ravnborg #define SFSTAT_AFSR_SHIFT 0 69a439fe51SSam Ravnborg 70a439fe51SSam Ravnborg /* ESTATE Error Enable Register, ASI=0x4b VA<63:0>=0x0 */ 71a439fe51SSam Ravnborg #define ESTATE_ERR_CE 0x1 /* Correctable errors */ 72a439fe51SSam Ravnborg #define ESTATE_ERR_NCE 0x2 /* TO, BERR, LDP, ETP, EDP, WP, UE, IVUE */ 73a439fe51SSam Ravnborg #define ESTATE_ERR_ISAP 0x4 /* System address parity error */ 74a439fe51SSam Ravnborg #define ESTATE_ERR_ALL (ESTATE_ERR_CE | \ 75a439fe51SSam Ravnborg ESTATE_ERR_NCE | \ 76a439fe51SSam Ravnborg ESTATE_ERR_ISAP) 77a439fe51SSam Ravnborg 78a439fe51SSam Ravnborg /* The various trap types that report using the above state. */ 79a439fe51SSam Ravnborg #define TRAP_TYPE_IAE 0x09 /* Instruction Access Error */ 80a439fe51SSam Ravnborg #define TRAP_TYPE_DAE 0x32 /* Data Access Error */ 81a439fe51SSam Ravnborg #define TRAP_TYPE_CEE 0x63 /* Correctable ECC Error */ 82a439fe51SSam Ravnborg 83a439fe51SSam Ravnborg #endif /* _SPARC64_SFAFSR_H */ 84