162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * OpenRISC Linux
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * SPR Definitions
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * Copyright (C) 2000 Damjan Lampret
862306a36Sopenharmony_ci * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
962306a36Sopenharmony_ci * Copyright (C) 2008, 2010 Embecosm Limited
1062306a36Sopenharmony_ci * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
1162306a36Sopenharmony_ci * et al.
1262306a36Sopenharmony_ci *
1362306a36Sopenharmony_ci * This file is part of OpenRISC 1000 Architectural Simulator.
1462306a36Sopenharmony_ci */
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci#ifndef SPR_DEFS__H
1762306a36Sopenharmony_ci#define SPR_DEFS__H
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci/* Definition of special-purpose registers (SPRs). */
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci#define MAX_GRPS (32)
2262306a36Sopenharmony_ci#define MAX_SPRS_PER_GRP_BITS (11)
2362306a36Sopenharmony_ci#define MAX_SPRS_PER_GRP (1 << MAX_SPRS_PER_GRP_BITS)
2462306a36Sopenharmony_ci#define MAX_SPRS (0x10000)
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci/* Base addresses for the groups */
2762306a36Sopenharmony_ci#define SPRGROUP_SYS	(0 << MAX_SPRS_PER_GRP_BITS)
2862306a36Sopenharmony_ci#define SPRGROUP_DMMU	(1 << MAX_SPRS_PER_GRP_BITS)
2962306a36Sopenharmony_ci#define SPRGROUP_IMMU	(2 << MAX_SPRS_PER_GRP_BITS)
3062306a36Sopenharmony_ci#define SPRGROUP_DC	(3 << MAX_SPRS_PER_GRP_BITS)
3162306a36Sopenharmony_ci#define SPRGROUP_IC	(4 << MAX_SPRS_PER_GRP_BITS)
3262306a36Sopenharmony_ci#define SPRGROUP_MAC	(5 << MAX_SPRS_PER_GRP_BITS)
3362306a36Sopenharmony_ci#define SPRGROUP_D	(6 << MAX_SPRS_PER_GRP_BITS)
3462306a36Sopenharmony_ci#define SPRGROUP_PC	(7 << MAX_SPRS_PER_GRP_BITS)
3562306a36Sopenharmony_ci#define SPRGROUP_PM	(8 << MAX_SPRS_PER_GRP_BITS)
3662306a36Sopenharmony_ci#define SPRGROUP_PIC	(9 << MAX_SPRS_PER_GRP_BITS)
3762306a36Sopenharmony_ci#define SPRGROUP_TT	(10 << MAX_SPRS_PER_GRP_BITS)
3862306a36Sopenharmony_ci#define SPRGROUP_FP	(11 << MAX_SPRS_PER_GRP_BITS)
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci/* System control and status group */
4162306a36Sopenharmony_ci#define SPR_VR		(SPRGROUP_SYS + 0)
4262306a36Sopenharmony_ci#define SPR_UPR		(SPRGROUP_SYS + 1)
4362306a36Sopenharmony_ci#define SPR_CPUCFGR	(SPRGROUP_SYS + 2)
4462306a36Sopenharmony_ci#define SPR_DMMUCFGR	(SPRGROUP_SYS + 3)
4562306a36Sopenharmony_ci#define SPR_IMMUCFGR	(SPRGROUP_SYS + 4)
4662306a36Sopenharmony_ci#define SPR_DCCFGR	(SPRGROUP_SYS + 5)
4762306a36Sopenharmony_ci#define SPR_ICCFGR	(SPRGROUP_SYS + 6)
4862306a36Sopenharmony_ci#define SPR_DCFGR	(SPRGROUP_SYS + 7)
4962306a36Sopenharmony_ci#define SPR_PCCFGR	(SPRGROUP_SYS + 8)
5062306a36Sopenharmony_ci#define SPR_VR2		(SPRGROUP_SYS + 9)
5162306a36Sopenharmony_ci#define SPR_AVR		(SPRGROUP_SYS + 10)
5262306a36Sopenharmony_ci#define SPR_EVBAR	(SPRGROUP_SYS + 11)
5362306a36Sopenharmony_ci#define SPR_AECR	(SPRGROUP_SYS + 12)
5462306a36Sopenharmony_ci#define SPR_AESR	(SPRGROUP_SYS + 13)
5562306a36Sopenharmony_ci#define SPR_NPC         (SPRGROUP_SYS + 16)  /* CZ 21/06/01 */
5662306a36Sopenharmony_ci#define SPR_SR		(SPRGROUP_SYS + 17)  /* CZ 21/06/01 */
5762306a36Sopenharmony_ci#define SPR_PPC         (SPRGROUP_SYS + 18)  /* CZ 21/06/01 */
5862306a36Sopenharmony_ci#define SPR_FPCSR       (SPRGROUP_SYS + 20)  /* CZ 21/06/01 */
5962306a36Sopenharmony_ci#define SPR_EPCR_BASE	(SPRGROUP_SYS + 32)  /* CZ 21/06/01 */
6062306a36Sopenharmony_ci#define SPR_EPCR_LAST	(SPRGROUP_SYS + 47)  /* CZ 21/06/01 */
6162306a36Sopenharmony_ci#define SPR_EEAR_BASE	(SPRGROUP_SYS + 48)
6262306a36Sopenharmony_ci#define SPR_EEAR_LAST	(SPRGROUP_SYS + 63)
6362306a36Sopenharmony_ci#define SPR_ESR_BASE	(SPRGROUP_SYS + 64)
6462306a36Sopenharmony_ci#define SPR_ESR_LAST	(SPRGROUP_SYS + 79)
6562306a36Sopenharmony_ci#define SPR_COREID	(SPRGROUP_SYS + 128)
6662306a36Sopenharmony_ci#define SPR_NUMCORES	(SPRGROUP_SYS + 129)
6762306a36Sopenharmony_ci#define SPR_GPR_BASE	(SPRGROUP_SYS + 1024)
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci/* Data MMU group */
7062306a36Sopenharmony_ci#define SPR_DMMUCR	(SPRGROUP_DMMU + 0)
7162306a36Sopenharmony_ci#define SPR_DTLBEIR	(SPRGROUP_DMMU + 2)
7262306a36Sopenharmony_ci#define SPR_DTLBMR_BASE(WAY)	(SPRGROUP_DMMU + 0x200 + (WAY) * 0x100)
7362306a36Sopenharmony_ci#define SPR_DTLBMR_LAST(WAY)	(SPRGROUP_DMMU + 0x27f + (WAY) * 0x100)
7462306a36Sopenharmony_ci#define SPR_DTLBTR_BASE(WAY)	(SPRGROUP_DMMU + 0x280 + (WAY) * 0x100)
7562306a36Sopenharmony_ci#define SPR_DTLBTR_LAST(WAY)	(SPRGROUP_DMMU + 0x2ff + (WAY) * 0x100)
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci/* Instruction MMU group */
7862306a36Sopenharmony_ci#define SPR_IMMUCR	(SPRGROUP_IMMU + 0)
7962306a36Sopenharmony_ci#define SPR_ITLBEIR	(SPRGROUP_IMMU + 2)
8062306a36Sopenharmony_ci#define SPR_ITLBMR_BASE(WAY)	(SPRGROUP_IMMU + 0x200 + (WAY) * 0x100)
8162306a36Sopenharmony_ci#define SPR_ITLBMR_LAST(WAY)	(SPRGROUP_IMMU + 0x27f + (WAY) * 0x100)
8262306a36Sopenharmony_ci#define SPR_ITLBTR_BASE(WAY)	(SPRGROUP_IMMU + 0x280 + (WAY) * 0x100)
8362306a36Sopenharmony_ci#define SPR_ITLBTR_LAST(WAY)	(SPRGROUP_IMMU + 0x2ff + (WAY) * 0x100)
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci/* Data cache group */
8662306a36Sopenharmony_ci#define SPR_DCCR	(SPRGROUP_DC + 0)
8762306a36Sopenharmony_ci#define SPR_DCBPR	(SPRGROUP_DC + 1)
8862306a36Sopenharmony_ci#define SPR_DCBFR	(SPRGROUP_DC + 2)
8962306a36Sopenharmony_ci#define SPR_DCBIR	(SPRGROUP_DC + 3)
9062306a36Sopenharmony_ci#define SPR_DCBWR	(SPRGROUP_DC + 4)
9162306a36Sopenharmony_ci#define SPR_DCBLR	(SPRGROUP_DC + 5)
9262306a36Sopenharmony_ci#define SPR_DCR_BASE(WAY)	(SPRGROUP_DC + 0x200 + (WAY) * 0x200)
9362306a36Sopenharmony_ci#define SPR_DCR_LAST(WAY)	(SPRGROUP_DC + 0x3ff + (WAY) * 0x200)
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ci/* Instruction cache group */
9662306a36Sopenharmony_ci#define SPR_ICCR	(SPRGROUP_IC + 0)
9762306a36Sopenharmony_ci#define SPR_ICBPR	(SPRGROUP_IC + 1)
9862306a36Sopenharmony_ci#define SPR_ICBIR	(SPRGROUP_IC + 2)
9962306a36Sopenharmony_ci#define SPR_ICBLR	(SPRGROUP_IC + 3)
10062306a36Sopenharmony_ci#define SPR_ICR_BASE(WAY)	(SPRGROUP_IC + 0x200 + (WAY) * 0x200)
10162306a36Sopenharmony_ci#define SPR_ICR_LAST(WAY)	(SPRGROUP_IC + 0x3ff + (WAY) * 0x200)
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_ci/* MAC group */
10462306a36Sopenharmony_ci#define SPR_MACLO	(SPRGROUP_MAC + 1)
10562306a36Sopenharmony_ci#define SPR_MACHI	(SPRGROUP_MAC + 2)
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_ci/* Debug group */
10862306a36Sopenharmony_ci#define SPR_DVR(N)	(SPRGROUP_D + (N))
10962306a36Sopenharmony_ci#define SPR_DCR(N)	(SPRGROUP_D + 8 + (N))
11062306a36Sopenharmony_ci#define SPR_DMR1	(SPRGROUP_D + 16)
11162306a36Sopenharmony_ci#define SPR_DMR2	(SPRGROUP_D + 17)
11262306a36Sopenharmony_ci#define SPR_DWCR0	(SPRGROUP_D + 18)
11362306a36Sopenharmony_ci#define SPR_DWCR1	(SPRGROUP_D + 19)
11462306a36Sopenharmony_ci#define SPR_DSR		(SPRGROUP_D + 20)
11562306a36Sopenharmony_ci#define SPR_DRR		(SPRGROUP_D + 21)
11662306a36Sopenharmony_ci
11762306a36Sopenharmony_ci/* Performance counters group */
11862306a36Sopenharmony_ci#define SPR_PCCR(N)	(SPRGROUP_PC + (N))
11962306a36Sopenharmony_ci#define SPR_PCMR(N)	(SPRGROUP_PC + 8 + (N))
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci/* Power management group */
12262306a36Sopenharmony_ci#define SPR_PMR (SPRGROUP_PM + 0)
12362306a36Sopenharmony_ci
12462306a36Sopenharmony_ci/* PIC group */
12562306a36Sopenharmony_ci#define SPR_PICMR (SPRGROUP_PIC + 0)
12662306a36Sopenharmony_ci#define SPR_PICPR (SPRGROUP_PIC + 1)
12762306a36Sopenharmony_ci#define SPR_PICSR (SPRGROUP_PIC + 2)
12862306a36Sopenharmony_ci
12962306a36Sopenharmony_ci/* Tick Timer group */
13062306a36Sopenharmony_ci#define SPR_TTMR (SPRGROUP_TT + 0)
13162306a36Sopenharmony_ci#define SPR_TTCR (SPRGROUP_TT + 1)
13262306a36Sopenharmony_ci
13362306a36Sopenharmony_ci/*
13462306a36Sopenharmony_ci * Bit definitions for the Version Register
13562306a36Sopenharmony_ci *
13662306a36Sopenharmony_ci */
13762306a36Sopenharmony_ci#define SPR_VR_VER	0xff000000  /* Processor version */
13862306a36Sopenharmony_ci#define SPR_VR_CFG	0x00ff0000  /* Processor configuration */
13962306a36Sopenharmony_ci#define SPR_VR_RES	0x0000ffc0  /* Reserved */
14062306a36Sopenharmony_ci#define SPR_VR_REV	0x0000003f  /* Processor revision */
14162306a36Sopenharmony_ci#define SPR_VR_UVRP	0x00000040  /* Updated Version Registers Present */
14262306a36Sopenharmony_ci
14362306a36Sopenharmony_ci#define SPR_VR_VER_OFF	24
14462306a36Sopenharmony_ci#define SPR_VR_CFG_OFF	16
14562306a36Sopenharmony_ci#define SPR_VR_REV_OFF	0
14662306a36Sopenharmony_ci
14762306a36Sopenharmony_ci/*
14862306a36Sopenharmony_ci * Bit definitions for the Version Register 2
14962306a36Sopenharmony_ci */
15062306a36Sopenharmony_ci#define SPR_VR2_CPUID	0xff000000  /* Processor ID */
15162306a36Sopenharmony_ci#define SPR_VR2_VER	0x00ffffff  /* Processor version */
15262306a36Sopenharmony_ci
15362306a36Sopenharmony_ci/*
15462306a36Sopenharmony_ci * Bit definitions for the Unit Present Register
15562306a36Sopenharmony_ci *
15662306a36Sopenharmony_ci */
15762306a36Sopenharmony_ci#define SPR_UPR_UP	   0x00000001  /* UPR present */
15862306a36Sopenharmony_ci#define SPR_UPR_DCP	   0x00000002  /* Data cache present */
15962306a36Sopenharmony_ci#define SPR_UPR_ICP	   0x00000004  /* Instruction cache present */
16062306a36Sopenharmony_ci#define SPR_UPR_DMP	   0x00000008  /* Data MMU present */
16162306a36Sopenharmony_ci#define SPR_UPR_IMP	   0x00000010  /* Instruction MMU present */
16262306a36Sopenharmony_ci#define SPR_UPR_MP	   0x00000020  /* MAC present */
16362306a36Sopenharmony_ci#define SPR_UPR_DUP	   0x00000040  /* Debug unit present */
16462306a36Sopenharmony_ci#define SPR_UPR_PCUP	   0x00000080  /* Performance counters unit present */
16562306a36Sopenharmony_ci#define SPR_UPR_PICP	   0x00000100  /* PIC present */
16662306a36Sopenharmony_ci#define SPR_UPR_PMP	   0x00000200  /* Power management present */
16762306a36Sopenharmony_ci#define SPR_UPR_TTP	   0x00000400  /* Tick timer present */
16862306a36Sopenharmony_ci#define SPR_UPR_RES	   0x00fe0000  /* Reserved */
16962306a36Sopenharmony_ci#define SPR_UPR_CUP	   0xff000000  /* Context units present */
17062306a36Sopenharmony_ci
17162306a36Sopenharmony_ci/*
17262306a36Sopenharmony_ci * JPB: Bit definitions for the CPU configuration register
17362306a36Sopenharmony_ci *
17462306a36Sopenharmony_ci */
17562306a36Sopenharmony_ci#define SPR_CPUCFGR_NSGF   0x0000000f  /* Number of shadow GPR files */
17662306a36Sopenharmony_ci#define SPR_CPUCFGR_CGF	   0x00000010  /* Custom GPR file */
17762306a36Sopenharmony_ci#define SPR_CPUCFGR_OB32S  0x00000020  /* ORBIS32 supported */
17862306a36Sopenharmony_ci#define SPR_CPUCFGR_OB64S  0x00000040  /* ORBIS64 supported */
17962306a36Sopenharmony_ci#define SPR_CPUCFGR_OF32S  0x00000080  /* ORFPX32 supported */
18062306a36Sopenharmony_ci#define SPR_CPUCFGR_OF64S  0x00000100  /* ORFPX64 supported */
18162306a36Sopenharmony_ci#define SPR_CPUCFGR_OV64S  0x00000200  /* ORVDX64 supported */
18262306a36Sopenharmony_ci#define SPR_CPUCFGR_RES	   0xfffffc00  /* Reserved */
18362306a36Sopenharmony_ci
18462306a36Sopenharmony_ci/*
18562306a36Sopenharmony_ci * JPB: Bit definitions for the Debug configuration register and other
18662306a36Sopenharmony_ci * constants.
18762306a36Sopenharmony_ci *
18862306a36Sopenharmony_ci */
18962306a36Sopenharmony_ci
19062306a36Sopenharmony_ci#define SPR_DCFGR_NDP      0x00000007  /* Number of matchpoints mask */
19162306a36Sopenharmony_ci#define SPR_DCFGR_NDP1     0x00000000  /* One matchpoint supported */
19262306a36Sopenharmony_ci#define SPR_DCFGR_NDP2     0x00000001  /* Two matchpoints supported */
19362306a36Sopenharmony_ci#define SPR_DCFGR_NDP3     0x00000002  /* Three matchpoints supported */
19462306a36Sopenharmony_ci#define SPR_DCFGR_NDP4     0x00000003  /* Four matchpoints supported */
19562306a36Sopenharmony_ci#define SPR_DCFGR_NDP5     0x00000004  /* Five matchpoints supported */
19662306a36Sopenharmony_ci#define SPR_DCFGR_NDP6     0x00000005  /* Six matchpoints supported */
19762306a36Sopenharmony_ci#define SPR_DCFGR_NDP7     0x00000006  /* Seven matchpoints supported */
19862306a36Sopenharmony_ci#define SPR_DCFGR_NDP8     0x00000007  /* Eight matchpoints supported */
19962306a36Sopenharmony_ci#define SPR_DCFGR_WPCI     0x00000008  /* Watchpoint counters implemented */
20062306a36Sopenharmony_ci
20162306a36Sopenharmony_ci#define MATCHPOINTS_TO_NDP(n) (1 == n ? SPR_DCFGR_NDP1 : \
20262306a36Sopenharmony_ci                               2 == n ? SPR_DCFGR_NDP2 : \
20362306a36Sopenharmony_ci                               3 == n ? SPR_DCFGR_NDP3 : \
20462306a36Sopenharmony_ci                               4 == n ? SPR_DCFGR_NDP4 : \
20562306a36Sopenharmony_ci                               5 == n ? SPR_DCFGR_NDP5 : \
20662306a36Sopenharmony_ci                               6 == n ? SPR_DCFGR_NDP6 : \
20762306a36Sopenharmony_ci                               7 == n ? SPR_DCFGR_NDP7 : SPR_DCFGR_NDP8)
20862306a36Sopenharmony_ci#define MAX_MATCHPOINTS  8
20962306a36Sopenharmony_ci#define MAX_WATCHPOINTS  (MAX_MATCHPOINTS + 2)
21062306a36Sopenharmony_ci
21162306a36Sopenharmony_ci/*
21262306a36Sopenharmony_ci * Bit definitions for the Supervision Register
21362306a36Sopenharmony_ci *
21462306a36Sopenharmony_ci */
21562306a36Sopenharmony_ci#define SPR_SR_SM          0x00000001  /* Supervisor Mode */
21662306a36Sopenharmony_ci#define SPR_SR_TEE         0x00000002  /* Tick timer Exception Enable */
21762306a36Sopenharmony_ci#define SPR_SR_IEE         0x00000004  /* Interrupt Exception Enable */
21862306a36Sopenharmony_ci#define SPR_SR_DCE         0x00000008  /* Data Cache Enable */
21962306a36Sopenharmony_ci#define SPR_SR_ICE         0x00000010  /* Instruction Cache Enable */
22062306a36Sopenharmony_ci#define SPR_SR_DME         0x00000020  /* Data MMU Enable */
22162306a36Sopenharmony_ci#define SPR_SR_IME         0x00000040  /* Instruction MMU Enable */
22262306a36Sopenharmony_ci#define SPR_SR_LEE         0x00000080  /* Little Endian Enable */
22362306a36Sopenharmony_ci#define SPR_SR_CE          0x00000100  /* CID Enable */
22462306a36Sopenharmony_ci#define SPR_SR_F           0x00000200  /* Condition Flag */
22562306a36Sopenharmony_ci#define SPR_SR_CY          0x00000400  /* Carry flag */
22662306a36Sopenharmony_ci#define SPR_SR_OV          0x00000800  /* Overflow flag */
22762306a36Sopenharmony_ci#define SPR_SR_OVE         0x00001000  /* Overflow flag Exception */
22862306a36Sopenharmony_ci#define SPR_SR_DSX         0x00002000  /* Delay Slot Exception */
22962306a36Sopenharmony_ci#define SPR_SR_EPH         0x00004000  /* Exception Prefix High */
23062306a36Sopenharmony_ci#define SPR_SR_FO          0x00008000  /* Fixed one */
23162306a36Sopenharmony_ci#define SPR_SR_SUMRA       0x00010000  /* Supervisor SPR read access */
23262306a36Sopenharmony_ci#define SPR_SR_RES         0x0ffe0000  /* Reserved */
23362306a36Sopenharmony_ci#define SPR_SR_CID         0xf0000000  /* Context ID */
23462306a36Sopenharmony_ci
23562306a36Sopenharmony_ci/*
23662306a36Sopenharmony_ci * Bit definitions for the Data MMU Control Register
23762306a36Sopenharmony_ci *
23862306a36Sopenharmony_ci */
23962306a36Sopenharmony_ci#define SPR_DMMUCR_P2S	   0x0000003e  /* Level 2 Page Size */
24062306a36Sopenharmony_ci#define SPR_DMMUCR_P1S	   0x000007c0  /* Level 1 Page Size */
24162306a36Sopenharmony_ci#define SPR_DMMUCR_VADDR_WIDTH	0x0000f800  /* Virtual ADDR Width */
24262306a36Sopenharmony_ci#define SPR_DMMUCR_PADDR_WIDTH	0x000f0000  /* Physical ADDR Width */
24362306a36Sopenharmony_ci
24462306a36Sopenharmony_ci/*
24562306a36Sopenharmony_ci * Bit definitions for the Instruction MMU Control Register
24662306a36Sopenharmony_ci *
24762306a36Sopenharmony_ci */
24862306a36Sopenharmony_ci#define SPR_IMMUCR_P2S	   0x0000003e  /* Level 2 Page Size */
24962306a36Sopenharmony_ci#define SPR_IMMUCR_P1S	   0x000007c0  /* Level 1 Page Size */
25062306a36Sopenharmony_ci#define SPR_IMMUCR_VADDR_WIDTH	0x0000f800  /* Virtual ADDR Width */
25162306a36Sopenharmony_ci#define SPR_IMMUCR_PADDR_WIDTH	0x000f0000  /* Physical ADDR Width */
25262306a36Sopenharmony_ci
25362306a36Sopenharmony_ci/*
25462306a36Sopenharmony_ci * Bit definitions for the Data TLB Match Register
25562306a36Sopenharmony_ci *
25662306a36Sopenharmony_ci */
25762306a36Sopenharmony_ci#define SPR_DTLBMR_V	   0x00000001  /* Valid */
25862306a36Sopenharmony_ci#define SPR_DTLBMR_PL1	   0x00000002  /* Page Level 1 (if 0 then PL2) */
25962306a36Sopenharmony_ci#define SPR_DTLBMR_CID	   0x0000003c  /* Context ID */
26062306a36Sopenharmony_ci#define SPR_DTLBMR_LRU	   0x000000c0  /* Least Recently Used */
26162306a36Sopenharmony_ci#define SPR_DTLBMR_VPN	   0xfffff000  /* Virtual Page Number */
26262306a36Sopenharmony_ci
26362306a36Sopenharmony_ci/*
26462306a36Sopenharmony_ci * Bit definitions for the Data TLB Translate Register
26562306a36Sopenharmony_ci *
26662306a36Sopenharmony_ci */
26762306a36Sopenharmony_ci#define SPR_DTLBTR_CC	   0x00000001  /* Cache Coherency */
26862306a36Sopenharmony_ci#define SPR_DTLBTR_CI	   0x00000002  /* Cache Inhibit */
26962306a36Sopenharmony_ci#define SPR_DTLBTR_WBC	   0x00000004  /* Write-Back Cache */
27062306a36Sopenharmony_ci#define SPR_DTLBTR_WOM	   0x00000008  /* Weakly-Ordered Memory */
27162306a36Sopenharmony_ci#define SPR_DTLBTR_A	   0x00000010  /* Accessed */
27262306a36Sopenharmony_ci#define SPR_DTLBTR_D	   0x00000020  /* Dirty */
27362306a36Sopenharmony_ci#define SPR_DTLBTR_URE	   0x00000040  /* User Read Enable */
27462306a36Sopenharmony_ci#define SPR_DTLBTR_UWE	   0x00000080  /* User Write Enable */
27562306a36Sopenharmony_ci#define SPR_DTLBTR_SRE	   0x00000100  /* Supervisor Read Enable */
27662306a36Sopenharmony_ci#define SPR_DTLBTR_SWE	   0x00000200  /* Supervisor Write Enable */
27762306a36Sopenharmony_ci#define SPR_DTLBTR_PPN	   0xfffff000  /* Physical Page Number */
27862306a36Sopenharmony_ci
27962306a36Sopenharmony_ci/*
28062306a36Sopenharmony_ci * Bit definitions for the Instruction TLB Match Register
28162306a36Sopenharmony_ci *
28262306a36Sopenharmony_ci */
28362306a36Sopenharmony_ci#define SPR_ITLBMR_V	   0x00000001  /* Valid */
28462306a36Sopenharmony_ci#define SPR_ITLBMR_PL1	   0x00000002  /* Page Level 1 (if 0 then PL2) */
28562306a36Sopenharmony_ci#define SPR_ITLBMR_CID	   0x0000003c  /* Context ID */
28662306a36Sopenharmony_ci#define SPR_ITLBMR_LRU	   0x000000c0  /* Least Recently Used */
28762306a36Sopenharmony_ci#define SPR_ITLBMR_VPN	   0xfffff000  /* Virtual Page Number */
28862306a36Sopenharmony_ci
28962306a36Sopenharmony_ci/*
29062306a36Sopenharmony_ci * Bit definitions for the Instruction TLB Translate Register
29162306a36Sopenharmony_ci *
29262306a36Sopenharmony_ci */
29362306a36Sopenharmony_ci#define SPR_ITLBTR_CC	   0x00000001  /* Cache Coherency */
29462306a36Sopenharmony_ci#define SPR_ITLBTR_CI	   0x00000002  /* Cache Inhibit */
29562306a36Sopenharmony_ci#define SPR_ITLBTR_WBC	   0x00000004  /* Write-Back Cache */
29662306a36Sopenharmony_ci#define SPR_ITLBTR_WOM	   0x00000008  /* Weakly-Ordered Memory */
29762306a36Sopenharmony_ci#define SPR_ITLBTR_A	   0x00000010  /* Accessed */
29862306a36Sopenharmony_ci#define SPR_ITLBTR_D	   0x00000020  /* Dirty */
29962306a36Sopenharmony_ci#define SPR_ITLBTR_SXE	   0x00000040  /* User Read Enable */
30062306a36Sopenharmony_ci#define SPR_ITLBTR_UXE	   0x00000080  /* User Write Enable */
30162306a36Sopenharmony_ci#define SPR_ITLBTR_PPN	   0xfffff000  /* Physical Page Number */
30262306a36Sopenharmony_ci
30362306a36Sopenharmony_ci/*
30462306a36Sopenharmony_ci * Bit definitions for Data Cache Control register
30562306a36Sopenharmony_ci *
30662306a36Sopenharmony_ci */
30762306a36Sopenharmony_ci#define SPR_DCCR_EW	   0x000000ff  /* Enable ways */
30862306a36Sopenharmony_ci
30962306a36Sopenharmony_ci/*
31062306a36Sopenharmony_ci * Bit definitions for Insn Cache Control register
31162306a36Sopenharmony_ci *
31262306a36Sopenharmony_ci */
31362306a36Sopenharmony_ci#define SPR_ICCR_EW	   0x000000ff  /* Enable ways */
31462306a36Sopenharmony_ci
31562306a36Sopenharmony_ci/*
31662306a36Sopenharmony_ci * Bit definitions for Data Cache Configuration Register
31762306a36Sopenharmony_ci *
31862306a36Sopenharmony_ci */
31962306a36Sopenharmony_ci
32062306a36Sopenharmony_ci#define SPR_DCCFGR_NCW		0x00000007
32162306a36Sopenharmony_ci#define SPR_DCCFGR_NCS		0x00000078
32262306a36Sopenharmony_ci#define SPR_DCCFGR_CBS		0x00000080
32362306a36Sopenharmony_ci#define SPR_DCCFGR_CWS		0x00000100
32462306a36Sopenharmony_ci#define SPR_DCCFGR_CCRI		0x00000200
32562306a36Sopenharmony_ci#define SPR_DCCFGR_CBIRI	0x00000400
32662306a36Sopenharmony_ci#define SPR_DCCFGR_CBPRI	0x00000800
32762306a36Sopenharmony_ci#define SPR_DCCFGR_CBLRI	0x00001000
32862306a36Sopenharmony_ci#define SPR_DCCFGR_CBFRI	0x00002000
32962306a36Sopenharmony_ci#define SPR_DCCFGR_CBWBRI	0x00004000
33062306a36Sopenharmony_ci
33162306a36Sopenharmony_ci#define SPR_DCCFGR_NCW_OFF      0
33262306a36Sopenharmony_ci#define SPR_DCCFGR_NCS_OFF      3
33362306a36Sopenharmony_ci#define SPR_DCCFGR_CBS_OFF	7
33462306a36Sopenharmony_ci
33562306a36Sopenharmony_ci/*
33662306a36Sopenharmony_ci * Bit definitions for Instruction Cache Configuration Register
33762306a36Sopenharmony_ci *
33862306a36Sopenharmony_ci */
33962306a36Sopenharmony_ci#define SPR_ICCFGR_NCW		0x00000007
34062306a36Sopenharmony_ci#define SPR_ICCFGR_NCS		0x00000078
34162306a36Sopenharmony_ci#define SPR_ICCFGR_CBS		0x00000080
34262306a36Sopenharmony_ci#define SPR_ICCFGR_CCRI		0x00000200
34362306a36Sopenharmony_ci#define SPR_ICCFGR_CBIRI	0x00000400
34462306a36Sopenharmony_ci#define SPR_ICCFGR_CBPRI	0x00000800
34562306a36Sopenharmony_ci#define SPR_ICCFGR_CBLRI	0x00001000
34662306a36Sopenharmony_ci
34762306a36Sopenharmony_ci#define SPR_ICCFGR_NCW_OFF      0
34862306a36Sopenharmony_ci#define SPR_ICCFGR_NCS_OFF      3
34962306a36Sopenharmony_ci#define SPR_ICCFGR_CBS_OFF	7
35062306a36Sopenharmony_ci
35162306a36Sopenharmony_ci/*
35262306a36Sopenharmony_ci * Bit definitions for Data MMU Configuration Register
35362306a36Sopenharmony_ci *
35462306a36Sopenharmony_ci */
35562306a36Sopenharmony_ci
35662306a36Sopenharmony_ci#define SPR_DMMUCFGR_NTW	0x00000003
35762306a36Sopenharmony_ci#define SPR_DMMUCFGR_NTS	0x0000001C
35862306a36Sopenharmony_ci#define SPR_DMMUCFGR_NAE	0x000000E0
35962306a36Sopenharmony_ci#define SPR_DMMUCFGR_CRI	0x00000100
36062306a36Sopenharmony_ci#define SPR_DMMUCFGR_PRI        0x00000200
36162306a36Sopenharmony_ci#define SPR_DMMUCFGR_TEIRI	0x00000400
36262306a36Sopenharmony_ci#define SPR_DMMUCFGR_HTR	0x00000800
36362306a36Sopenharmony_ci
36462306a36Sopenharmony_ci#define SPR_DMMUCFGR_NTW_OFF	0
36562306a36Sopenharmony_ci#define SPR_DMMUCFGR_NTS_OFF	2
36662306a36Sopenharmony_ci
36762306a36Sopenharmony_ci/*
36862306a36Sopenharmony_ci * Bit definitions for Instruction MMU Configuration Register
36962306a36Sopenharmony_ci *
37062306a36Sopenharmony_ci */
37162306a36Sopenharmony_ci
37262306a36Sopenharmony_ci#define SPR_IMMUCFGR_NTW	0x00000003
37362306a36Sopenharmony_ci#define SPR_IMMUCFGR_NTS	0x0000001C
37462306a36Sopenharmony_ci#define SPR_IMMUCFGR_NAE	0x000000E0
37562306a36Sopenharmony_ci#define SPR_IMMUCFGR_CRI	0x00000100
37662306a36Sopenharmony_ci#define SPR_IMMUCFGR_PRI	0x00000200
37762306a36Sopenharmony_ci#define SPR_IMMUCFGR_TEIRI	0x00000400
37862306a36Sopenharmony_ci#define SPR_IMMUCFGR_HTR	0x00000800
37962306a36Sopenharmony_ci
38062306a36Sopenharmony_ci#define SPR_IMMUCFGR_NTW_OFF	0
38162306a36Sopenharmony_ci#define SPR_IMMUCFGR_NTS_OFF	2
38262306a36Sopenharmony_ci
38362306a36Sopenharmony_ci/*
38462306a36Sopenharmony_ci * Bit definitions for Debug Control registers
38562306a36Sopenharmony_ci *
38662306a36Sopenharmony_ci */
38762306a36Sopenharmony_ci#define SPR_DCR_DP	0x00000001  /* DVR/DCR present */
38862306a36Sopenharmony_ci#define SPR_DCR_CC	0x0000000e  /* Compare condition */
38962306a36Sopenharmony_ci#define SPR_DCR_SC	0x00000010  /* Signed compare */
39062306a36Sopenharmony_ci#define SPR_DCR_CT	0x000000e0  /* Compare to */
39162306a36Sopenharmony_ci
39262306a36Sopenharmony_ci/* Bit results with SPR_DCR_CC mask */
39362306a36Sopenharmony_ci#define SPR_DCR_CC_MASKED 0x00000000
39462306a36Sopenharmony_ci#define SPR_DCR_CC_EQUAL  0x00000002
39562306a36Sopenharmony_ci#define SPR_DCR_CC_LESS   0x00000004
39662306a36Sopenharmony_ci#define SPR_DCR_CC_LESSE  0x00000006
39762306a36Sopenharmony_ci#define SPR_DCR_CC_GREAT  0x00000008
39862306a36Sopenharmony_ci#define SPR_DCR_CC_GREATE 0x0000000a
39962306a36Sopenharmony_ci#define SPR_DCR_CC_NEQUAL 0x0000000c
40062306a36Sopenharmony_ci
40162306a36Sopenharmony_ci/* Bit results with SPR_DCR_CT mask */
40262306a36Sopenharmony_ci#define SPR_DCR_CT_DISABLED 0x00000000
40362306a36Sopenharmony_ci#define SPR_DCR_CT_IFEA     0x00000020
40462306a36Sopenharmony_ci#define SPR_DCR_CT_LEA      0x00000040
40562306a36Sopenharmony_ci#define SPR_DCR_CT_SEA      0x00000060
40662306a36Sopenharmony_ci#define SPR_DCR_CT_LD       0x00000080
40762306a36Sopenharmony_ci#define SPR_DCR_CT_SD       0x000000a0
40862306a36Sopenharmony_ci#define SPR_DCR_CT_LSEA     0x000000c0
40962306a36Sopenharmony_ci#define SPR_DCR_CT_LSD	    0x000000e0
41062306a36Sopenharmony_ci/* SPR_DCR_CT_LSD doesn't seem to be implemented anywhere in or1ksim. 2004-1-30 HP */
41162306a36Sopenharmony_ci
41262306a36Sopenharmony_ci/*
41362306a36Sopenharmony_ci * Bit definitions for Debug Mode 1 register
41462306a36Sopenharmony_ci *
41562306a36Sopenharmony_ci */
41662306a36Sopenharmony_ci#define SPR_DMR1_CW       0x000fffff  /* Chain register pair data */
41762306a36Sopenharmony_ci#define SPR_DMR1_CW0_AND  0x00000001
41862306a36Sopenharmony_ci#define SPR_DMR1_CW0_OR   0x00000002
41962306a36Sopenharmony_ci#define SPR_DMR1_CW0      (SPR_DMR1_CW0_AND | SPR_DMR1_CW0_OR)
42062306a36Sopenharmony_ci#define SPR_DMR1_CW1_AND  0x00000004
42162306a36Sopenharmony_ci#define SPR_DMR1_CW1_OR   0x00000008
42262306a36Sopenharmony_ci#define SPR_DMR1_CW1      (SPR_DMR1_CW1_AND | SPR_DMR1_CW1_OR)
42362306a36Sopenharmony_ci#define SPR_DMR1_CW2_AND  0x00000010
42462306a36Sopenharmony_ci#define SPR_DMR1_CW2_OR   0x00000020
42562306a36Sopenharmony_ci#define SPR_DMR1_CW2      (SPR_DMR1_CW2_AND | SPR_DMR1_CW2_OR)
42662306a36Sopenharmony_ci#define SPR_DMR1_CW3_AND  0x00000040
42762306a36Sopenharmony_ci#define SPR_DMR1_CW3_OR   0x00000080
42862306a36Sopenharmony_ci#define SPR_DMR1_CW3      (SPR_DMR1_CW3_AND | SPR_DMR1_CW3_OR)
42962306a36Sopenharmony_ci#define SPR_DMR1_CW4_AND  0x00000100
43062306a36Sopenharmony_ci#define SPR_DMR1_CW4_OR   0x00000200
43162306a36Sopenharmony_ci#define SPR_DMR1_CW4      (SPR_DMR1_CW4_AND | SPR_DMR1_CW4_OR)
43262306a36Sopenharmony_ci#define SPR_DMR1_CW5_AND  0x00000400
43362306a36Sopenharmony_ci#define SPR_DMR1_CW5_OR   0x00000800
43462306a36Sopenharmony_ci#define SPR_DMR1_CW5      (SPR_DMR1_CW5_AND | SPR_DMR1_CW5_OR)
43562306a36Sopenharmony_ci#define SPR_DMR1_CW6_AND  0x00001000
43662306a36Sopenharmony_ci#define SPR_DMR1_CW6_OR   0x00002000
43762306a36Sopenharmony_ci#define SPR_DMR1_CW6      (SPR_DMR1_CW6_AND | SPR_DMR1_CW6_OR)
43862306a36Sopenharmony_ci#define SPR_DMR1_CW7_AND  0x00004000
43962306a36Sopenharmony_ci#define SPR_DMR1_CW7_OR   0x00008000
44062306a36Sopenharmony_ci#define SPR_DMR1_CW7      (SPR_DMR1_CW7_AND | SPR_DMR1_CW7_OR)
44162306a36Sopenharmony_ci#define SPR_DMR1_CW8_AND  0x00010000
44262306a36Sopenharmony_ci#define SPR_DMR1_CW8_OR   0x00020000
44362306a36Sopenharmony_ci#define SPR_DMR1_CW8      (SPR_DMR1_CW8_AND | SPR_DMR1_CW8_OR)
44462306a36Sopenharmony_ci#define SPR_DMR1_CW9_AND  0x00040000
44562306a36Sopenharmony_ci#define SPR_DMR1_CW9_OR   0x00080000
44662306a36Sopenharmony_ci#define SPR_DMR1_CW9      (SPR_DMR1_CW9_AND | SPR_DMR1_CW9_OR)
44762306a36Sopenharmony_ci#define SPR_DMR1_RES1      0x00300000  /* Reserved */
44862306a36Sopenharmony_ci#define SPR_DMR1_ST	  0x00400000  /* Single-step trace*/
44962306a36Sopenharmony_ci#define SPR_DMR1_BT	  0x00800000  /* Branch trace */
45062306a36Sopenharmony_ci#define SPR_DMR1_RES2	  0xff000000  /* Reserved */
45162306a36Sopenharmony_ci
45262306a36Sopenharmony_ci/*
45362306a36Sopenharmony_ci * Bit definitions for Debug Mode 2 register. AWTC and WGB corrected by JPB
45462306a36Sopenharmony_ci *
45562306a36Sopenharmony_ci */
45662306a36Sopenharmony_ci#define SPR_DMR2_WCE0	   0x00000001  /* Watchpoint counter 0 enable */
45762306a36Sopenharmony_ci#define SPR_DMR2_WCE1	   0x00000002  /* Watchpoint counter 0 enable */
45862306a36Sopenharmony_ci#define SPR_DMR2_AWTC	   0x00000ffc  /* Assign watchpoints to counters */
45962306a36Sopenharmony_ci#define SPR_DMR2_AWTC_OFF           2  /* Bit offset to AWTC field */
46062306a36Sopenharmony_ci#define SPR_DMR2_WGB	   0x003ff000  /* Watchpoints generating breakpoint */
46162306a36Sopenharmony_ci#define SPR_DMR2_WGB_OFF           12  /* Bit offset to WGB field */
46262306a36Sopenharmony_ci#define SPR_DMR2_WBS	   0xffc00000  /* JPB: Watchpoint status */
46362306a36Sopenharmony_ci#define SPR_DMR2_WBS_OFF           22  /* Bit offset to WBS field */
46462306a36Sopenharmony_ci
46562306a36Sopenharmony_ci/*
46662306a36Sopenharmony_ci * Bit definitions for Debug watchpoint counter registers
46762306a36Sopenharmony_ci *
46862306a36Sopenharmony_ci */
46962306a36Sopenharmony_ci#define SPR_DWCR_COUNT	    0x0000ffff  /* Count */
47062306a36Sopenharmony_ci#define SPR_DWCR_MATCH	    0xffff0000  /* Match */
47162306a36Sopenharmony_ci#define SPR_DWCR_MATCH_OFF          16  /* Match bit offset */
47262306a36Sopenharmony_ci
47362306a36Sopenharmony_ci/*
47462306a36Sopenharmony_ci * Bit definitions for Debug stop register
47562306a36Sopenharmony_ci *
47662306a36Sopenharmony_ci */
47762306a36Sopenharmony_ci#define SPR_DSR_RSTE	0x00000001  /* Reset exception */
47862306a36Sopenharmony_ci#define SPR_DSR_BUSEE	0x00000002  /* Bus error exception */
47962306a36Sopenharmony_ci#define SPR_DSR_DPFE	0x00000004  /* Data Page Fault exception */
48062306a36Sopenharmony_ci#define SPR_DSR_IPFE	0x00000008  /* Insn Page Fault exception */
48162306a36Sopenharmony_ci#define SPR_DSR_TTE	0x00000010  /* Tick Timer exception */
48262306a36Sopenharmony_ci#define SPR_DSR_AE	0x00000020  /* Alignment exception */
48362306a36Sopenharmony_ci#define SPR_DSR_IIE	0x00000040  /* Illegal Instruction exception */
48462306a36Sopenharmony_ci#define SPR_DSR_IE	0x00000080  /* Interrupt exception */
48562306a36Sopenharmony_ci#define SPR_DSR_DME	0x00000100  /* DTLB miss exception */
48662306a36Sopenharmony_ci#define SPR_DSR_IME	0x00000200  /* ITLB miss exception */
48762306a36Sopenharmony_ci#define SPR_DSR_RE	0x00000400  /* Range exception */
48862306a36Sopenharmony_ci#define SPR_DSR_SCE	0x00000800  /* System call exception */
48962306a36Sopenharmony_ci#define SPR_DSR_FPE     0x00001000  /* Floating Point Exception */
49062306a36Sopenharmony_ci#define SPR_DSR_TE	0x00002000  /* Trap exception */
49162306a36Sopenharmony_ci
49262306a36Sopenharmony_ci/*
49362306a36Sopenharmony_ci * Bit definitions for Debug reason register
49462306a36Sopenharmony_ci *
49562306a36Sopenharmony_ci */
49662306a36Sopenharmony_ci#define SPR_DRR_RSTE	0x00000001  /* Reset exception */
49762306a36Sopenharmony_ci#define SPR_DRR_BUSEE	0x00000002  /* Bus error exception */
49862306a36Sopenharmony_ci#define SPR_DRR_DPFE	0x00000004  /* Data Page Fault exception */
49962306a36Sopenharmony_ci#define SPR_DRR_IPFE	0x00000008  /* Insn Page Fault exception */
50062306a36Sopenharmony_ci#define SPR_DRR_TTE	0x00000010  /* Tick Timer exception */
50162306a36Sopenharmony_ci#define SPR_DRR_AE	0x00000020  /* Alignment exception */
50262306a36Sopenharmony_ci#define SPR_DRR_IIE	0x00000040  /* Illegal Instruction exception */
50362306a36Sopenharmony_ci#define SPR_DRR_IE	0x00000080  /* Interrupt exception */
50462306a36Sopenharmony_ci#define SPR_DRR_DME	0x00000100  /* DTLB miss exception */
50562306a36Sopenharmony_ci#define SPR_DRR_IME	0x00000200  /* ITLB miss exception */
50662306a36Sopenharmony_ci#define SPR_DRR_RE	0x00000400  /* Range exception */
50762306a36Sopenharmony_ci#define SPR_DRR_SCE	0x00000800  /* System call exception */
50862306a36Sopenharmony_ci#define SPR_DRR_FPE     0x00001000  /* Floating Point Exception */
50962306a36Sopenharmony_ci#define SPR_DRR_TE	0x00002000  /* Trap exception */
51062306a36Sopenharmony_ci
51162306a36Sopenharmony_ci/*
51262306a36Sopenharmony_ci * Bit definitions for Performance counters mode registers
51362306a36Sopenharmony_ci *
51462306a36Sopenharmony_ci */
51562306a36Sopenharmony_ci#define SPR_PCMR_CP	0x00000001  /* Counter present */
51662306a36Sopenharmony_ci#define SPR_PCMR_UMRA	0x00000002  /* User mode read access */
51762306a36Sopenharmony_ci#define SPR_PCMR_CISM	0x00000004  /* Count in supervisor mode */
51862306a36Sopenharmony_ci#define SPR_PCMR_CIUM	0x00000008  /* Count in user mode */
51962306a36Sopenharmony_ci#define SPR_PCMR_LA	0x00000010  /* Load access event */
52062306a36Sopenharmony_ci#define SPR_PCMR_SA	0x00000020  /* Store access event */
52162306a36Sopenharmony_ci#define SPR_PCMR_IF	0x00000040  /* Instruction fetch event*/
52262306a36Sopenharmony_ci#define SPR_PCMR_DCM	0x00000080  /* Data cache miss event */
52362306a36Sopenharmony_ci#define SPR_PCMR_ICM	0x00000100  /* Insn cache miss event */
52462306a36Sopenharmony_ci#define SPR_PCMR_IFS	0x00000200  /* Insn fetch stall event */
52562306a36Sopenharmony_ci#define SPR_PCMR_LSUS	0x00000400  /* LSU stall event */
52662306a36Sopenharmony_ci#define SPR_PCMR_BS	0x00000800  /* Branch stall event */
52762306a36Sopenharmony_ci#define SPR_PCMR_DTLBM	0x00001000  /* DTLB miss event */
52862306a36Sopenharmony_ci#define SPR_PCMR_ITLBM	0x00002000  /* ITLB miss event */
52962306a36Sopenharmony_ci#define SPR_PCMR_DDS	0x00004000  /* Data dependency stall event */
53062306a36Sopenharmony_ci#define SPR_PCMR_WPE	0x03ff8000  /* Watchpoint events */
53162306a36Sopenharmony_ci
53262306a36Sopenharmony_ci/*
53362306a36Sopenharmony_ci * Bit definitions for the Power management register
53462306a36Sopenharmony_ci *
53562306a36Sopenharmony_ci */
53662306a36Sopenharmony_ci#define SPR_PMR_SDF	0x0000000f  /* Slow down factor */
53762306a36Sopenharmony_ci#define SPR_PMR_DME	0x00000010  /* Doze mode enable */
53862306a36Sopenharmony_ci#define SPR_PMR_SME	0x00000020  /* Sleep mode enable */
53962306a36Sopenharmony_ci#define SPR_PMR_DCGE	0x00000040  /* Dynamic clock gating enable */
54062306a36Sopenharmony_ci#define SPR_PMR_SUME	0x00000080  /* Suspend mode enable */
54162306a36Sopenharmony_ci
54262306a36Sopenharmony_ci/*
54362306a36Sopenharmony_ci * Bit definitions for PICMR
54462306a36Sopenharmony_ci *
54562306a36Sopenharmony_ci */
54662306a36Sopenharmony_ci#define SPR_PICMR_IUM	0xfffffffc  /* Interrupt unmask */
54762306a36Sopenharmony_ci
54862306a36Sopenharmony_ci/*
54962306a36Sopenharmony_ci * Bit definitions for PICPR
55062306a36Sopenharmony_ci *
55162306a36Sopenharmony_ci */
55262306a36Sopenharmony_ci#define SPR_PICPR_IPRIO	0xfffffffc  /* Interrupt priority */
55362306a36Sopenharmony_ci
55462306a36Sopenharmony_ci/*
55562306a36Sopenharmony_ci * Bit definitions for PICSR
55662306a36Sopenharmony_ci *
55762306a36Sopenharmony_ci */
55862306a36Sopenharmony_ci#define SPR_PICSR_IS	0xffffffff  /* Interrupt status */
55962306a36Sopenharmony_ci
56062306a36Sopenharmony_ci/*
56162306a36Sopenharmony_ci * Bit definitions for Tick Timer Control Register
56262306a36Sopenharmony_ci *
56362306a36Sopenharmony_ci */
56462306a36Sopenharmony_ci
56562306a36Sopenharmony_ci#define SPR_TTCR_CNT	0xffffffff  /* Count, time period */
56662306a36Sopenharmony_ci#define SPR_TTMR_TP	0x0fffffff  /* Time period */
56762306a36Sopenharmony_ci#define SPR_TTMR_IP	0x10000000  /* Interrupt Pending */
56862306a36Sopenharmony_ci#define SPR_TTMR_IE	0x20000000  /* Interrupt Enable */
56962306a36Sopenharmony_ci#define SPR_TTMR_DI	0x00000000  /* Disabled */
57062306a36Sopenharmony_ci#define SPR_TTMR_RT	0x40000000  /* Restart tick */
57162306a36Sopenharmony_ci#define SPR_TTMR_SR     0x80000000  /* Single run */
57262306a36Sopenharmony_ci#define SPR_TTMR_CR     0xc0000000  /* Continuous run */
57362306a36Sopenharmony_ci#define SPR_TTMR_M      0xc0000000  /* Tick mode */
57462306a36Sopenharmony_ci
57562306a36Sopenharmony_ci/*
57662306a36Sopenharmony_ci * Bit definitions for the FP Control Status Register
57762306a36Sopenharmony_ci *
57862306a36Sopenharmony_ci */
57962306a36Sopenharmony_ci#define SPR_FPCSR_FPEE  0x00000001  /* Floating Point Exception Enable */
58062306a36Sopenharmony_ci#define SPR_FPCSR_RM    0x00000006  /* Rounding Mode */
58162306a36Sopenharmony_ci#define SPR_FPCSR_OVF   0x00000008  /* Overflow Flag */
58262306a36Sopenharmony_ci#define SPR_FPCSR_UNF   0x00000010  /* Underflow Flag */
58362306a36Sopenharmony_ci#define SPR_FPCSR_SNF   0x00000020  /* SNAN Flag */
58462306a36Sopenharmony_ci#define SPR_FPCSR_QNF   0x00000040  /* QNAN Flag */
58562306a36Sopenharmony_ci#define SPR_FPCSR_ZF    0x00000080  /* Zero Flag */
58662306a36Sopenharmony_ci#define SPR_FPCSR_IXF   0x00000100  /* Inexact Flag */
58762306a36Sopenharmony_ci#define SPR_FPCSR_IVF   0x00000200  /* Invalid Flag */
58862306a36Sopenharmony_ci#define SPR_FPCSR_INF   0x00000400  /* Infinity Flag */
58962306a36Sopenharmony_ci#define SPR_FPCSR_DZF   0x00000800  /* Divide By Zero Flag */
59062306a36Sopenharmony_ci#define SPR_FPCSR_ALLF (SPR_FPCSR_OVF | SPR_FPCSR_UNF | SPR_FPCSR_SNF | \
59162306a36Sopenharmony_ci			SPR_FPCSR_QNF | SPR_FPCSR_ZF | SPR_FPCSR_IXF |  \
59262306a36Sopenharmony_ci			SPR_FPCSR_IVF | SPR_FPCSR_INF | SPR_FPCSR_DZF)
59362306a36Sopenharmony_ci
59462306a36Sopenharmony_ci#define FPCSR_RM_RN (0<<1)
59562306a36Sopenharmony_ci#define FPCSR_RM_RZ (1<<1)
59662306a36Sopenharmony_ci#define FPCSR_RM_RIP (2<<1)
59762306a36Sopenharmony_ci#define FPCSR_RM_RIN (3<<1)
59862306a36Sopenharmony_ci
59962306a36Sopenharmony_ci/*
60062306a36Sopenharmony_ci * l.nop constants
60162306a36Sopenharmony_ci *
60262306a36Sopenharmony_ci */
60362306a36Sopenharmony_ci#define NOP_NOP          0x0000      /* Normal nop instruction */
60462306a36Sopenharmony_ci#define NOP_EXIT         0x0001      /* End of simulation */
60562306a36Sopenharmony_ci#define NOP_REPORT       0x0002      /* Simple report */
60662306a36Sopenharmony_ci/*#define NOP_PRINTF       0x0003       Simprintf instruction (obsolete)*/
60762306a36Sopenharmony_ci#define NOP_PUTC         0x0004      /* JPB: Simputc instruction */
60862306a36Sopenharmony_ci#define NOP_CNT_RESET    0x0005	     /* Reset statistics counters */
60962306a36Sopenharmony_ci#define NOP_GET_TICKS    0x0006	     /* JPB: Get # ticks running */
61062306a36Sopenharmony_ci#define NOP_GET_PS       0x0007      /* JPB: Get picosecs/cycle */
61162306a36Sopenharmony_ci#define NOP_REPORT_FIRST 0x0400      /* Report with number */
61262306a36Sopenharmony_ci#define NOP_REPORT_LAST  0x03ff      /* Report with number */
61362306a36Sopenharmony_ci
61462306a36Sopenharmony_ci#endif	/* SPR_DEFS__H */
615