Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mm/proc-xscale.S |
| 3 | * |
| 4 | * Author: Nicolas Pitre |
| 5 | * Created: November 2000 |
| 6 | * Copyright: (C) 2000, 2001 MontaVista Software Inc. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | * |
| 12 | * MMU functions for the Intel XScale CPUs |
| 13 | * |
| 14 | * 2001 Aug 21: |
| 15 | * some contributions by Brett Gaines <brett.w.gaines@intel.com> |
| 16 | * Copyright 2001 by Intel Corp. |
| 17 | * |
| 18 | * 2001 Sep 08: |
| 19 | * Completely revisited, many important fixes |
| 20 | * Nicolas Pitre <nico@cam.org> |
| 21 | */ |
| 22 | |
| 23 | #include <linux/linkage.h> |
| 24 | #include <linux/init.h> |
| 25 | #include <asm/assembler.h> |
| 26 | #include <asm/procinfo.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | #include <asm/pgtable.h> |
| 28 | #include <asm/page.h> |
| 29 | #include <asm/ptrace.h> |
| 30 | #include "proc-macros.S" |
| 31 | |
| 32 | /* |
| 33 | * This is the maximum size of an area which will be flushed. If the area |
| 34 | * is larger than this, then we flush the whole cache |
| 35 | */ |
| 36 | #define MAX_AREA_SIZE 32768 |
| 37 | |
| 38 | /* |
| 39 | * the cache line size of the I and D cache |
| 40 | */ |
| 41 | #define CACHELINESIZE 32 |
| 42 | |
| 43 | /* |
| 44 | * the size of the data cache |
| 45 | */ |
| 46 | #define CACHESIZE 32768 |
| 47 | |
| 48 | /* |
| 49 | * Virtual address used to allocate the cache when flushed |
| 50 | * |
| 51 | * This must be an address range which is _never_ used. It should |
| 52 | * apparently have a mapping in the corresponding page table for |
| 53 | * compatibility with future CPUs that _could_ require it. For instance we |
| 54 | * don't care. |
| 55 | * |
| 56 | * This must be aligned on a 2*CACHESIZE boundary. The code selects one of |
| 57 | * the 2 areas in alternance each time the clean_d_cache macro is used. |
| 58 | * Without this the XScale core exhibits cache eviction problems and no one |
| 59 | * knows why. |
| 60 | * |
| 61 | * Reminder: the vector table is located at 0xffff0000-0xffff0fff. |
| 62 | */ |
| 63 | #define CLEAN_ADDR 0xfffe0000 |
| 64 | |
| 65 | /* |
| 66 | * This macro is used to wait for a CP15 write and is needed |
| 67 | * when we have to ensure that the last operation to the co-pro |
| 68 | * was completed before continuing with operation. |
| 69 | */ |
| 70 | .macro cpwait, rd |
| 71 | mrc p15, 0, \rd, c2, c0, 0 @ arbitrary read of cp15 |
| 72 | mov \rd, \rd @ wait for completion |
| 73 | sub pc, pc, #4 @ flush instruction pipeline |
| 74 | .endm |
| 75 | |
| 76 | .macro cpwait_ret, lr, rd |
| 77 | mrc p15, 0, \rd, c2, c0, 0 @ arbitrary read of cp15 |
| 78 | sub pc, \lr, \rd, LSR #32 @ wait for completion and |
| 79 | @ flush instruction pipeline |
| 80 | .endm |
| 81 | |
| 82 | /* |
| 83 | * This macro cleans the entire dcache using line allocate. |
| 84 | * The main loop has been unrolled to reduce loop overhead. |
| 85 | * rd and rs are two scratch registers. |
| 86 | */ |
| 87 | .macro clean_d_cache, rd, rs |
| 88 | ldr \rs, =clean_addr |
| 89 | ldr \rd, [\rs] |
| 90 | eor \rd, \rd, #CACHESIZE |
| 91 | str \rd, [\rs] |
| 92 | add \rs, \rd, #CACHESIZE |
| 93 | 1: mcr p15, 0, \rd, c7, c2, 5 @ allocate D cache line |
| 94 | add \rd, \rd, #CACHELINESIZE |
| 95 | mcr p15, 0, \rd, c7, c2, 5 @ allocate D cache line |
| 96 | add \rd, \rd, #CACHELINESIZE |
| 97 | mcr p15, 0, \rd, c7, c2, 5 @ allocate D cache line |
| 98 | add \rd, \rd, #CACHELINESIZE |
| 99 | mcr p15, 0, \rd, c7, c2, 5 @ allocate D cache line |
| 100 | add \rd, \rd, #CACHELINESIZE |
| 101 | teq \rd, \rs |
| 102 | bne 1b |
| 103 | .endm |
| 104 | |
| 105 | .data |
| 106 | clean_addr: .word CLEAN_ADDR |
| 107 | |
| 108 | .text |
| 109 | |
| 110 | /* |
| 111 | * cpu_xscale_proc_init() |
| 112 | * |
| 113 | * Nothing too exciting at the moment |
| 114 | */ |
| 115 | ENTRY(cpu_xscale_proc_init) |
| 116 | mov pc, lr |
| 117 | |
| 118 | /* |
| 119 | * cpu_xscale_proc_fin() |
| 120 | */ |
| 121 | ENTRY(cpu_xscale_proc_fin) |
| 122 | str lr, [sp, #-4]! |
| 123 | mov r0, #PSR_F_BIT|PSR_I_BIT|SVC_MODE |
| 124 | msr cpsr_c, r0 |
| 125 | bl xscale_flush_kern_cache_all @ clean caches |
| 126 | mrc p15, 0, r0, c1, c0, 0 @ ctrl register |
| 127 | bic r0, r0, #0x1800 @ ...IZ........... |
| 128 | bic r0, r0, #0x0006 @ .............CA. |
| 129 | mcr p15, 0, r0, c1, c0, 0 @ disable caches |
| 130 | ldr pc, [sp], #4 |
| 131 | |
| 132 | /* |
| 133 | * cpu_xscale_reset(loc) |
| 134 | * |
| 135 | * Perform a soft reset of the system. Put the CPU into the |
| 136 | * same state as it would be if it had been reset, and branch |
| 137 | * to what would be the reset vector. |
| 138 | * |
| 139 | * loc: location to jump to for soft reset |
| 140 | */ |
| 141 | .align 5 |
| 142 | ENTRY(cpu_xscale_reset) |
| 143 | mov r1, #PSR_F_BIT|PSR_I_BIT|SVC_MODE |
| 144 | msr cpsr_c, r1 @ reset CPSR |
| 145 | mrc p15, 0, r1, c1, c0, 0 @ ctrl register |
| 146 | bic r1, r1, #0x0086 @ ........B....CA. |
| 147 | bic r1, r1, #0x3900 @ ..VIZ..S........ |
| 148 | mcr p15, 0, r1, c1, c0, 0 @ ctrl register |
| 149 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches & BTB |
| 150 | bic r1, r1, #0x0001 @ ...............M |
| 151 | mcr p15, 0, r1, c1, c0, 0 @ ctrl register |
| 152 | @ CAUTION: MMU turned off from this point. We count on the pipeline |
| 153 | @ already containing those two last instructions to survive. |
| 154 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
| 155 | mov pc, r0 |
| 156 | |
| 157 | /* |
| 158 | * cpu_xscale_do_idle() |
| 159 | * |
| 160 | * Cause the processor to idle |
| 161 | * |
| 162 | * For now we do nothing but go to idle mode for every case |
| 163 | * |
| 164 | * XScale supports clock switching, but using idle mode support |
| 165 | * allows external hardware to react to system state changes. |
| 166 | */ |
| 167 | .align 5 |
| 168 | |
| 169 | ENTRY(cpu_xscale_do_idle) |
| 170 | mov r0, #1 |
| 171 | mcr p14, 0, r0, c7, c0, 0 @ Go to IDLE |
| 172 | mov pc, lr |
| 173 | |
| 174 | /* ================================= CACHE ================================ */ |
| 175 | |
| 176 | /* |
| 177 | * flush_user_cache_all() |
| 178 | * |
| 179 | * Invalidate all cache entries in a particular address |
| 180 | * space. |
| 181 | */ |
| 182 | ENTRY(xscale_flush_user_cache_all) |
| 183 | /* FALLTHROUGH */ |
| 184 | |
| 185 | /* |
| 186 | * flush_kern_cache_all() |
| 187 | * |
| 188 | * Clean and invalidate the entire cache. |
| 189 | */ |
| 190 | ENTRY(xscale_flush_kern_cache_all) |
| 191 | mov r2, #VM_EXEC |
| 192 | mov ip, #0 |
| 193 | __flush_whole_cache: |
| 194 | clean_d_cache r0, r1 |
| 195 | tst r2, #VM_EXEC |
| 196 | mcrne p15, 0, ip, c7, c5, 0 @ Invalidate I cache & BTB |
| 197 | mcrne p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer |
| 198 | mov pc, lr |
| 199 | |
| 200 | /* |
| 201 | * flush_user_cache_range(start, end, vm_flags) |
| 202 | * |
| 203 | * Invalidate a range of cache entries in the specified |
| 204 | * address space. |
| 205 | * |
| 206 | * - start - start address (may not be aligned) |
| 207 | * - end - end address (exclusive, may not be aligned) |
| 208 | * - vma - vma_area_struct describing address space |
| 209 | */ |
| 210 | .align 5 |
| 211 | ENTRY(xscale_flush_user_cache_range) |
| 212 | mov ip, #0 |
| 213 | sub r3, r1, r0 @ calculate total size |
| 214 | cmp r3, #MAX_AREA_SIZE |
| 215 | bhs __flush_whole_cache |
| 216 | |
| 217 | 1: tst r2, #VM_EXEC |
| 218 | mcrne p15, 0, r0, c7, c5, 1 @ Invalidate I cache line |
| 219 | mcr p15, 0, r0, c7, c10, 1 @ Clean D cache line |
| 220 | mcr p15, 0, r0, c7, c6, 1 @ Invalidate D cache line |
| 221 | add r0, r0, #CACHELINESIZE |
| 222 | cmp r0, r1 |
| 223 | blo 1b |
| 224 | tst r2, #VM_EXEC |
| 225 | mcrne p15, 0, ip, c7, c5, 6 @ Invalidate BTB |
| 226 | mcrne p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer |
| 227 | mov pc, lr |
| 228 | |
| 229 | /* |
| 230 | * coherent_kern_range(start, end) |
| 231 | * |
| 232 | * Ensure coherency between the Icache and the Dcache in the |
| 233 | * region described by start. If you have non-snooping |
| 234 | * Harvard caches, you need to implement this function. |
| 235 | * |
| 236 | * - start - virtual start address |
| 237 | * - end - virtual end address |
| 238 | * |
| 239 | * Note: single I-cache line invalidation isn't used here since |
| 240 | * it also trashes the mini I-cache used by JTAG debuggers. |
| 241 | */ |
| 242 | ENTRY(xscale_coherent_kern_range) |
Nicolas Pitre | 8a052e0 | 2006-02-01 19:26:01 +0000 | [diff] [blame] | 243 | bic r0, r0, #CACHELINESIZE - 1 |
| 244 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
| 245 | add r0, r0, #CACHELINESIZE |
| 246 | cmp r0, r1 |
| 247 | blo 1b |
| 248 | mov r0, #0 |
| 249 | mcr p15, 0, r0, c7, c5, 0 @ Invalidate I cache & BTB |
| 250 | mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer |
| 251 | mov pc, lr |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 252 | |
| 253 | /* |
| 254 | * coherent_user_range(start, end) |
| 255 | * |
| 256 | * Ensure coherency between the Icache and the Dcache in the |
| 257 | * region described by start. If you have non-snooping |
| 258 | * Harvard caches, you need to implement this function. |
| 259 | * |
| 260 | * - start - virtual start address |
| 261 | * - end - virtual end address |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 262 | */ |
| 263 | ENTRY(xscale_coherent_user_range) |
| 264 | bic r0, r0, #CACHELINESIZE - 1 |
| 265 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
Nicolas Pitre | 8a052e0 | 2006-02-01 19:26:01 +0000 | [diff] [blame] | 266 | mcr p15, 0, r0, c7, c5, 1 @ Invalidate I cache entry |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 267 | add r0, r0, #CACHELINESIZE |
| 268 | cmp r0, r1 |
| 269 | blo 1b |
| 270 | mov r0, #0 |
Nicolas Pitre | 8a052e0 | 2006-02-01 19:26:01 +0000 | [diff] [blame] | 271 | mcr p15, 0, r0, c7, c5, 6 @ Invalidate BTB |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 | mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer |
| 273 | mov pc, lr |
| 274 | |
| 275 | /* |
| 276 | * flush_kern_dcache_page(void *page) |
| 277 | * |
| 278 | * Ensure no D cache aliasing occurs, either with itself or |
| 279 | * the I cache |
| 280 | * |
| 281 | * - addr - page aligned address |
| 282 | */ |
| 283 | ENTRY(xscale_flush_kern_dcache_page) |
| 284 | add r1, r0, #PAGE_SZ |
| 285 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
| 286 | mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry |
| 287 | add r0, r0, #CACHELINESIZE |
| 288 | cmp r0, r1 |
| 289 | blo 1b |
| 290 | mov r0, #0 |
| 291 | mcr p15, 0, r0, c7, c5, 0 @ Invalidate I cache & BTB |
| 292 | mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer |
| 293 | mov pc, lr |
| 294 | |
| 295 | /* |
| 296 | * dma_inv_range(start, end) |
| 297 | * |
| 298 | * Invalidate (discard) the specified virtual address range. |
| 299 | * May not write back any entries. If 'start' or 'end' |
| 300 | * are not cache line aligned, those lines must be written |
| 301 | * back. |
| 302 | * |
| 303 | * - start - virtual start address |
| 304 | * - end - virtual end address |
| 305 | */ |
| 306 | ENTRY(xscale_dma_inv_range) |
| 307 | mrc p15, 0, r2, c0, c0, 0 @ read ID |
| 308 | eor r2, r2, #0x69000000 |
| 309 | eor r2, r2, #0x00052000 |
| 310 | bics r2, r2, #1 |
| 311 | beq xscale_dma_flush_range |
| 312 | |
| 313 | tst r0, #CACHELINESIZE - 1 |
| 314 | bic r0, r0, #CACHELINESIZE - 1 |
| 315 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry |
| 316 | tst r1, #CACHELINESIZE - 1 |
| 317 | mcrne p15, 0, r1, c7, c10, 1 @ clean D entry |
| 318 | 1: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry |
| 319 | add r0, r0, #CACHELINESIZE |
| 320 | cmp r0, r1 |
| 321 | blo 1b |
| 322 | mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer |
| 323 | mov pc, lr |
| 324 | |
| 325 | /* |
| 326 | * dma_clean_range(start, end) |
| 327 | * |
| 328 | * Clean the specified virtual address range. |
| 329 | * |
| 330 | * - start - virtual start address |
| 331 | * - end - virtual end address |
| 332 | */ |
| 333 | ENTRY(xscale_dma_clean_range) |
| 334 | bic r0, r0, #CACHELINESIZE - 1 |
| 335 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
| 336 | add r0, r0, #CACHELINESIZE |
| 337 | cmp r0, r1 |
| 338 | blo 1b |
| 339 | mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer |
| 340 | mov pc, lr |
| 341 | |
| 342 | /* |
| 343 | * dma_flush_range(start, end) |
| 344 | * |
| 345 | * Clean and invalidate the specified virtual address range. |
| 346 | * |
| 347 | * - start - virtual start address |
| 348 | * - end - virtual end address |
| 349 | */ |
| 350 | ENTRY(xscale_dma_flush_range) |
| 351 | bic r0, r0, #CACHELINESIZE - 1 |
| 352 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
| 353 | mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry |
| 354 | add r0, r0, #CACHELINESIZE |
| 355 | cmp r0, r1 |
| 356 | blo 1b |
| 357 | mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer |
| 358 | mov pc, lr |
| 359 | |
| 360 | ENTRY(xscale_cache_fns) |
| 361 | .long xscale_flush_kern_cache_all |
| 362 | .long xscale_flush_user_cache_all |
| 363 | .long xscale_flush_user_cache_range |
| 364 | .long xscale_coherent_kern_range |
| 365 | .long xscale_coherent_user_range |
| 366 | .long xscale_flush_kern_dcache_page |
| 367 | .long xscale_dma_inv_range |
| 368 | .long xscale_dma_clean_range |
| 369 | .long xscale_dma_flush_range |
| 370 | |
| 371 | ENTRY(cpu_xscale_dcache_clean_area) |
| 372 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
| 373 | add r0, r0, #CACHELINESIZE |
| 374 | subs r1, r1, #CACHELINESIZE |
| 375 | bhi 1b |
| 376 | mov pc, lr |
| 377 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 378 | /* =============================== PageTable ============================== */ |
| 379 | |
| 380 | #define PTE_CACHE_WRITE_ALLOCATE 0 |
| 381 | |
| 382 | /* |
| 383 | * cpu_xscale_switch_mm(pgd) |
| 384 | * |
| 385 | * Set the translation base pointer to be as described by pgd. |
| 386 | * |
| 387 | * pgd: new page tables |
| 388 | */ |
| 389 | .align 5 |
| 390 | ENTRY(cpu_xscale_switch_mm) |
| 391 | clean_d_cache r1, r2 |
| 392 | mcr p15, 0, ip, c7, c5, 0 @ Invalidate I cache & BTB |
| 393 | mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer |
| 394 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer |
| 395 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
| 396 | cpwait_ret lr, ip |
| 397 | |
| 398 | /* |
| 399 | * cpu_xscale_set_pte(ptep, pte) |
| 400 | * |
| 401 | * Set a PTE and flush it out |
| 402 | * |
| 403 | * Errata 40: must set memory to write-through for user read-only pages. |
| 404 | */ |
| 405 | .align 5 |
| 406 | ENTRY(cpu_xscale_set_pte) |
| 407 | str r1, [r0], #-2048 @ linux version |
| 408 | |
| 409 | bic r2, r1, #0xff0 |
| 410 | orr r2, r2, #PTE_TYPE_EXT @ extended page |
| 411 | |
| 412 | eor r3, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY |
| 413 | |
| 414 | tst r3, #L_PTE_USER @ User? |
| 415 | orrne r2, r2, #PTE_EXT_AP_URO_SRW @ yes -> user r/o, system r/w |
| 416 | |
| 417 | tst r3, #L_PTE_WRITE | L_PTE_DIRTY @ Write and Dirty? |
| 418 | orreq r2, r2, #PTE_EXT_AP_UNO_SRW @ yes -> user n/a, system r/w |
| 419 | @ combined with user -> user r/w |
| 420 | |
| 421 | @ |
| 422 | @ Handle the X bit. We want to set this bit for the minicache |
| 423 | @ (U = E = B = W = 0, C = 1) or when write allocate is enabled, |
| 424 | @ and we have a writeable, cacheable region. If we ignore the |
| 425 | @ U and E bits, we can allow user space to use the minicache as |
| 426 | @ well. |
| 427 | @ |
| 428 | @ X = (C & ~W & ~B) | (C & W & B & write_allocate) |
| 429 | @ |
| 430 | eor ip, r1, #L_PTE_CACHEABLE |
| 431 | tst ip, #L_PTE_CACHEABLE | L_PTE_WRITE | L_PTE_BUFFERABLE |
| 432 | #if PTE_CACHE_WRITE_ALLOCATE |
| 433 | eorne ip, r1, #L_PTE_CACHEABLE | L_PTE_WRITE | L_PTE_BUFFERABLE |
| 434 | tstne ip, #L_PTE_CACHEABLE | L_PTE_WRITE | L_PTE_BUFFERABLE |
| 435 | #endif |
| 436 | orreq r2, r2, #PTE_EXT_TEX(1) |
| 437 | |
| 438 | @ |
| 439 | @ Erratum 40: The B bit must be cleared for a user read-only |
| 440 | @ cacheable page. |
| 441 | @ |
| 442 | @ B = B & ~(U & C & ~W) |
| 443 | @ |
| 444 | and ip, r1, #L_PTE_USER | L_PTE_WRITE | L_PTE_CACHEABLE |
| 445 | teq ip, #L_PTE_USER | L_PTE_CACHEABLE |
| 446 | biceq r2, r2, #PTE_BUFFERABLE |
| 447 | |
| 448 | tst r3, #L_PTE_PRESENT | L_PTE_YOUNG @ Present and Young? |
| 449 | movne r2, #0 @ no -> fault |
| 450 | |
| 451 | str r2, [r0] @ hardware version |
| 452 | mov ip, #0 |
| 453 | mcr p15, 0, r0, c7, c10, 1 @ Clean D cache line |
| 454 | mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer |
| 455 | mov pc, lr |
| 456 | |
| 457 | |
| 458 | .ltorg |
| 459 | |
| 460 | .align |
| 461 | |
| 462 | __INIT |
| 463 | |
| 464 | .type __xscale_setup, #function |
| 465 | __xscale_setup: |
| 466 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I, D caches & BTB |
| 467 | mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer |
| 468 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I, D TLBs |
| 469 | #ifdef CONFIG_IWMMXT |
| 470 | mov r0, #0 @ initially disallow access to CP0/CP1 |
| 471 | #else |
| 472 | mov r0, #1 @ Allow access to CP0 |
| 473 | #endif |
| 474 | orr r0, r0, #1 << 6 @ cp6 for IOP3xx and Bulverde |
| 475 | orr r0, r0, #1 << 13 @ Its undefined whether this |
| 476 | mcr p15, 0, r0, c15, c1, 0 @ affects USR or SVC modes |
| 477 | mrc p15, 0, r0, c1, c0, 0 @ get control register |
| 478 | ldr r5, xscale_cr1_clear |
| 479 | bic r0, r0, r5 |
| 480 | ldr r5, xscale_cr1_set |
| 481 | orr r0, r0, r5 |
| 482 | mov pc, lr |
| 483 | .size __xscale_setup, . - __xscale_setup |
| 484 | |
| 485 | /* |
| 486 | * R |
| 487 | * .RVI ZFRS BLDP WCAM |
| 488 | * ..11 1.01 .... .101 |
| 489 | * |
| 490 | */ |
| 491 | .type xscale_cr1_clear, #object |
| 492 | .type xscale_cr1_set, #object |
| 493 | xscale_cr1_clear: |
| 494 | .word 0x3b07 |
| 495 | xscale_cr1_set: |
| 496 | .word 0x3905 |
| 497 | |
| 498 | __INITDATA |
| 499 | |
| 500 | /* |
| 501 | * Purpose : Function pointers used to access above functions - all calls |
| 502 | * come through these |
| 503 | */ |
| 504 | |
| 505 | .type xscale_processor_functions, #object |
| 506 | ENTRY(xscale_processor_functions) |
| 507 | .word v5t_early_abort |
| 508 | .word cpu_xscale_proc_init |
| 509 | .word cpu_xscale_proc_fin |
| 510 | .word cpu_xscale_reset |
| 511 | .word cpu_xscale_do_idle |
| 512 | .word cpu_xscale_dcache_clean_area |
| 513 | .word cpu_xscale_switch_mm |
| 514 | .word cpu_xscale_set_pte |
| 515 | .size xscale_processor_functions, . - xscale_processor_functions |
| 516 | |
| 517 | .section ".rodata" |
| 518 | |
| 519 | .type cpu_arch_name, #object |
| 520 | cpu_arch_name: |
| 521 | .asciz "armv5te" |
| 522 | .size cpu_arch_name, . - cpu_arch_name |
| 523 | |
| 524 | .type cpu_elf_name, #object |
| 525 | cpu_elf_name: |
| 526 | .asciz "v5" |
| 527 | .size cpu_elf_name, . - cpu_elf_name |
| 528 | |
| 529 | .type cpu_80200_name, #object |
| 530 | cpu_80200_name: |
| 531 | .asciz "XScale-80200" |
| 532 | .size cpu_80200_name, . - cpu_80200_name |
| 533 | |
| 534 | .type cpu_8032x_name, #object |
| 535 | cpu_8032x_name: |
| 536 | .asciz "XScale-IOP8032x Family" |
| 537 | .size cpu_8032x_name, . - cpu_8032x_name |
| 538 | |
| 539 | .type cpu_8033x_name, #object |
| 540 | cpu_8033x_name: |
| 541 | .asciz "XScale-IOP8033x Family" |
| 542 | .size cpu_8033x_name, . - cpu_8033x_name |
| 543 | |
| 544 | .type cpu_pxa250_name, #object |
| 545 | cpu_pxa250_name: |
| 546 | .asciz "XScale-PXA250" |
| 547 | .size cpu_pxa250_name, . - cpu_pxa250_name |
| 548 | |
| 549 | .type cpu_pxa210_name, #object |
| 550 | cpu_pxa210_name: |
| 551 | .asciz "XScale-PXA210" |
| 552 | .size cpu_pxa210_name, . - cpu_pxa210_name |
| 553 | |
| 554 | .type cpu_ixp42x_name, #object |
| 555 | cpu_ixp42x_name: |
| 556 | .asciz "XScale-IXP42x Family" |
| 557 | .size cpu_ixp42x_name, . - cpu_ixp42x_name |
| 558 | |
| 559 | .type cpu_ixp46x_name, #object |
| 560 | cpu_ixp46x_name: |
| 561 | .asciz "XScale-IXP46x Family" |
| 562 | .size cpu_ixp46x_name, . - cpu_ixp46x_name |
| 563 | |
| 564 | .type cpu_ixp2400_name, #object |
| 565 | cpu_ixp2400_name: |
| 566 | .asciz "XScale-IXP2400" |
| 567 | .size cpu_ixp2400_name, . - cpu_ixp2400_name |
| 568 | |
| 569 | .type cpu_ixp2800_name, #object |
| 570 | cpu_ixp2800_name: |
| 571 | .asciz "XScale-IXP2800" |
| 572 | .size cpu_ixp2800_name, . - cpu_ixp2800_name |
| 573 | |
| 574 | .type cpu_pxa255_name, #object |
| 575 | cpu_pxa255_name: |
| 576 | .asciz "XScale-PXA255" |
| 577 | .size cpu_pxa255_name, . - cpu_pxa255_name |
| 578 | |
| 579 | .type cpu_pxa270_name, #object |
| 580 | cpu_pxa270_name: |
| 581 | .asciz "XScale-PXA270" |
| 582 | .size cpu_pxa270_name, . - cpu_pxa270_name |
| 583 | |
| 584 | .align |
| 585 | |
Ben Dooks | 02b7dd1 | 2005-09-20 16:35:03 +0100 | [diff] [blame] | 586 | .section ".proc.info.init", #alloc, #execinstr |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 587 | |
| 588 | .type __80200_proc_info,#object |
| 589 | __80200_proc_info: |
| 590 | .long 0x69052000 |
| 591 | .long 0xfffffff0 |
| 592 | .long PMD_TYPE_SECT | \ |
| 593 | PMD_SECT_BUFFERABLE | \ |
| 594 | PMD_SECT_CACHEABLE | \ |
| 595 | PMD_SECT_AP_WRITE | \ |
| 596 | PMD_SECT_AP_READ |
| 597 | b __xscale_setup |
| 598 | .long cpu_arch_name |
| 599 | .long cpu_elf_name |
| 600 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP |
| 601 | .long cpu_80200_name |
| 602 | .long xscale_processor_functions |
| 603 | .long v4wbi_tlb_fns |
| 604 | .long xscale_mc_user_fns |
| 605 | .long xscale_cache_fns |
| 606 | .size __80200_proc_info, . - __80200_proc_info |
| 607 | |
| 608 | .type __8032x_proc_info,#object |
| 609 | __8032x_proc_info: |
| 610 | .long 0x69052420 |
| 611 | .long 0xfffff5e0 @ mask should accomodate IOP80219 also |
| 612 | .long PMD_TYPE_SECT | \ |
| 613 | PMD_SECT_BUFFERABLE | \ |
| 614 | PMD_SECT_CACHEABLE | \ |
| 615 | PMD_SECT_AP_WRITE | \ |
| 616 | PMD_SECT_AP_READ |
| 617 | b __xscale_setup |
| 618 | .long cpu_arch_name |
| 619 | .long cpu_elf_name |
| 620 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP |
| 621 | .long cpu_8032x_name |
| 622 | .long xscale_processor_functions |
| 623 | .long v4wbi_tlb_fns |
| 624 | .long xscale_mc_user_fns |
| 625 | .long xscale_cache_fns |
| 626 | .size __8032x_proc_info, . - __8032x_proc_info |
| 627 | |
| 628 | .type __8033x_proc_info,#object |
| 629 | __8033x_proc_info: |
| 630 | .long 0x69054010 |
| 631 | .long 0xffffff30 |
| 632 | .long PMD_TYPE_SECT | \ |
| 633 | PMD_SECT_BUFFERABLE | \ |
| 634 | PMD_SECT_CACHEABLE | \ |
| 635 | PMD_SECT_AP_WRITE | \ |
| 636 | PMD_SECT_AP_READ |
| 637 | b __xscale_setup |
| 638 | .long cpu_arch_name |
| 639 | .long cpu_elf_name |
| 640 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP |
| 641 | .long cpu_8033x_name |
| 642 | .long xscale_processor_functions |
| 643 | .long v4wbi_tlb_fns |
| 644 | .long xscale_mc_user_fns |
| 645 | .long xscale_cache_fns |
| 646 | .size __8033x_proc_info, . - __8033x_proc_info |
| 647 | |
| 648 | .type __pxa250_proc_info,#object |
| 649 | __pxa250_proc_info: |
| 650 | .long 0x69052100 |
| 651 | .long 0xfffff7f0 |
| 652 | .long PMD_TYPE_SECT | \ |
| 653 | PMD_SECT_BUFFERABLE | \ |
| 654 | PMD_SECT_CACHEABLE | \ |
| 655 | PMD_SECT_AP_WRITE | \ |
| 656 | PMD_SECT_AP_READ |
| 657 | b __xscale_setup |
| 658 | .long cpu_arch_name |
| 659 | .long cpu_elf_name |
| 660 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP |
| 661 | .long cpu_pxa250_name |
| 662 | .long xscale_processor_functions |
| 663 | .long v4wbi_tlb_fns |
| 664 | .long xscale_mc_user_fns |
| 665 | .long xscale_cache_fns |
| 666 | .size __pxa250_proc_info, . - __pxa250_proc_info |
| 667 | |
| 668 | .type __pxa210_proc_info,#object |
| 669 | __pxa210_proc_info: |
| 670 | .long 0x69052120 |
| 671 | .long 0xfffff3f0 |
| 672 | .long PMD_TYPE_SECT | \ |
| 673 | PMD_SECT_BUFFERABLE | \ |
| 674 | PMD_SECT_CACHEABLE | \ |
| 675 | PMD_SECT_AP_WRITE | \ |
| 676 | PMD_SECT_AP_READ |
| 677 | b __xscale_setup |
| 678 | .long cpu_arch_name |
| 679 | .long cpu_elf_name |
| 680 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP |
| 681 | .long cpu_pxa210_name |
| 682 | .long xscale_processor_functions |
| 683 | .long v4wbi_tlb_fns |
| 684 | .long xscale_mc_user_fns |
| 685 | .long xscale_cache_fns |
| 686 | .size __pxa210_proc_info, . - __pxa210_proc_info |
| 687 | |
| 688 | .type __ixp2400_proc_info, #object |
| 689 | __ixp2400_proc_info: |
| 690 | .long 0x69054190 |
| 691 | .long 0xfffffff0 |
| 692 | .long PMD_TYPE_SECT | \ |
| 693 | PMD_SECT_BUFFERABLE | \ |
| 694 | PMD_SECT_CACHEABLE | \ |
| 695 | PMD_SECT_AP_WRITE | \ |
| 696 | PMD_SECT_AP_READ |
| 697 | b __xscale_setup |
| 698 | .long cpu_arch_name |
| 699 | .long cpu_elf_name |
| 700 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP |
| 701 | .long cpu_ixp2400_name |
| 702 | .long xscale_processor_functions |
| 703 | .long v4wbi_tlb_fns |
| 704 | .long xscale_mc_user_fns |
| 705 | .long xscale_cache_fns |
| 706 | .size __ixp2400_proc_info, . - __ixp2400_proc_info |
| 707 | |
| 708 | .type __ixp2800_proc_info, #object |
| 709 | __ixp2800_proc_info: |
| 710 | .long 0x690541a0 |
| 711 | .long 0xfffffff0 |
| 712 | .long PMD_TYPE_SECT | \ |
| 713 | PMD_SECT_BUFFERABLE | \ |
| 714 | PMD_SECT_CACHEABLE | \ |
| 715 | PMD_SECT_AP_WRITE | \ |
| 716 | PMD_SECT_AP_READ |
| 717 | b __xscale_setup |
| 718 | .long cpu_arch_name |
| 719 | .long cpu_elf_name |
| 720 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP |
| 721 | .long cpu_ixp2800_name |
| 722 | .long xscale_processor_functions |
| 723 | .long v4wbi_tlb_fns |
| 724 | .long xscale_mc_user_fns |
| 725 | .long xscale_cache_fns |
| 726 | .size __ixp2800_proc_info, . - __ixp2800_proc_info |
| 727 | |
| 728 | .type __ixp42x_proc_info, #object |
| 729 | __ixp42x_proc_info: |
| 730 | .long 0x690541c0 |
| 731 | .long 0xffffffc0 |
| 732 | .long PMD_TYPE_SECT | \ |
| 733 | PMD_SECT_BUFFERABLE | \ |
| 734 | PMD_SECT_CACHEABLE | \ |
| 735 | PMD_SECT_AP_WRITE | \ |
| 736 | PMD_SECT_AP_READ |
| 737 | b __xscale_setup |
| 738 | .long cpu_arch_name |
| 739 | .long cpu_elf_name |
| 740 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP |
| 741 | .long cpu_ixp42x_name |
| 742 | .long xscale_processor_functions |
| 743 | .long v4wbi_tlb_fns |
| 744 | .long xscale_mc_user_fns |
| 745 | .long xscale_cache_fns |
| 746 | .size __ixp42x_proc_info, . - __ixp42x_proc_info |
| 747 | |
| 748 | .type __ixp46x_proc_info, #object |
| 749 | __ixp46x_proc_info: |
| 750 | .long 0x69054200 |
| 751 | .long 0xffffff00 |
| 752 | .long 0x00000c0e |
| 753 | b __xscale_setup |
| 754 | .long cpu_arch_name |
| 755 | .long cpu_elf_name |
| 756 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP |
| 757 | .long cpu_ixp46x_name |
| 758 | .long xscale_processor_functions |
| 759 | .long v4wbi_tlb_fns |
| 760 | .long xscale_mc_user_fns |
| 761 | .long xscale_cache_fns |
| 762 | .size __ixp46x_proc_info, . - __ixp46x_proc_info |
| 763 | |
| 764 | .type __pxa255_proc_info,#object |
| 765 | __pxa255_proc_info: |
| 766 | .long 0x69052d00 |
| 767 | .long 0xfffffff0 |
| 768 | .long PMD_TYPE_SECT | \ |
| 769 | PMD_SECT_BUFFERABLE | \ |
| 770 | PMD_SECT_CACHEABLE | \ |
| 771 | PMD_SECT_AP_WRITE | \ |
| 772 | PMD_SECT_AP_READ |
| 773 | b __xscale_setup |
| 774 | .long cpu_arch_name |
| 775 | .long cpu_elf_name |
| 776 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP |
| 777 | .long cpu_pxa255_name |
| 778 | .long xscale_processor_functions |
| 779 | .long v4wbi_tlb_fns |
| 780 | .long xscale_mc_user_fns |
| 781 | .long xscale_cache_fns |
| 782 | .size __pxa255_proc_info, . - __pxa255_proc_info |
| 783 | |
| 784 | .type __pxa270_proc_info,#object |
| 785 | __pxa270_proc_info: |
| 786 | .long 0x69054110 |
| 787 | .long 0xfffffff0 |
| 788 | .long PMD_TYPE_SECT | \ |
| 789 | PMD_SECT_BUFFERABLE | \ |
| 790 | PMD_SECT_CACHEABLE | \ |
| 791 | PMD_SECT_AP_WRITE | \ |
| 792 | PMD_SECT_AP_READ |
| 793 | b __xscale_setup |
| 794 | .long cpu_arch_name |
| 795 | .long cpu_elf_name |
| 796 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP |
| 797 | .long cpu_pxa270_name |
| 798 | .long xscale_processor_functions |
| 799 | .long v4wbi_tlb_fns |
| 800 | .long xscale_mc_user_fns |
| 801 | .long xscale_cache_fns |
| 802 | .size __pxa270_proc_info, . - __pxa270_proc_info |
| 803 | |