diff options
Diffstat (limited to 'arch/microblaze/kernel/misc.S')
-rw-r--r-- | arch/microblaze/kernel/misc.S | 43 |
1 files changed, 9 insertions, 34 deletions
diff --git a/arch/microblaze/kernel/misc.S b/arch/microblaze/kernel/misc.S index df16c6287a8e..0fb5fc6c1fc2 100644 --- a/arch/microblaze/kernel/misc.S +++ b/arch/microblaze/kernel/misc.S | |||
@@ -26,9 +26,10 @@ | |||
26 | * We avoid flushing the pinned 0, 1 and possibly 2 entries. | 26 | * We avoid flushing the pinned 0, 1 and possibly 2 entries. |
27 | */ | 27 | */ |
28 | .globl _tlbia; | 28 | .globl _tlbia; |
29 | .type _tlbia, @function | ||
29 | .align 4; | 30 | .align 4; |
30 | _tlbia: | 31 | _tlbia: |
31 | addik r12, r0, 63 /* flush all entries (63 - 3) */ | 32 | addik r12, r0, MICROBLAZE_TLB_SIZE - 1 /* flush all entries (63 - 3) */ |
32 | /* isync */ | 33 | /* isync */ |
33 | _tlbia_1: | 34 | _tlbia_1: |
34 | mts rtlbx, r12 | 35 | mts rtlbx, r12 |
@@ -41,11 +42,13 @@ _tlbia_1: | |||
41 | /* sync */ | 42 | /* sync */ |
42 | rtsd r15, 8 | 43 | rtsd r15, 8 |
43 | nop | 44 | nop |
45 | .size _tlbia, . - _tlbia | ||
44 | 46 | ||
45 | /* | 47 | /* |
46 | * Flush MMU TLB for a particular address (in r5) | 48 | * Flush MMU TLB for a particular address (in r5) |
47 | */ | 49 | */ |
48 | .globl _tlbie; | 50 | .globl _tlbie; |
51 | .type _tlbie, @function | ||
49 | .align 4; | 52 | .align 4; |
50 | _tlbie: | 53 | _tlbie: |
51 | mts rtlbsx, r5 /* look up the address in TLB */ | 54 | mts rtlbsx, r5 /* look up the address in TLB */ |
@@ -59,17 +62,20 @@ _tlbie_1: | |||
59 | rtsd r15, 8 | 62 | rtsd r15, 8 |
60 | nop | 63 | nop |
61 | 64 | ||
65 | .size _tlbie, . - _tlbie | ||
66 | |||
62 | /* | 67 | /* |
63 | * Allocate TLB entry for early console | 68 | * Allocate TLB entry for early console |
64 | */ | 69 | */ |
65 | .globl early_console_reg_tlb_alloc; | 70 | .globl early_console_reg_tlb_alloc; |
71 | .type early_console_reg_tlb_alloc, @function | ||
66 | .align 4; | 72 | .align 4; |
67 | early_console_reg_tlb_alloc: | 73 | early_console_reg_tlb_alloc: |
68 | /* | 74 | /* |
69 | * Load a TLB entry for the UART, so that microblaze_progress() can use | 75 | * Load a TLB entry for the UART, so that microblaze_progress() can use |
70 | * the UARTs nice and early. We use a 4k real==virtual mapping. | 76 | * the UARTs nice and early. We use a 4k real==virtual mapping. |
71 | */ | 77 | */ |
72 | ori r4, r0, 63 | 78 | ori r4, r0, MICROBLAZE_TLB_SIZE - 1 |
73 | mts rtlbx, r4 /* TLB slot 2 */ | 79 | mts rtlbx, r4 /* TLB slot 2 */ |
74 | 80 | ||
75 | or r4,r5,r0 | 81 | or r4,r5,r0 |
@@ -86,35 +92,4 @@ early_console_reg_tlb_alloc: | |||
86 | rtsd r15, 8 | 92 | rtsd r15, 8 |
87 | nop | 93 | nop |
88 | 94 | ||
89 | /* | 95 | .size early_console_reg_tlb_alloc, . - early_console_reg_tlb_alloc |
90 | * Copy a whole page (4096 bytes). | ||
91 | */ | ||
92 | #define COPY_16_BYTES \ | ||
93 | lwi r7, r6, 0; \ | ||
94 | lwi r8, r6, 4; \ | ||
95 | lwi r9, r6, 8; \ | ||
96 | lwi r10, r6, 12; \ | ||
97 | swi r7, r5, 0; \ | ||
98 | swi r8, r5, 4; \ | ||
99 | swi r9, r5, 8; \ | ||
100 | swi r10, r5, 12 | ||
101 | |||
102 | |||
103 | /* FIXME DCACHE_LINE_BYTES (CONFIG_XILINX_MICROBLAZE0_DCACHE_LINE_LEN * 4)*/ | ||
104 | #define DCACHE_LINE_BYTES (4 * 4) | ||
105 | |||
106 | .globl copy_page; | ||
107 | .align 4; | ||
108 | copy_page: | ||
109 | ori r11, r0, (PAGE_SIZE/DCACHE_LINE_BYTES) - 1 | ||
110 | _copy_page_loop: | ||
111 | COPY_16_BYTES | ||
112 | #if DCACHE_LINE_BYTES >= 32 | ||
113 | COPY_16_BYTES | ||
114 | #endif | ||
115 | addik r6, r6, DCACHE_LINE_BYTES | ||
116 | addik r5, r5, DCACHE_LINE_BYTES | ||
117 | bneid r11, _copy_page_loop | ||
118 | addik r11, r11, -1 | ||
119 | rtsd r15, 8 | ||
120 | nop | ||