~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mm/pv-fixup-asm.S

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  *  Copyright (C) 2015 Russell King
  4  *
  5  * This assembly is required to safely remap the physical address space
  6  * for Keystone 2
  7  */
  8 #include <linux/linkage.h>
  9 #include <linux/pgtable.h>
 10 #include <asm/asm-offsets.h>
 11 #include <asm/cp15.h>
 12 #include <asm/page.h>
 13 
 14         .section ".idmap.text", "ax"
 15 
 16 #define L1_ORDER 3
 17 #define L2_ORDER 3
 18 
 19 ENTRY(lpae_pgtables_remap_asm)
 20         stmfd   sp!, {r4-r8, lr}
 21 
 22         mrc     p15, 0, r8, c1, c0, 0           @ read control reg
 23         bic     ip, r8, #CR_M                   @ disable caches and MMU
 24         mcr     p15, 0, ip, c1, c0, 0
 25         dsb
 26         isb
 27 
 28         /* Update level 2 entries covering the kernel */
 29         ldr     r6, =(_end - 1)
 30         add     r7, r2, #0x1000
 31         add     r6, r7, r6, lsr #SECTION_SHIFT - L2_ORDER
 32         add     r7, r7, #KERNEL_OFFSET >> (SECTION_SHIFT - L2_ORDER)
 33 1:      ldrd    r4, r5, [r7]
 34         adds    r4, r4, r0
 35         adc     r5, r5, r1
 36         strd    r4, r5, [r7], #1 << L2_ORDER
 37         cmp     r7, r6
 38         bls     1b
 39 
 40         /* Update level 2 entries for the boot data */
 41         add     r7, r2, #0x1000
 42         movw    r3, #FDT_FIXED_BASE >> (SECTION_SHIFT - L2_ORDER)
 43         add     r7, r7, r3
 44         ldrd    r4, r5, [r7]
 45         adds    r4, r4, r0
 46         adc     r5, r5, r1
 47         strd    r4, r5, [r7], #1 << L2_ORDER
 48         ldrd    r4, r5, [r7]
 49         adds    r4, r4, r0
 50         adc     r5, r5, r1
 51         strd    r4, r5, [r7]
 52 
 53         /* Update level 1 entries */
 54         mov     r6, #4
 55         mov     r7, r2
 56 2:      ldrd    r4, r5, [r7]
 57         adds    r4, r4, r0
 58         adc     r5, r5, r1
 59         strd    r4, r5, [r7], #1 << L1_ORDER
 60         subs    r6, r6, #1
 61         bne     2b
 62 
 63         mrrc    p15, 0, r4, r5, c2              @ read TTBR0
 64         adds    r4, r4, r0                      @ update physical address
 65         adc     r5, r5, r1
 66         mcrr    p15, 0, r4, r5, c2              @ write back TTBR0
 67         mrrc    p15, 1, r4, r5, c2              @ read TTBR1
 68         adds    r4, r4, r0                      @ update physical address
 69         adc     r5, r5, r1
 70         mcrr    p15, 1, r4, r5, c2              @ write back TTBR1
 71 
 72         dsb
 73 
 74         mov     ip, #0
 75         mcr     p15, 0, ip, c7, c5, 0           @ I+BTB cache invalidate
 76         mcr     p15, 0, ip, c8, c7, 0           @ local_flush_tlb_all()
 77         dsb
 78         isb
 79 
 80         mcr     p15, 0, r8, c1, c0, 0           @ re-enable MMU
 81         dsb
 82         isb
 83 
 84         ldmfd   sp!, {r4-r8, pc}
 85 ENDPROC(lpae_pgtables_remap_asm)

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php