aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/proc-xscale.S
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-09-06 15:47:54 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-10-01 11:40:58 -0400
commit9e8b5199a753a2583a8ef8360e6428304a242283 (patch)
treecfd065b410dd5fe5c14843b71368e0916a496739 /arch/arm/mm/proc-xscale.S
parentbb30f36f9b71c31dc8fe3483bba4c9884fc86080 (diff)
[ARM] Convert Xscale and Xscale3 to use new memory types
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/proc-xscale.S')
-rw-r--r--arch/arm/mm/proc-xscale.S52
1 files changed, 28 insertions, 24 deletions
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index 8d7512f9cba7..6fa525364bb7 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -406,8 +406,6 @@ ENTRY(cpu_xscale_dcache_clean_area)
406 406
407/* =============================== PageTable ============================== */ 407/* =============================== PageTable ============================== */
408 408
409#define PTE_CACHE_WRITE_ALLOCATE 0
410
411/* 409/*
412 * cpu_xscale_switch_mm(pgd) 410 * cpu_xscale_switch_mm(pgd)
413 * 411 *
@@ -431,34 +429,40 @@ ENTRY(cpu_xscale_switch_mm)
431 * 429 *
432 * Errata 40: must set memory to write-through for user read-only pages. 430 * Errata 40: must set memory to write-through for user read-only pages.
433 */ 431 */
432cpu_xscale_mt_table:
433 .long 0x00 @ L_PTE_MT_UNCACHED
434 .long PTE_BUFFERABLE @ L_PTE_MT_BUFFERABLE
435 .long PTE_CACHEABLE @ L_PTE_MT_WRITETHROUGH
436 .long PTE_CACHEABLE | PTE_BUFFERABLE @ L_PTE_MT_WRITEBACK
437 .long 0x00 @ L_PTE_MT_DEV_SHARED
438 .long 0x00 @ L_PTE_MT_DEV_SHARED2
439 .long PTE_EXT_TEX(1) | PTE_CACHEABLE @ L_PTE_MT_MINICACHE
440 .long PTE_EXT_TEX(1) | PTE_CACHEABLE | PTE_BUFFERABLE @ L_PTE_MT_WRITEALLOC
441 .long PTE_BUFFERABLE @ L_PTE_MT_DEV_WC2
442 .long PTE_BUFFERABLE @ L_PTE_MT_DEV_WC
443 .long 0x00 @ unused
444 .long PTE_CACHEABLE | PTE_BUFFERABLE @ L_PTE_MT_DEV_CACHED
445 .long 0x00 @ L_PTE_MT_DEV_NONSHARED
446 .long PTE_EXT_TEX(1) | PTE_BUFFERABLE @ L_PTE_MT_DEV_IXP2000
447 .long 0x00 @ unused
448 .long 0x00 @ unused
449
434 .align 5 450 .align 5
435ENTRY(cpu_xscale_set_pte_ext) 451ENTRY(cpu_xscale_set_pte_ext)
436 xscale_set_pte_ext_prologue 452 xscale_set_pte_ext_prologue
437 @
438 @ Handle the X bit. We want to set this bit for the minicache
439 @ (U = E = B = W = 0, C = 1) or when write allocate is enabled,
440 @ and we have a writeable, cacheable region. If we ignore the
441 @ U and E bits, we can allow user space to use the minicache as
442 @ well.
443 @
444 @ X = (C & ~W & ~B) | (C & W & B & write_allocate)
445 @
446 and ip, r1, #L_PTE_CACHEABLE | L_PTE_WRITE | L_PTE_BUFFERABLE
447 teq ip, #L_PTE_CACHEABLE
448#if PTE_CACHE_WRITE_ALLOCATE
449 teqne ip, #L_PTE_CACHEABLE | L_PTE_WRITE | L_PTE_BUFFERABLE
450#endif
451 orreq r2, r2, #PTE_EXT_TEX(1)
452 453
453 @ 454 @
454 @ Erratum 40: The B bit must be cleared for a user read-only 455 @ Erratum 40: must set memory to write-through for user read-only pages
455 @ cacheable page.
456 @
457 @ B = B & ~(U & C & ~W)
458 @ 456 @
459 and ip, r1, #L_PTE_USER | L_PTE_WRITE | L_PTE_CACHEABLE 457 and ip, r1, #(L_PTE_MT_MASK | L_PTE_USER | L_PTE_WRITE) & ~(4 << 2)
460 teq ip, #L_PTE_USER | L_PTE_CACHEABLE 458 teq ip, #L_PTE_MT_WRITEBACK | L_PTE_USER
461 biceq r2, r2, #PTE_BUFFERABLE 459
460 moveq r1, #L_PTE_MT_WRITETHROUGH
461 and r1, r1, #L_PTE_MT_MASK
462 adr ip, cpu_xscale_mt_table
463 ldr ip, [ip, r1]
464 bic r2, r2, #0x0c
465 orr r2, r2, ip
462 466
463 xscale_set_pte_ext_epilogue 467 xscale_set_pte_ext_epilogue
464 mov pc, lr 468 mov pc, lr