aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJesper Nilsson <jesper.nilsson@axis.com>2010-08-03 12:01:06 -0400
committerJesper Nilsson <jesper.nilsson@axis.com>2010-08-04 07:02:31 -0400
commit7ec280c52ca5aa1448cd16ae77dd44755413db2b (patch)
tree1c17d3986dec9d1482e001d258796025daa049e7 /arch
parent98560bd83e73b5c0cf38e3d984892f46a405a172 (diff)
CRIS: Update for ARTPEC-3
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/cris/arch-v32/mm/init.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/arch/cris/arch-v32/mm/init.c b/arch/cris/arch-v32/mm/init.c
index caeb921a92ea..0768bc409ca8 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];