aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v32/mm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-08 13:08:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-08 13:08:26 -0400
commit53bcef60633086ad73683d01a4ef9ca678484d2d (patch)
tree8b14cc031124d0aa0da6cd3b60115bc7eaa80061 /arch/cris/arch-v32/mm
parent4fd6c6bf83cb16321e9902b00e2af79054f4e0d6 (diff)
parent85d9865721c62a551547984e6cc8bd3ba732e294 (diff)
Merge branch 'for-linus' of git://www.jni.nu/cris
* 'for-linus' of git://www.jni.nu/cris: (51 commits) CRIS: Fix alignment problem for older ld CRIS: Always dump registers for segfaulting process. CRIS: Add config for pausing a seg-faulting process CRIS: Don't take faults while in_atomic CRIS: Fixup lookup for delay slot faults CRIS: Discard exit.text and .data at runtime CRIS: Add cache aligned and read mostly data sections CRIS: Return something from profile write CRIS: Add ARTPEC-3 and timestamps for sync-serial CRIS: Better ARTPEC-3 support for gpio CRIS: Add include guard CRIS: Better handling of pinmux settings CRIS: New DMA defines for ARTPEC-3 CRIS: __do_strncpy_from_user: Don't read the byte beyond the nil CRIS: Pagetable for ARTPEC-3 CRIS: Machine dependent memmap.h CRIS: Check if pointer is set before using it CRIS: Machine dependent dma.h CRIS: Define __read_mostly for CRISv32 CRIS: Discard .note.gnu.build-id section ...
Diffstat (limited to 'arch/cris/arch-v32/mm')
-rw-r--r--arch/cris/arch-v32/mm/init.c23
-rw-r--r--arch/cris/arch-v32/mm/mmu.S4
2 files changed, 22 insertions, 5 deletions
diff --git a/arch/cris/arch-v32/mm/init.c b/arch/cris/arch-v32/mm/init.c
index caeb921a92e..0768bc409ca 100644
--- a/arch/cris/arch-v32/mm/init.c
+++ b/arch/cris/arch-v32/mm/init.c
@@ -27,8 +27,7 @@ extern void tlb_init(void);
27 * at kseg_4 thus the ksegs are set up again. Also clear the TLB and do various 27 * at kseg_4 thus the ksegs are set up again. Also clear the TLB and do various
28 * other paging stuff. 28 * other paging stuff.
29 */ 29 */
30void __init 30void __init cris_mmu_init(void)
31cris_mmu_init(void)
32{ 31{
33 unsigned long mmu_config; 32 unsigned long mmu_config;
34 unsigned long mmu_kbase_hi; 33 unsigned long mmu_kbase_hi;
@@ -55,14 +54,23 @@ cris_mmu_init(void)
55 /* Initialise the TLB. Function found in tlb.c. */ 54 /* Initialise the TLB. Function found in tlb.c. */
56 tlb_init(); 55 tlb_init();
57 56
58 /* Enable exceptions and initialize the kernel segments. */ 57 /*
58 * Enable exceptions and initialize the kernel segments.
59 * See head.S for differences between ARTPEC-3 and ETRAX FS.
60 */
59 mmu_config = ( REG_STATE(mmu, rw_mm_cfg, we, on) | 61 mmu_config = ( REG_STATE(mmu, rw_mm_cfg, we, on) |
60 REG_STATE(mmu, rw_mm_cfg, acc, on) | 62 REG_STATE(mmu, rw_mm_cfg, acc, on) |
61 REG_STATE(mmu, rw_mm_cfg, ex, on) | 63 REG_STATE(mmu, rw_mm_cfg, ex, on) |
62 REG_STATE(mmu, rw_mm_cfg, inv, on) | 64 REG_STATE(mmu, rw_mm_cfg, inv, on) |
65#ifdef CONFIG_CRIS_MACH_ARTPEC3
66 REG_STATE(mmu, rw_mm_cfg, seg_f, page) |
67 REG_STATE(mmu, rw_mm_cfg, seg_e, page) |
68 REG_STATE(mmu, rw_mm_cfg, seg_d, linear) |
69#else
63 REG_STATE(mmu, rw_mm_cfg, seg_f, linear) | 70 REG_STATE(mmu, rw_mm_cfg, seg_f, linear) |
64 REG_STATE(mmu, rw_mm_cfg, seg_e, linear) | 71 REG_STATE(mmu, rw_mm_cfg, seg_e, linear) |
65 REG_STATE(mmu, rw_mm_cfg, seg_d, page) | 72 REG_STATE(mmu, rw_mm_cfg, seg_d, page) |
73#endif
66 REG_STATE(mmu, rw_mm_cfg, seg_c, linear) | 74 REG_STATE(mmu, rw_mm_cfg, seg_c, linear) |
67 REG_STATE(mmu, rw_mm_cfg, seg_b, linear) | 75 REG_STATE(mmu, rw_mm_cfg, seg_b, linear) |
68#ifndef CONFIG_ETRAX_VCS_SIM 76#ifndef CONFIG_ETRAX_VCS_SIM
@@ -81,9 +89,15 @@ cris_mmu_init(void)
81 REG_STATE(mmu, rw_mm_cfg, seg_1, page) | 89 REG_STATE(mmu, rw_mm_cfg, seg_1, page) |
82 REG_STATE(mmu, rw_mm_cfg, seg_0, page)); 90 REG_STATE(mmu, rw_mm_cfg, seg_0, page));
83 91
92 /* See head.S for differences between ARTPEC-3 and ETRAX FS. */
84 mmu_kbase_hi = ( REG_FIELD(mmu, rw_mm_kbase_hi, base_f, 0x0) | 93 mmu_kbase_hi = ( REG_FIELD(mmu, rw_mm_kbase_hi, base_f, 0x0) |
94#ifdef CONFIG_CRIS_MACH_ARTPEC3
95 REG_FIELD(mmu, rw_mm_kbase_hi, base_e, 0x0) |
96 REG_FIELD(mmu, rw_mm_kbase_hi, base_d, 0x5) |
97#else
85 REG_FIELD(mmu, rw_mm_kbase_hi, base_e, 0x8) | 98 REG_FIELD(mmu, rw_mm_kbase_hi, base_e, 0x8) |
86 REG_FIELD(mmu, rw_mm_kbase_hi, base_d, 0x0) | 99 REG_FIELD(mmu, rw_mm_kbase_hi, base_d, 0x0) |
100#endif
87 REG_FIELD(mmu, rw_mm_kbase_hi, base_c, 0x4) | 101 REG_FIELD(mmu, rw_mm_kbase_hi, base_c, 0x4) |
88 REG_FIELD(mmu, rw_mm_kbase_hi, base_b, 0xb) | 102 REG_FIELD(mmu, rw_mm_kbase_hi, base_b, 0xb) |
89#ifndef CONFIG_ETRAX_VCS_SIM 103#ifndef CONFIG_ETRAX_VCS_SIM
@@ -129,8 +143,7 @@ cris_mmu_init(void)
129 SUPP_REG_WR(RW_GC_CFG, 0xf); /* IMMU, DMMU, ICache, DCache on */ 143 SUPP_REG_WR(RW_GC_CFG, 0xf); /* IMMU, DMMU, ICache, DCache on */
130} 144}
131 145
132void __init 146void __init paging_init(void)
133paging_init(void)
134{ 147{
135 int i; 148 int i;
136 unsigned long zones_size[MAX_NR_ZONES]; 149 unsigned long zones_size[MAX_NR_ZONES];
diff --git a/arch/cris/arch-v32/mm/mmu.S b/arch/cris/arch-v32/mm/mmu.S
index f125d912e14..72727c1d8e6 100644
--- a/arch/cris/arch-v32/mm/mmu.S
+++ b/arch/cris/arch-v32/mm/mmu.S
@@ -38,6 +38,7 @@
38; to handle the fault. 38; to handle the fault.
39.macro MMU_BUS_FAULT_HANDLER handler, mmu, we, ex 39.macro MMU_BUS_FAULT_HANDLER handler, mmu, we, ex
40 .globl \handler 40 .globl \handler
41 .type \handler,"function"
41\handler: 42\handler:
42 SAVE_ALL 43 SAVE_ALL
43 move \mmu, $srs ; Select MMU support register bank 44 move \mmu, $srs ; Select MMU support register bank
@@ -52,6 +53,7 @@
52 nop 53 nop
53 ba ret_from_intr 54 ba ret_from_intr
54 nop 55 nop
56 .size \handler, . - \handler
55.endm 57.endm
56 58
57; Refill handler. Three cases may occur: 59; Refill handler. Three cases may occur:
@@ -84,6 +86,7 @@
842: .dword 0 ; last_refill_cause 862: .dword 0 ; last_refill_cause
85 .text 87 .text
86 .globl \handler 88 .globl \handler
89 .type \handler, "function"
87\handler: 90\handler:
88 subq 4, $sp 91 subq 4, $sp
89; (The pipeline stalls for one cycle; $sp used as address in the next cycle.) 92; (The pipeline stalls for one cycle; $sp used as address in the next cycle.)
@@ -196,6 +199,7 @@
196 ; Return 199 ; Return
197 ba ret_from_intr 200 ba ret_from_intr
198 nop 201 nop
202 .size \handler, . - \handler
199.endm 203.endm
200 204
201 ; This is the MMU bus fault handlers. 205 ; This is the MMU bus fault handlers.