aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/mipsregs.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/include/asm/mipsregs.h')
-rw-r--r--arch/mips/include/asm/mipsregs.h85
1 files changed, 83 insertions, 2 deletions
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index e0331414c7d6..bbc3dd4294bc 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -14,6 +14,7 @@
14#define _ASM_MIPSREGS_H 14#define _ASM_MIPSREGS_H
15 15
16#include <linux/linkage.h> 16#include <linux/linkage.h>
17#include <linux/types.h>
17#include <asm/hazards.h> 18#include <asm/hazards.h>
18#include <asm/war.h> 19#include <asm/war.h>
19 20
@@ -573,7 +574,9 @@
573#define MIPS_CONF1_IA (_ULCAST_(7) << 16) 574#define MIPS_CONF1_IA (_ULCAST_(7) << 16)
574#define MIPS_CONF1_IL (_ULCAST_(7) << 19) 575#define MIPS_CONF1_IL (_ULCAST_(7) << 19)
575#define MIPS_CONF1_IS (_ULCAST_(7) << 22) 576#define MIPS_CONF1_IS (_ULCAST_(7) << 22)
576#define MIPS_CONF1_TLBS (_ULCAST_(63)<< 25) 577#define MIPS_CONF1_TLBS_SHIFT (25)
578#define MIPS_CONF1_TLBS_SIZE (6)
579#define MIPS_CONF1_TLBS (_ULCAST_(63) << MIPS_CONF1_TLBS_SHIFT)
577 580
578#define MIPS_CONF2_SA (_ULCAST_(15)<< 0) 581#define MIPS_CONF2_SA (_ULCAST_(15)<< 0)
579#define MIPS_CONF2_SL (_ULCAST_(15)<< 4) 582#define MIPS_CONF2_SL (_ULCAST_(15)<< 4)
@@ -587,21 +590,53 @@
587#define MIPS_CONF3_TL (_ULCAST_(1) << 0) 590#define MIPS_CONF3_TL (_ULCAST_(1) << 0)
588#define MIPS_CONF3_SM (_ULCAST_(1) << 1) 591#define MIPS_CONF3_SM (_ULCAST_(1) << 1)
589#define MIPS_CONF3_MT (_ULCAST_(1) << 2) 592#define MIPS_CONF3_MT (_ULCAST_(1) << 2)
593#define MIPS_CONF3_CDMM (_ULCAST_(1) << 3)
590#define MIPS_CONF3_SP (_ULCAST_(1) << 4) 594#define MIPS_CONF3_SP (_ULCAST_(1) << 4)
591#define MIPS_CONF3_VINT (_ULCAST_(1) << 5) 595#define MIPS_CONF3_VINT (_ULCAST_(1) << 5)
592#define MIPS_CONF3_VEIC (_ULCAST_(1) << 6) 596#define MIPS_CONF3_VEIC (_ULCAST_(1) << 6)
593#define MIPS_CONF3_LPA (_ULCAST_(1) << 7) 597#define MIPS_CONF3_LPA (_ULCAST_(1) << 7)
598#define MIPS_CONF3_ITL (_ULCAST_(1) << 8)
599#define MIPS_CONF3_CTXTC (_ULCAST_(1) << 9)
594#define MIPS_CONF3_DSP (_ULCAST_(1) << 10) 600#define MIPS_CONF3_DSP (_ULCAST_(1) << 10)
595#define MIPS_CONF3_DSP2P (_ULCAST_(1) << 11) 601#define MIPS_CONF3_DSP2P (_ULCAST_(1) << 11)
596#define MIPS_CONF3_RXI (_ULCAST_(1) << 12) 602#define MIPS_CONF3_RXI (_ULCAST_(1) << 12)
597#define MIPS_CONF3_ULRI (_ULCAST_(1) << 13) 603#define MIPS_CONF3_ULRI (_ULCAST_(1) << 13)
598#define MIPS_CONF3_ISA (_ULCAST_(3) << 14) 604#define MIPS_CONF3_ISA (_ULCAST_(3) << 14)
599#define MIPS_CONF3_ISA_OE (_ULCAST_(1) << 16) 605#define MIPS_CONF3_ISA_OE (_ULCAST_(1) << 16)
606#define MIPS_CONF3_MCU (_ULCAST_(1) << 17)
607#define MIPS_CONF3_MMAR (_ULCAST_(7) << 18)
608#define MIPS_CONF3_IPLW (_ULCAST_(3) << 21)
600#define MIPS_CONF3_VZ (_ULCAST_(1) << 23) 609#define MIPS_CONF3_VZ (_ULCAST_(1) << 23)
601 610#define MIPS_CONF3_PW (_ULCAST_(1) << 24)
611#define MIPS_CONF3_SC (_ULCAST_(1) << 25)
612#define MIPS_CONF3_BI (_ULCAST_(1) << 26)
613#define MIPS_CONF3_BP (_ULCAST_(1) << 27)
614#define MIPS_CONF3_MSA (_ULCAST_(1) << 28)
615#define MIPS_CONF3_CMGCR (_ULCAST_(1) << 29)
616#define MIPS_CONF3_BPG (_ULCAST_(1) << 30)
617
618#define MIPS_CONF4_MMUSIZEEXT_SHIFT (0)
602#define MIPS_CONF4_MMUSIZEEXT (_ULCAST_(255) << 0) 619#define MIPS_CONF4_MMUSIZEEXT (_ULCAST_(255) << 0)
620#define MIPS_CONF4_FTLBSETS_SHIFT (0)
621#define MIPS_CONF4_FTLBSETS_SHIFT (0)
622#define MIPS_CONF4_FTLBSETS (_ULCAST_(15) << MIPS_CONF4_FTLBSETS_SHIFT)
623#define MIPS_CONF4_FTLBWAYS_SHIFT (4)
624#define MIPS_CONF4_FTLBWAYS (_ULCAST_(15) << MIPS_CONF4_FTLBWAYS_SHIFT)
625#define MIPS_CONF4_FTLBPAGESIZE_SHIFT (8)
626/* bits 10:8 in FTLB-only configurations */
627#define MIPS_CONF4_FTLBPAGESIZE (_ULCAST_(7) << MIPS_CONF4_FTLBPAGESIZE_SHIFT)
628/* bits 12:8 in VTLB-FTLB only configurations */
629#define MIPS_CONF4_VFTLBPAGESIZE (_ULCAST_(31) << MIPS_CONF4_FTLBPAGESIZE_SHIFT)
603#define MIPS_CONF4_MMUEXTDEF (_ULCAST_(3) << 14) 630#define MIPS_CONF4_MMUEXTDEF (_ULCAST_(3) << 14)
604#define MIPS_CONF4_MMUEXTDEF_MMUSIZEEXT (_ULCAST_(1) << 14) 631#define MIPS_CONF4_MMUEXTDEF_MMUSIZEEXT (_ULCAST_(1) << 14)
632#define MIPS_CONF4_MMUEXTDEF_FTLBSIZEEXT (_ULCAST_(2) << 14)
633#define MIPS_CONF4_MMUEXTDEF_VTLBSIZEEXT (_ULCAST_(3) << 14)
634#define MIPS_CONF4_KSCREXIST (_ULCAST_(255) << 16)
635#define MIPS_CONF4_VTLBSIZEEXT_SHIFT (24)
636#define MIPS_CONF4_VTLBSIZEEXT (_ULCAST_(15) << MIPS_CONF4_VTLBSIZEEXT_SHIFT)
637#define MIPS_CONF4_AE (_ULCAST_(1) << 28)
638#define MIPS_CONF4_IE (_ULCAST_(3) << 29)
639#define MIPS_CONF4_TLBINV (_ULCAST_(2) << 29)
605 640
606#define MIPS_CONF5_NF (_ULCAST_(1) << 0) 641#define MIPS_CONF5_NF (_ULCAST_(1) << 0)
607#define MIPS_CONF5_UFR (_ULCAST_(1) << 2) 642#define MIPS_CONF5_UFR (_ULCAST_(1) << 2)
@@ -611,11 +646,15 @@
611#define MIPS_CONF5_K (_ULCAST_(1) << 30) 646#define MIPS_CONF5_K (_ULCAST_(1) << 30)
612 647
613#define MIPS_CONF6_SYND (_ULCAST_(1) << 13) 648#define MIPS_CONF6_SYND (_ULCAST_(1) << 13)
649/* proAptiv FTLB on/off bit */
650#define MIPS_CONF6_FTLBEN (_ULCAST_(1) << 15)
614 651
615#define MIPS_CONF7_WII (_ULCAST_(1) << 31) 652#define MIPS_CONF7_WII (_ULCAST_(1) << 31)
616 653
617#define MIPS_CONF7_RPS (_ULCAST_(1) << 2) 654#define MIPS_CONF7_RPS (_ULCAST_(1) << 2)
618 655
656/* EntryHI bit definition */
657#define MIPS_ENTRYHI_EHINV (_ULCAST_(1) << 10)
619 658
620/* 659/*
621 * Bits in the MIPS32/64 coprocessor 1 (FPU) revision register. 660 * Bits in the MIPS32/64 coprocessor 1 (FPU) revision register.
@@ -628,6 +667,26 @@
628#define MIPS_FPIR_L (_ULCAST_(1) << 21) 667#define MIPS_FPIR_L (_ULCAST_(1) << 21)
629#define MIPS_FPIR_F64 (_ULCAST_(1) << 22) 668#define MIPS_FPIR_F64 (_ULCAST_(1) << 22)
630 669
670/*
671 * Bits in the MIPS32 Memory Segmentation registers.
672 */
673#define MIPS_SEGCFG_PA_SHIFT 9
674#define MIPS_SEGCFG_PA (_ULCAST_(127) << MIPS_SEGCFG_PA_SHIFT)
675#define MIPS_SEGCFG_AM_SHIFT 4
676#define MIPS_SEGCFG_AM (_ULCAST_(7) << MIPS_SEGCFG_AM_SHIFT)
677#define MIPS_SEGCFG_EU_SHIFT 3
678#define MIPS_SEGCFG_EU (_ULCAST_(1) << MIPS_SEGCFG_EU_SHIFT)
679#define MIPS_SEGCFG_C_SHIFT 0
680#define MIPS_SEGCFG_C (_ULCAST_(7) << MIPS_SEGCFG_C_SHIFT)
681
682#define MIPS_SEGCFG_UUSK _ULCAST_(7)
683#define MIPS_SEGCFG_USK _ULCAST_(5)
684#define MIPS_SEGCFG_MUSUK _ULCAST_(4)
685#define MIPS_SEGCFG_MUSK _ULCAST_(3)
686#define MIPS_SEGCFG_MSK _ULCAST_(2)
687#define MIPS_SEGCFG_MK _ULCAST_(1)
688#define MIPS_SEGCFG_UK _ULCAST_(0)
689
631#ifndef __ASSEMBLY__ 690#ifndef __ASSEMBLY__
632 691
633/* 692/*
@@ -649,6 +708,19 @@ static inline int mm_insn_16bit(u16 insn)
649} 708}
650 709
651/* 710/*
711 * TLB Invalidate Flush
712 */
713static inline void tlbinvf(void)
714{
715 __asm__ __volatile__(
716 ".set push\n\t"
717 ".set noreorder\n\t"
718 ".word 0x42000004\n\t" /* tlbinvf */
719 ".set pop");
720}
721
722
723/*
652 * Functions to access the R10000 performance counters. These are basically 724 * Functions to access the R10000 performance counters. These are basically
653 * mfc0 and mtc0 instructions from and to coprocessor register with a 5-bit 725 * mfc0 and mtc0 instructions from and to coprocessor register with a 5-bit
654 * performance counter number encoded into bits 1 ... 5 of the instruction. 726 * performance counter number encoded into bits 1 ... 5 of the instruction.
@@ -1102,6 +1174,15 @@ do { \
1102#define read_c0_ebase() __read_32bit_c0_register($15, 1) 1174#define read_c0_ebase() __read_32bit_c0_register($15, 1)
1103#define write_c0_ebase(val) __write_32bit_c0_register($15, 1, val) 1175#define write_c0_ebase(val) __write_32bit_c0_register($15, 1, val)
1104 1176
1177/* MIPSR3 */
1178#define read_c0_segctl0() __read_32bit_c0_register($5, 2)
1179#define write_c0_segctl0(val) __write_32bit_c0_register($5, 2, val)
1180
1181#define read_c0_segctl1() __read_32bit_c0_register($5, 3)
1182#define write_c0_segctl1(val) __write_32bit_c0_register($5, 3, val)
1183
1184#define read_c0_segctl2() __read_32bit_c0_register($5, 4)
1185#define write_c0_segctl2(val) __write_32bit_c0_register($5, 4, val)
1105 1186
1106/* Cavium OCTEON (cnMIPS) */ 1187/* Cavium OCTEON (cnMIPS) */
1107#define read_c0_cvmcount() __read_ulong_c0_register($9, 6) 1188#define read_c0_cvmcount() __read_ulong_c0_register($9, 6)