.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2015 Russell King |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or modify |
---|
5 | | - * it under the terms of the GNU General Public License version 2 as |
---|
6 | | - * published by the Free Software Foundation. |
---|
7 | 4 | * |
---|
8 | 5 | * This assembly is required to safely remap the physical address space |
---|
9 | 6 | * for Keystone 2 |
---|
10 | 7 | */ |
---|
11 | 8 | #include <linux/linkage.h> |
---|
| 9 | +#include <linux/pgtable.h> |
---|
12 | 10 | #include <asm/asm-offsets.h> |
---|
13 | 11 | #include <asm/cp15.h> |
---|
14 | 12 | #include <asm/memory.h> |
---|
15 | | -#include <asm/pgtable.h> |
---|
16 | 13 | |
---|
17 | 14 | .section ".idmap.text", "ax" |
---|
18 | 15 | |
---|
.. | .. |
---|
33 | 30 | add r7, r2, #0x1000 |
---|
34 | 31 | add r6, r7, r6, lsr #SECTION_SHIFT - L2_ORDER |
---|
35 | 32 | add r7, r7, #PAGE_OFFSET >> (SECTION_SHIFT - L2_ORDER) |
---|
36 | | -1: ldrd r4, [r7] |
---|
| 33 | +1: ldrd r4, r5, [r7] |
---|
37 | 34 | adds r4, r4, r0 |
---|
38 | 35 | adc r5, r5, r1 |
---|
39 | | - strd r4, [r7], #1 << L2_ORDER |
---|
| 36 | + strd r4, r5, [r7], #1 << L2_ORDER |
---|
40 | 37 | cmp r7, r6 |
---|
41 | 38 | bls 1b |
---|
42 | 39 | |
---|
43 | 40 | /* Update level 2 entries for the boot data */ |
---|
44 | 41 | add r7, r2, #0x1000 |
---|
45 | | - add r7, r7, r3, lsr #SECTION_SHIFT - L2_ORDER |
---|
46 | | - bic r7, r7, #(1 << L2_ORDER) - 1 |
---|
47 | | - ldrd r4, [r7] |
---|
| 42 | + movw r3, #FDT_FIXED_BASE >> (SECTION_SHIFT - L2_ORDER) |
---|
| 43 | + add r7, r7, r3 |
---|
| 44 | + ldrd r4, r5, [r7] |
---|
48 | 45 | adds r4, r4, r0 |
---|
49 | 46 | adc r5, r5, r1 |
---|
50 | | - strd r4, [r7], #1 << L2_ORDER |
---|
51 | | - ldrd r4, [r7] |
---|
| 47 | + strd r4, r5, [r7], #1 << L2_ORDER |
---|
| 48 | + ldrd r4, r5, [r7] |
---|
52 | 49 | adds r4, r4, r0 |
---|
53 | 50 | adc r5, r5, r1 |
---|
54 | | - strd r4, [r7] |
---|
| 51 | + strd r4, r5, [r7] |
---|
55 | 52 | |
---|
56 | 53 | /* Update level 1 entries */ |
---|
57 | 54 | mov r6, #4 |
---|
58 | 55 | mov r7, r2 |
---|
59 | | -2: ldrd r4, [r7] |
---|
| 56 | +2: ldrd r4, r5, [r7] |
---|
60 | 57 | adds r4, r4, r0 |
---|
61 | 58 | adc r5, r5, r1 |
---|
62 | | - strd r4, [r7], #1 << L1_ORDER |
---|
| 59 | + strd r4, r5, [r7], #1 << L1_ORDER |
---|
63 | 60 | subs r6, r6, #1 |
---|
64 | 61 | bne 2b |
---|
65 | 62 | |
---|