aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/mipsregs.h
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2016-05-11 10:50:28 -0400
committerRalf Baechle <ralf@linux-mips.org>2016-05-13 09:30:25 -0400
commitf913e9ea3946902f5443e703d70d5daf90f4498a (patch)
treea0df85b3261e5f00e3f8b2c51fa98358efc3d784 /arch/mips/include/asm/mipsregs.h
parent9e575f753576d85e83ae0afc27eca9708259a797 (diff)
MIPS: Add register definitions for VZ ASE registers
Add various register definitions to <asm/mipsregs.h> for the coprocessor zero registers in the VZ ASE, namely CP0_GuestCtl0, CP0_GuestCtl0Ext, CP0_GuestCtl1, CP0_GuestCtl2, CP0_GuestCtl3, and CP0_GTOffset. Signed-off-by: James Hogan <james.hogan@imgtec.com> Acked-by: David Daney <david.daney@cavium.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/13228/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include/asm/mipsregs.h')
-rw-r--r--arch/mips/include/asm/mipsregs.h117
1 files changed, 117 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 480d51550dc0..951d92e5f771 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -55,8 +55,14 @@
55#define CP0_BADINSTR $8, 1 55#define CP0_BADINSTR $8, 1
56#define CP0_COUNT $9 56#define CP0_COUNT $9
57#define CP0_ENTRYHI $10 57#define CP0_ENTRYHI $10
58#define CP0_GUESTCTL1 $10, 4
59#define CP0_GUESTCTL2 $10, 5
60#define CP0_GUESTCTL3 $10, 6
58#define CP0_COMPARE $11 61#define CP0_COMPARE $11
62#define CP0_GUESTCTL0EXT $11, 4
59#define CP0_STATUS $12 63#define CP0_STATUS $12
64#define CP0_GUESTCTL0 $12, 6
65#define CP0_GTOFFSET $12, 7
60#define CP0_CAUSE $13 66#define CP0_CAUSE $13
61#define CP0_EPC $14 67#define CP0_EPC $14
62#define CP0_PRID $15 68#define CP0_PRID $15
@@ -740,6 +746,94 @@
740#define MIPS_PWCTL_PSN_SHIFT 0 746#define MIPS_PWCTL_PSN_SHIFT 0
741#define MIPS_PWCTL_PSN_MASK 0x0000003f 747#define MIPS_PWCTL_PSN_MASK 0x0000003f
742 748
749/* GuestCtl0 fields */
750#define MIPS_GCTL0_GM_SHIFT 31
751#define MIPS_GCTL0_GM (_ULCAST_(1) << MIPS_GCTL0_GM_SHIFT)
752#define MIPS_GCTL0_RI_SHIFT 30
753#define MIPS_GCTL0_RI (_ULCAST_(1) << MIPS_GCTL0_RI_SHIFT)
754#define MIPS_GCTL0_MC_SHIFT 29
755#define MIPS_GCTL0_MC (_ULCAST_(1) << MIPS_GCTL0_MC_SHIFT)
756#define MIPS_GCTL0_CP0_SHIFT 28
757#define MIPS_GCTL0_CP0 (_ULCAST_(1) << MIPS_GCTL0_CP0_SHIFT)
758#define MIPS_GCTL0_AT_SHIFT 26
759#define MIPS_GCTL0_AT (_ULCAST_(0x3) << MIPS_GCTL0_AT_SHIFT)
760#define MIPS_GCTL0_GT_SHIFT 25
761#define MIPS_GCTL0_GT (_ULCAST_(1) << MIPS_GCTL0_GT_SHIFT)
762#define MIPS_GCTL0_CG_SHIFT 24
763#define MIPS_GCTL0_CG (_ULCAST_(1) << MIPS_GCTL0_CG_SHIFT)
764#define MIPS_GCTL0_CF_SHIFT 23
765#define MIPS_GCTL0_CF (_ULCAST_(1) << MIPS_GCTL0_CF_SHIFT)
766#define MIPS_GCTL0_G1_SHIFT 22
767#define MIPS_GCTL0_G1 (_ULCAST_(1) << MIPS_GCTL0_G1_SHIFT)
768#define MIPS_GCTL0_G0E_SHIFT 19
769#define MIPS_GCTL0_G0E (_ULCAST_(1) << MIPS_GCTL0_G0E_SHIFT)
770#define MIPS_GCTL0_PT_SHIFT 18
771#define MIPS_GCTL0_PT (_ULCAST_(1) << MIPS_GCTL0_PT_SHIFT)
772#define MIPS_GCTL0_RAD_SHIFT 9
773#define MIPS_GCTL0_RAD (_ULCAST_(1) << MIPS_GCTL0_RAD_SHIFT)
774#define MIPS_GCTL0_DRG_SHIFT 8
775#define MIPS_GCTL0_DRG (_ULCAST_(1) << MIPS_GCTL0_DRG_SHIFT)
776#define MIPS_GCTL0_G2_SHIFT 7
777#define MIPS_GCTL0_G2 (_ULCAST_(1) << MIPS_GCTL0_G2_SHIFT)
778#define MIPS_GCTL0_GEXC_SHIFT 2
779#define MIPS_GCTL0_GEXC (_ULCAST_(0x1f) << MIPS_GCTL0_GEXC_SHIFT)
780#define MIPS_GCTL0_SFC2_SHIFT 1
781#define MIPS_GCTL0_SFC2 (_ULCAST_(1) << MIPS_GCTL0_SFC2_SHIFT)
782#define MIPS_GCTL0_SFC1_SHIFT 0
783#define MIPS_GCTL0_SFC1 (_ULCAST_(1) << MIPS_GCTL0_SFC1_SHIFT)
784
785/* GuestCtl0.AT Guest address translation control */
786#define MIPS_GCTL0_AT_ROOT 1 /* Guest MMU under Root control */
787#define MIPS_GCTL0_AT_GUEST 3 /* Guest MMU under Guest control */
788
789/* GuestCtl0.GExcCode Hypervisor exception cause codes */
790#define MIPS_GCTL0_GEXC_GPSI 0 /* Guest Privileged Sensitive Instruction */
791#define MIPS_GCTL0_GEXC_GSFC 1 /* Guest Software Field Change */
792#define MIPS_GCTL0_GEXC_HC 2 /* Hypercall */
793#define MIPS_GCTL0_GEXC_GRR 3 /* Guest Reserved Instruction Redirect */
794#define MIPS_GCTL0_GEXC_GVA 8 /* Guest Virtual Address available */
795#define MIPS_GCTL0_GEXC_GHFC 9 /* Guest Hardware Field Change */
796#define MIPS_GCTL0_GEXC_GPA 10 /* Guest Physical Address available */
797
798/* GuestCtl0Ext fields */
799#define MIPS_GCTL0EXT_RPW_SHIFT 8
800#define MIPS_GCTL0EXT_RPW (_ULCAST_(0x3) << MIPS_GCTL0EXT_RPW_SHIFT)
801#define MIPS_GCTL0EXT_NCC_SHIFT 6
802#define MIPS_GCTL0EXT_NCC (_ULCAST_(0x3) << MIPS_GCTL0EXT_NCC_SHIFT)
803#define MIPS_GCTL0EXT_CGI_SHIFT 4
804#define MIPS_GCTL0EXT_CGI (_ULCAST_(1) << MIPS_GCTL0EXT_CGI_SHIFT)
805#define MIPS_GCTL0EXT_FCD_SHIFT 3
806#define MIPS_GCTL0EXT_FCD (_ULCAST_(1) << MIPS_GCTL0EXT_FCD_SHIFT)
807#define MIPS_GCTL0EXT_OG_SHIFT 2
808#define MIPS_GCTL0EXT_OG (_ULCAST_(1) << MIPS_GCTL0EXT_OG_SHIFT)
809#define MIPS_GCTL0EXT_BG_SHIFT 1
810#define MIPS_GCTL0EXT_BG (_ULCAST_(1) << MIPS_GCTL0EXT_BG_SHIFT)
811#define MIPS_GCTL0EXT_MG_SHIFT 0
812#define MIPS_GCTL0EXT_MG (_ULCAST_(1) << MIPS_GCTL0EXT_MG_SHIFT)
813
814/* GuestCtl0Ext.RPW Root page walk configuration */
815#define MIPS_GCTL0EXT_RPW_BOTH 0 /* Root PW for GPA->RPA and RVA->RPA */
816#define MIPS_GCTL0EXT_RPW_GPA 2 /* Root PW for GPA->RPA */
817#define MIPS_GCTL0EXT_RPW_RVA 3 /* Root PW for RVA->RPA */
818
819/* GuestCtl0Ext.NCC Nested cache coherency attributes */
820#define MIPS_GCTL0EXT_NCC_IND 0 /* Guest CCA independent of Root CCA */
821#define MIPS_GCTL0EXT_NCC_MOD 1 /* Guest CCA modified by Root CCA */
822
823/* GuestCtl1 fields */
824#define MIPS_GCTL1_ID_SHIFT 0
825#define MIPS_GCTL1_ID_WIDTH 8
826#define MIPS_GCTL1_ID (_ULCAST_(0xff) << MIPS_GCTL1_ID_SHIFT)
827#define MIPS_GCTL1_RID_SHIFT 16
828#define MIPS_GCTL1_RID_WIDTH 8
829#define MIPS_GCTL1_RID (_ULCAST_(0xff) << MIPS_GCTL1_RID_SHIFT)
830#define MIPS_GCTL1_EID_SHIFT 24
831#define MIPS_GCTL1_EID_WIDTH 8
832#define MIPS_GCTL1_EID (_ULCAST_(0xff) << MIPS_GCTL1_EID_SHIFT)
833
834/* GuestID reserved for root context */
835#define MIPS_GCTL1_ROOT_GUESTID 0
836
743/* CDMMBase register bit definitions */ 837/* CDMMBase register bit definitions */
744#define MIPS_CDMMBASE_SIZE_SHIFT 0 838#define MIPS_CDMMBASE_SIZE_SHIFT 0
745#define MIPS_CDMMBASE_SIZE (_ULCAST_(511) << MIPS_CDMMBASE_SIZE_SHIFT) 839#define MIPS_CDMMBASE_SIZE (_ULCAST_(511) << MIPS_CDMMBASE_SIZE_SHIFT)
@@ -1270,9 +1364,21 @@ do { \
1270#define read_c0_entryhi() __read_ulong_c0_register($10, 0) 1364#define read_c0_entryhi() __read_ulong_c0_register($10, 0)
1271#define write_c0_entryhi(val) __write_ulong_c0_register($10, 0, val) 1365#define write_c0_entryhi(val) __write_ulong_c0_register($10, 0, val)
1272 1366
1367#define read_c0_guestctl1() __read_32bit_c0_register($10, 4)
1368#define write_c0_guestctl1(val) __write_32bit_c0_register($10, 4, val)
1369
1370#define read_c0_guestctl2() __read_32bit_c0_register($10, 5)
1371#define write_c0_guestctl2(val) __write_32bit_c0_register($10, 5, val)
1372
1373#define read_c0_guestctl3() __read_32bit_c0_register($10, 6)
1374#define write_c0_guestctl3(val) __write_32bit_c0_register($10, 6, val)
1375
1273#define read_c0_compare() __read_32bit_c0_register($11, 0) 1376#define read_c0_compare() __read_32bit_c0_register($11, 0)
1274#define write_c0_compare(val) __write_32bit_c0_register($11, 0, val) 1377#define write_c0_compare(val) __write_32bit_c0_register($11, 0, val)
1275 1378
1379#define read_c0_guestctl0ext() __read_32bit_c0_register($11, 4)
1380#define write_c0_guestctl0ext(val) __write_32bit_c0_register($11, 4, val)
1381
1276#define read_c0_compare2() __read_32bit_c0_register($11, 6) /* pnx8550 */ 1382#define read_c0_compare2() __read_32bit_c0_register($11, 6) /* pnx8550 */
1277#define write_c0_compare2(val) __write_32bit_c0_register($11, 6, val) 1383#define write_c0_compare2(val) __write_32bit_c0_register($11, 6, val)
1278 1384
@@ -1283,6 +1389,12 @@ do { \
1283 1389
1284#define write_c0_status(val) __write_32bit_c0_register($12, 0, val) 1390#define write_c0_status(val) __write_32bit_c0_register($12, 0, val)
1285 1391
1392#define read_c0_guestctl0() __read_32bit_c0_register($12, 6)
1393#define write_c0_guestctl0(val) __write_32bit_c0_register($12, 6, val)
1394
1395#define read_c0_gtoffset() __read_32bit_c0_register($12, 7)
1396#define write_c0_gtoffset(val) __write_32bit_c0_register($12, 7, val)
1397
1286#define read_c0_cause() __read_32bit_c0_register($13, 0) 1398#define read_c0_cause() __read_32bit_c0_register($13, 0)
1287#define write_c0_cause(val) __write_32bit_c0_register($13, 0, val) 1399#define write_c0_cause(val) __write_32bit_c0_register($13, 0, val)
1288 1400
@@ -2111,6 +2223,11 @@ __BUILD_SET_C0(intcontrol)
2111__BUILD_SET_C0(intctl) 2223__BUILD_SET_C0(intctl)
2112__BUILD_SET_C0(srsmap) 2224__BUILD_SET_C0(srsmap)
2113__BUILD_SET_C0(pagegrain) 2225__BUILD_SET_C0(pagegrain)
2226__BUILD_SET_C0(guestctl0)
2227__BUILD_SET_C0(guestctl0ext)
2228__BUILD_SET_C0(guestctl1)
2229__BUILD_SET_C0(guestctl2)
2230__BUILD_SET_C0(guestctl3)
2114__BUILD_SET_C0(brcm_config_0) 2231__BUILD_SET_C0(brcm_config_0)
2115__BUILD_SET_C0(brcm_bus_pll) 2232__BUILD_SET_C0(brcm_bus_pll)
2116__BUILD_SET_C0(brcm_reset) 2233__BUILD_SET_C0(brcm_reset)