diff options
Diffstat (limited to 'arch/mips/include')
| -rw-r--r-- | arch/mips/include/asm/cpu-features.h | 4 | ||||
| -rw-r--r-- | arch/mips/include/asm/cpu.h | 1 | ||||
| -rw-r--r-- | arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h | 2 | ||||
| -rw-r--r-- | arch/mips/include/asm/mipsregs.h | 1 | ||||
| -rw-r--r-- | arch/mips/include/asm/pgtable-bits.h | 18 | ||||
| -rw-r--r-- | arch/mips/include/asm/pgtable.h | 12 |
6 files changed, 20 insertions, 18 deletions
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h index ca400f7c3f59..63002a240c73 100644 --- a/arch/mips/include/asm/cpu-features.h +++ b/arch/mips/include/asm/cpu-features.h | |||
| @@ -95,8 +95,8 @@ | |||
| 95 | #ifndef cpu_has_smartmips | 95 | #ifndef cpu_has_smartmips |
| 96 | #define cpu_has_smartmips (cpu_data[0].ases & MIPS_ASE_SMARTMIPS) | 96 | #define cpu_has_smartmips (cpu_data[0].ases & MIPS_ASE_SMARTMIPS) |
| 97 | #endif | 97 | #endif |
| 98 | #ifndef kernel_uses_smartmips_rixi | 98 | #ifndef cpu_has_rixi |
| 99 | #define kernel_uses_smartmips_rixi 0 | 99 | #define cpu_has_rixi (cpu_data[0].options & MIPS_CPU_RIXI) |
| 100 | #endif | 100 | #endif |
| 101 | #ifndef cpu_has_vtag_icache | 101 | #ifndef cpu_has_vtag_icache |
| 102 | #define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG) | 102 | #define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG) |
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h index f21b7c04e95a..1037d54f0597 100644 --- a/arch/mips/include/asm/cpu.h +++ b/arch/mips/include/asm/cpu.h | |||
| @@ -319,6 +319,7 @@ enum cpu_type_enum { | |||
| 319 | #define MIPS_CPU_VINT 0x00080000 /* CPU supports MIPSR2 vectored interrupts */ | 319 | #define MIPS_CPU_VINT 0x00080000 /* CPU supports MIPSR2 vectored interrupts */ |
| 320 | #define MIPS_CPU_VEIC 0x00100000 /* CPU supports MIPSR2 external interrupt controller mode */ | 320 | #define MIPS_CPU_VEIC 0x00100000 /* CPU supports MIPSR2 external interrupt controller mode */ |
| 321 | #define MIPS_CPU_ULRI 0x00200000 /* CPU has ULRI feature */ | 321 | #define MIPS_CPU_ULRI 0x00200000 /* CPU has ULRI feature */ |
| 322 | #define MIPS_CPU_RIXI 0x00400000 /* CPU has TLB Read/eXec Inhibit */ | ||
| 322 | 323 | ||
| 323 | /* | 324 | /* |
| 324 | * CPU ASE encodings | 325 | * CPU ASE encodings |
diff --git a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h index a58addb98cfd..375ad0c815fe 100644 --- a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h +++ b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h | |||
| @@ -58,7 +58,7 @@ | |||
| 58 | #define cpu_has_veic 0 | 58 | #define cpu_has_veic 0 |
| 59 | #define cpu_hwrena_impl_bits 0xc0000000 | 59 | #define cpu_hwrena_impl_bits 0xc0000000 |
| 60 | 60 | ||
| 61 | #define kernel_uses_smartmips_rixi (cpu_data[0].cputype != CPU_CAVIUM_OCTEON) | 61 | #define cpu_has_rixi (cpu_data[0].cputype != CPU_CAVIUM_OCTEON) |
| 62 | 62 | ||
| 63 | #define ARCH_HAS_IRQ_PER_CPU 1 | 63 | #define ARCH_HAS_IRQ_PER_CPU 1 |
| 64 | #define ARCH_HAS_SPINLOCK_PREFETCH 1 | 64 | #define ARCH_HAS_SPINLOCK_PREFETCH 1 |
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index 7f87d824eeb0..4199dd3f8d54 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h | |||
| @@ -590,6 +590,7 @@ | |||
| 590 | #define MIPS_CONF3_VEIC (_ULCAST_(1) << 6) | 590 | #define MIPS_CONF3_VEIC (_ULCAST_(1) << 6) |
| 591 | #define MIPS_CONF3_LPA (_ULCAST_(1) << 7) | 591 | #define MIPS_CONF3_LPA (_ULCAST_(1) << 7) |
| 592 | #define MIPS_CONF3_DSP (_ULCAST_(1) << 10) | 592 | #define MIPS_CONF3_DSP (_ULCAST_(1) << 10) |
| 593 | #define MIPS_CONF3_RXI (_ULCAST_(1) << 12) | ||
| 593 | #define MIPS_CONF3_ULRI (_ULCAST_(1) << 13) | 594 | #define MIPS_CONF3_ULRI (_ULCAST_(1) << 13) |
| 594 | 595 | ||
| 595 | #define MIPS_CONF4_MMUSIZEEXT (_ULCAST_(255) << 0) | 596 | #define MIPS_CONF4_MMUSIZEEXT (_ULCAST_(255) << 0) |
diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h index e9fe7e97ce4c..da4ba49adcf6 100644 --- a/arch/mips/include/asm/pgtable-bits.h +++ b/arch/mips/include/asm/pgtable-bits.h | |||
| @@ -79,9 +79,9 @@ | |||
| 79 | /* implemented in software */ | 79 | /* implemented in software */ |
| 80 | #define _PAGE_PRESENT_SHIFT (0) | 80 | #define _PAGE_PRESENT_SHIFT (0) |
| 81 | #define _PAGE_PRESENT (1 << _PAGE_PRESENT_SHIFT) | 81 | #define _PAGE_PRESENT (1 << _PAGE_PRESENT_SHIFT) |
| 82 | /* implemented in software, should be unused if kernel_uses_smartmips_rixi. */ | 82 | /* implemented in software, should be unused if cpu_has_rixi. */ |
| 83 | #define _PAGE_READ_SHIFT (kernel_uses_smartmips_rixi ? _PAGE_PRESENT_SHIFT : _PAGE_PRESENT_SHIFT + 1) | 83 | #define _PAGE_READ_SHIFT (cpu_has_rixi ? _PAGE_PRESENT_SHIFT : _PAGE_PRESENT_SHIFT + 1) |
| 84 | #define _PAGE_READ ({if (kernel_uses_smartmips_rixi) BUG(); 1 << _PAGE_READ_SHIFT; }) | 84 | #define _PAGE_READ ({BUG_ON(cpu_has_rixi); 1 << _PAGE_READ_SHIFT; }) |
| 85 | /* implemented in software */ | 85 | /* implemented in software */ |
| 86 | #define _PAGE_WRITE_SHIFT (_PAGE_READ_SHIFT + 1) | 86 | #define _PAGE_WRITE_SHIFT (_PAGE_READ_SHIFT + 1) |
| 87 | #define _PAGE_WRITE (1 << _PAGE_WRITE_SHIFT) | 87 | #define _PAGE_WRITE (1 << _PAGE_WRITE_SHIFT) |
| @@ -104,12 +104,12 @@ | |||
| 104 | #endif | 104 | #endif |
| 105 | 105 | ||
| 106 | /* Page cannot be executed */ | 106 | /* Page cannot be executed */ |
| 107 | #define _PAGE_NO_EXEC_SHIFT (kernel_uses_smartmips_rixi ? _PAGE_HUGE_SHIFT + 1 : _PAGE_HUGE_SHIFT) | 107 | #define _PAGE_NO_EXEC_SHIFT (cpu_has_rixi ? _PAGE_HUGE_SHIFT + 1 : _PAGE_HUGE_SHIFT) |
| 108 | #define _PAGE_NO_EXEC ({if (!kernel_uses_smartmips_rixi) BUG(); 1 << _PAGE_NO_EXEC_SHIFT; }) | 108 | #define _PAGE_NO_EXEC ({BUG_ON(!cpu_has_rixi); 1 << _PAGE_NO_EXEC_SHIFT; }) |
| 109 | 109 | ||
| 110 | /* Page cannot be read */ | 110 | /* Page cannot be read */ |
| 111 | #define _PAGE_NO_READ_SHIFT (kernel_uses_smartmips_rixi ? _PAGE_NO_EXEC_SHIFT + 1 : _PAGE_NO_EXEC_SHIFT) | 111 | #define _PAGE_NO_READ_SHIFT (cpu_has_rixi ? _PAGE_NO_EXEC_SHIFT + 1 : _PAGE_NO_EXEC_SHIFT) |
| 112 | #define _PAGE_NO_READ ({if (!kernel_uses_smartmips_rixi) BUG(); 1 << _PAGE_NO_READ_SHIFT; }) | 112 | #define _PAGE_NO_READ ({BUG_ON(!cpu_has_rixi); 1 << _PAGE_NO_READ_SHIFT; }) |
| 113 | 113 | ||
| 114 | #define _PAGE_GLOBAL_SHIFT (_PAGE_NO_READ_SHIFT + 1) | 114 | #define _PAGE_GLOBAL_SHIFT (_PAGE_NO_READ_SHIFT + 1) |
| 115 | #define _PAGE_GLOBAL (1 << _PAGE_GLOBAL_SHIFT) | 115 | #define _PAGE_GLOBAL (1 << _PAGE_GLOBAL_SHIFT) |
| @@ -155,7 +155,7 @@ | |||
| 155 | */ | 155 | */ |
| 156 | static inline uint64_t pte_to_entrylo(unsigned long pte_val) | 156 | static inline uint64_t pte_to_entrylo(unsigned long pte_val) |
| 157 | { | 157 | { |
| 158 | if (kernel_uses_smartmips_rixi) { | 158 | if (cpu_has_rixi) { |
| 159 | int sa; | 159 | int sa; |
| 160 | #ifdef CONFIG_32BIT | 160 | #ifdef CONFIG_32BIT |
| 161 | sa = 31 - _PAGE_NO_READ_SHIFT; | 161 | sa = 31 - _PAGE_NO_READ_SHIFT; |
| @@ -220,7 +220,7 @@ static inline uint64_t pte_to_entrylo(unsigned long pte_val) | |||
| 220 | 220 | ||
| 221 | #endif | 221 | #endif |
| 222 | 222 | ||
| 223 | #define __READABLE (_PAGE_SILENT_READ | _PAGE_ACCESSED | (kernel_uses_smartmips_rixi ? 0 : _PAGE_READ)) | 223 | #define __READABLE (_PAGE_SILENT_READ | _PAGE_ACCESSED | (cpu_has_rixi ? 0 : _PAGE_READ)) |
| 224 | #define __WRITEABLE (_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED) | 224 | #define __WRITEABLE (_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED) |
| 225 | 225 | ||
| 226 | #define _PAGE_CHG_MASK (_PFN_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | _CACHE_MASK) | 226 | #define _PAGE_CHG_MASK (_PFN_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | _CACHE_MASK) |
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h index b2202a68cf0f..c02158be836c 100644 --- a/arch/mips/include/asm/pgtable.h +++ b/arch/mips/include/asm/pgtable.h | |||
| @@ -22,15 +22,15 @@ struct mm_struct; | |||
| 22 | struct vm_area_struct; | 22 | struct vm_area_struct; |
| 23 | 23 | ||
| 24 | #define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT) | 24 | #define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT) |
| 25 | #define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_WRITE | (kernel_uses_smartmips_rixi ? 0 : _PAGE_READ) | \ | 25 | #define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_WRITE | (cpu_has_rixi ? 0 : _PAGE_READ) | \ |
| 26 | _page_cachable_default) | 26 | _page_cachable_default) |
| 27 | #define PAGE_COPY __pgprot(_PAGE_PRESENT | (kernel_uses_smartmips_rixi ? 0 : _PAGE_READ) | \ | 27 | #define PAGE_COPY __pgprot(_PAGE_PRESENT | (cpu_has_rixi ? 0 : _PAGE_READ) | \ |
| 28 | (kernel_uses_smartmips_rixi ? _PAGE_NO_EXEC : 0) | _page_cachable_default) | 28 | (cpu_has_rixi ? _PAGE_NO_EXEC : 0) | _page_cachable_default) |
| 29 | #define PAGE_READONLY __pgprot(_PAGE_PRESENT | (kernel_uses_smartmips_rixi ? 0 : _PAGE_READ) | \ | 29 | #define PAGE_READONLY __pgprot(_PAGE_PRESENT | (cpu_has_rixi ? 0 : _PAGE_READ) | \ |
| 30 | _page_cachable_default) | 30 | _page_cachable_default) |
| 31 | #define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \ | 31 | #define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \ |
| 32 | _PAGE_GLOBAL | _page_cachable_default) | 32 | _PAGE_GLOBAL | _page_cachable_default) |
| 33 | #define PAGE_USERIO __pgprot(_PAGE_PRESENT | (kernel_uses_smartmips_rixi ? 0 : _PAGE_READ) | _PAGE_WRITE | \ | 33 | #define PAGE_USERIO __pgprot(_PAGE_PRESENT | (cpu_has_rixi ? 0 : _PAGE_READ) | _PAGE_WRITE | \ |
| 34 | _page_cachable_default) | 34 | _page_cachable_default) |
| 35 | #define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \ | 35 | #define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \ |
| 36 | __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED) | 36 | __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED) |
| @@ -299,7 +299,7 @@ static inline pte_t pte_mkdirty(pte_t pte) | |||
| 299 | static inline pte_t pte_mkyoung(pte_t pte) | 299 | static inline pte_t pte_mkyoung(pte_t pte) |
| 300 | { | 300 | { |
| 301 | pte_val(pte) |= _PAGE_ACCESSED; | 301 | pte_val(pte) |= _PAGE_ACCESSED; |
| 302 | if (kernel_uses_smartmips_rixi) { | 302 | if (cpu_has_rixi) { |
| 303 | if (!(pte_val(pte) & _PAGE_NO_READ)) | 303 | if (!(pte_val(pte) & _PAGE_NO_READ)) |
| 304 | pte_val(pte) |= _PAGE_SILENT_READ; | 304 | pte_val(pte) |= _PAGE_SILENT_READ; |
| 305 | } else { | 305 | } else { |
