armv7-a: Inner Shareable TLB maintenance operations
Summary: - Use Inner Shareable for TLB maintenance operations - Add config option as CONFIG_ARM_HAVE_MPCORE - This PR is in preparation for smp with kernel build Impact: - armv7-a Testing: - sabre-6quad:smp w/ qemu - sabre-6quad:knsh_smp w/ qemu (WIP) Signed-off-by: Oki Minabe <minabe.oki@gmail.com>
This commit is contained in:
parent
45fb96c508
commit
4fa21c4719
@ -662,6 +662,7 @@ config ARCH_CORTEXA5
|
|||||||
select ARCH_HAVE_MMU
|
select ARCH_HAVE_MMU
|
||||||
select ARCH_USE_MMU
|
select ARCH_USE_MMU
|
||||||
select ARCH_HAVE_TESTSET
|
select ARCH_HAVE_TESTSET
|
||||||
|
select ARM_HAVE_MPCORE
|
||||||
|
|
||||||
config ARCH_CORTEXA7
|
config ARCH_CORTEXA7
|
||||||
bool
|
bool
|
||||||
@ -672,6 +673,7 @@ config ARCH_CORTEXA7
|
|||||||
select ARCH_HAVE_MMU
|
select ARCH_HAVE_MMU
|
||||||
select ARCH_USE_MMU
|
select ARCH_USE_MMU
|
||||||
select ARCH_HAVE_TESTSET
|
select ARCH_HAVE_TESTSET
|
||||||
|
select ARM_HAVE_MPCORE
|
||||||
|
|
||||||
config ARCH_CORTEXA8
|
config ARCH_CORTEXA8
|
||||||
bool
|
bool
|
||||||
@ -692,6 +694,7 @@ config ARCH_CORTEXA9
|
|||||||
select ARCH_HAVE_MMU
|
select ARCH_HAVE_MMU
|
||||||
select ARCH_USE_MMU
|
select ARCH_USE_MMU
|
||||||
select ARCH_HAVE_TESTSET
|
select ARCH_HAVE_TESTSET
|
||||||
|
select ARM_HAVE_MPCORE
|
||||||
|
|
||||||
config ARCH_ARMV7R
|
config ARCH_ARMV7R
|
||||||
bool
|
bool
|
||||||
@ -924,6 +927,12 @@ config ARM_HAVE_MPU_UNIFIED
|
|||||||
Automatically selected to indicate that the CPU supports a
|
Automatically selected to indicate that the CPU supports a
|
||||||
unified MPU for both instruction and data addresses.
|
unified MPU for both instruction and data addresses.
|
||||||
|
|
||||||
|
config ARM_HAVE_MPCORE
|
||||||
|
bool
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Decide whether support MPCore extension
|
||||||
|
|
||||||
config ARM_MPU
|
config ARM_MPU
|
||||||
bool "MPU support"
|
bool "MPU support"
|
||||||
default n
|
default n
|
||||||
|
@ -200,11 +200,17 @@ __cpu3_start:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
mov r0, #0
|
mov r0, #0
|
||||||
|
#ifdef CONFIG_ARM_HAVE_MPCORE
|
||||||
|
mcr CP15_TLBIALLIS(r0) /* Invalidate the entire unified TLB */
|
||||||
|
mcr CP15_BPIALLIS(r0) /* Invalidate entire branch prediction array */
|
||||||
|
mcr CP15_ICIALLUIS(r0) /* Invalidate I-cache */
|
||||||
|
#else
|
||||||
mcr CP15_TLBIALL(r0,c7) /* Invalidate the entire unified TLB */
|
mcr CP15_TLBIALL(r0,c7) /* Invalidate the entire unified TLB */
|
||||||
mcr CP15_TLBIALL(r0,c6)
|
mcr CP15_TLBIALL(r0,c6)
|
||||||
mcr CP15_TLBIALL(r0,c5)
|
mcr CP15_TLBIALL(r0,c5)
|
||||||
mcr CP15_BPIALL(r0) /* Invalidate entire branch prediction array */
|
mcr CP15_BPIALL(r0) /* Invalidate entire branch prediction array */
|
||||||
mcr CP15_ICIALLU(r0) /* Invalidate I-cache */
|
mcr CP15_ICIALLU(r0) /* Invalidate I-cache */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Load the page table address.
|
/* Load the page table address.
|
||||||
*
|
*
|
||||||
|
@ -326,11 +326,17 @@ __start:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
mov r0, #0
|
mov r0, #0
|
||||||
|
#ifdef CONFIG_ARM_HAVE_MPCORE
|
||||||
|
mcr CP15_TLBIALLIS(r0) /* Invalidate the entire unified TLB */
|
||||||
|
mcr CP15_BPIALLIS(r0) /* Invalidate entire branch prediction array */
|
||||||
|
mcr CP15_ICIALLUIS(r0) /* Invalidate I-cache */
|
||||||
|
#else
|
||||||
mcr CP15_TLBIALL(r0,c7) /* Invalidate the entire unified TLB */
|
mcr CP15_TLBIALL(r0,c7) /* Invalidate the entire unified TLB */
|
||||||
mcr CP15_TLBIALL(r0,c6)
|
mcr CP15_TLBIALL(r0,c6)
|
||||||
mcr CP15_TLBIALL(r0,c5)
|
mcr CP15_TLBIALL(r0,c5)
|
||||||
mcr CP15_BPIALL(r0) /* Invalidate entire branch prediction array */
|
mcr CP15_BPIALL(r0) /* Invalidate entire branch prediction array */
|
||||||
mcr CP15_ICIALLU(r0) /* Invalidate I-cache */
|
mcr CP15_ICIALLU(r0) /* Invalidate I-cache */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Load the page table address.
|
/* Load the page table address.
|
||||||
*
|
*
|
||||||
|
@ -963,10 +963,10 @@ struct section_mapping_s
|
|||||||
|
|
||||||
.macro cp15_invalidate_tlb_bymva, vaddr
|
.macro cp15_invalidate_tlb_bymva, vaddr
|
||||||
dsb
|
dsb
|
||||||
#if defined(CONFIG_ARCH_CORTEXA8)
|
#ifdef CONFIG_ARM_HAVE_MPCORE
|
||||||
mcr p15, 0, \vaddr, c8, c7, 1 /* TLBIMVA */
|
|
||||||
#else
|
|
||||||
mcr p15, 0, \vaddr, c8, c3, 3 /* TLBIMVAAIS */
|
mcr p15, 0, \vaddr, c8, c3, 3 /* TLBIMVAAIS */
|
||||||
|
#else
|
||||||
|
mcr p15, 0, \vaddr, c8, c7, 1 /* TLBIMVA */
|
||||||
#endif
|
#endif
|
||||||
dsb
|
dsb
|
||||||
isb
|
isb
|
||||||
@ -1227,7 +1227,16 @@ static inline void cp15_invalidate_tlbs(void)
|
|||||||
{
|
{
|
||||||
__asm__ __volatile__
|
__asm__ __volatile__
|
||||||
(
|
(
|
||||||
|
"\tdsb\n"
|
||||||
|
#ifdef CONFIG_ARM_HAVE_MPCORE
|
||||||
|
"\tmcr p15, 0, r0, c8, c3, 0\n" /* TLBIALLIS */
|
||||||
|
"\tmcr p15, 0, r0, c7, c1, 6\n" /* BPIALLIS */
|
||||||
|
#else
|
||||||
"\tmcr p15, 0, r0, c8, c7, 0\n" /* TLBIALL */
|
"\tmcr p15, 0, r0, c8, c7, 0\n" /* TLBIALL */
|
||||||
|
"\tmcr p15, 0, r0, c7, c5, 6\n" /* BPIALL */
|
||||||
|
#endif
|
||||||
|
"\tdsb\n"
|
||||||
|
"\tisb\n"
|
||||||
:
|
:
|
||||||
:
|
:
|
||||||
: "r0", "memory"
|
: "r0", "memory"
|
||||||
@ -1250,10 +1259,12 @@ static inline void cp15_invalidate_tlb_bymva(uint32_t vaddr)
|
|||||||
__asm__ __volatile__
|
__asm__ __volatile__
|
||||||
(
|
(
|
||||||
"\tdsb\n"
|
"\tdsb\n"
|
||||||
#if defined(CONFIG_ARCH_CORTEXA8)
|
#ifdef CONFIG_ARM_HAVE_MPCORE
|
||||||
"\tmcr p15, 0, %0, c8, c7, 1\n" /* TLBIMVA */
|
|
||||||
#else
|
|
||||||
"\tmcr p15, 0, %0, c8, c3, 3\n" /* TLBIMVAAIS */
|
"\tmcr p15, 0, %0, c8, c3, 3\n" /* TLBIMVAAIS */
|
||||||
|
"\tmcr p15, 0, r0, c7, c1, 6\n" /* BPIALLIS */
|
||||||
|
#else
|
||||||
|
"\tmcr p15, 0, %0, c8, c7, 1\n" /* TLBIMVA */
|
||||||
|
"\tmcr p15, 0, r0, c7, c5, 6\n" /* BPIALL */
|
||||||
#endif
|
#endif
|
||||||
"\tdsb\n"
|
"\tdsb\n"
|
||||||
"\tisb\n"
|
"\tisb\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user