Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *  linux/arch/arm/mm/tlb-fa.S
0004  *
0005  *  Copyright (C) 2005 Faraday Corp.
0006  *  Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
0007  *
0008  * Based on tlb-v4wbi.S:
0009  *  Copyright (C) 1997-2002 Russell King
0010  *
0011  *  ARM architecture version 4, Faraday variation.
0012  *  This assume an unified TLBs, with a write buffer, and branch target buffer (BTB)
0013  *
0014  *  Processors: FA520 FA526 FA626
0015  */
0016 #include <linux/linkage.h>
0017 #include <linux/init.h>
0018 #include <asm/assembler.h>
0019 #include <asm/asm-offsets.h>
0020 #include <asm/tlbflush.h>
0021 #include "proc-macros.S"
0022 
0023 
0024 /*
0025  *  flush_user_tlb_range(start, end, mm)
0026  *
0027  *  Invalidate a range of TLB entries in the specified address space.
0028  *
0029  *  - start - range start address
0030  *  - end   - range end address
0031  *  - mm    - mm_struct describing address space
0032  */
0033     .align  4
0034 ENTRY(fa_flush_user_tlb_range)
0035     vma_vm_mm ip, r2
0036     act_mm  r3              @ get current->active_mm
0037     eors    r3, ip, r3          @ == mm ?
0038     retne   lr              @ no, we dont do anything
0039     mov r3, #0
0040     mcr p15, 0, r3, c7, c10, 4      @ drain WB
0041     bic r0, r0, #0x0ff
0042     bic r0, r0, #0xf00
0043 1:  mcr p15, 0, r0, c8, c7, 1       @ invalidate UTLB entry
0044     add r0, r0, #PAGE_SZ
0045     cmp r0, r1
0046     blo 1b
0047     mcr p15, 0, r3, c7, c10, 4      @ data write barrier
0048     ret lr
0049 
0050 
0051 ENTRY(fa_flush_kern_tlb_range)
0052     mov r3, #0
0053     mcr p15, 0, r3, c7, c10, 4      @ drain WB
0054     bic r0, r0, #0x0ff
0055     bic r0, r0, #0xf00
0056 1:  mcr p15, 0, r0, c8, c7, 1       @ invalidate UTLB entry
0057     add r0, r0, #PAGE_SZ
0058     cmp r0, r1
0059     blo 1b
0060     mcr p15, 0, r3, c7, c10, 4      @ data write barrier
0061     mcr p15, 0, r3, c7, c5, 4       @ prefetch flush (isb)
0062     ret lr
0063 
0064     __INITDATA
0065 
0066     /* define struct cpu_tlb_fns (see <asm/tlbflush.h> and proc-macros.S) */
0067     define_tlb_functions fa, fa_tlb_flags