aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorStuart Menefy <stuart.menefy@st.com>2008-09-05 03:06:42 -0400
committerPaul Mundt <lethal@linux-sh.org>2008-09-07 21:35:04 -0400
commitc6feb6142cb85228e73497a309f475a0d7279318 (patch)
treec05344f677fabca1255d4e9e284e42a215f241d6 /arch
parent3159e7d62ad13f71ef3fe029c145594d8caa580d (diff)
sh: early cached_to_uncached initialization.
statically initialise the cached_to_uncached offset, so that we can use it immediatly. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/include/asm/system_32.h3
-rw-r--r--arch/sh/mm/init.c27
2 files changed, 16 insertions, 14 deletions
diff --git a/arch/sh/include/asm/system_32.h b/arch/sh/include/asm/system_32.h
index 16509ed2bb60..f7f105627fd9 100644
--- a/arch/sh/include/asm/system_32.h
+++ b/arch/sh/include/asm/system_32.h
@@ -58,7 +58,8 @@ do { \
58 last = __last; \ 58 last = __last; \
59} while (0) 59} while (0)
60 60
61#define __uses_jump_to_uncached __attribute__ ((__section__ (".uncached.text"))) 61#define __uses_jump_to_uncached \
62 noinline __attribute__ ((__section__ (".uncached.text")))
62 63
63/* 64/*
64 * Jump to uncached area. 65 * Jump to uncached area.
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index d4681a55c852..f1a494283c4e 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -23,7 +23,19 @@
23 23
24DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 24DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
25pgd_t swapper_pg_dir[PTRS_PER_PGD]; 25pgd_t swapper_pg_dir[PTRS_PER_PGD];
26unsigned long cached_to_uncached = 0; 26
27#ifdef CONFIG_SUPERH32
28/*
29 * Handle trivial transitions between cached and uncached
30 * segments, making use of the 1:1 mapping relationship in
31 * 512MB lowmem.
32 *
33 * This is the offset of the uncached section from its cached alias.
34 * Default value only valid in 29 bit mode, in 32bit mode will be
35 * overridden in pmb_init.
36 */
37unsigned long cached_to_uncached = P2SEG - P1SEG;
38#endif
27 39
28#ifdef CONFIG_MMU 40#ifdef CONFIG_MMU
29static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot) 41static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot)
@@ -58,9 +70,7 @@ static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot)
58 } 70 }
59 71
60 set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, prot)); 72 set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, prot));
61 73 flush_tlb_one(get_asid(), addr);
62 if (cached_to_uncached)
63 flush_tlb_one(get_asid(), addr);
64} 74}
65 75
66/* 76/*
@@ -165,15 +175,6 @@ void __init paging_init(void)
165#ifdef CONFIG_SUPERH32 175#ifdef CONFIG_SUPERH32
166 /* Set up the uncached fixmap */ 176 /* Set up the uncached fixmap */
167 set_fixmap_nocache(FIX_UNCACHED, __pa(&__uncached_start)); 177 set_fixmap_nocache(FIX_UNCACHED, __pa(&__uncached_start));
168
169#ifdef CONFIG_29BIT
170 /*
171 * Handle trivial transitions between cached and uncached
172 * segments, making use of the 1:1 mapping relationship in
173 * 512MB lowmem.
174 */
175 cached_to_uncached = P2SEG - P1SEG;
176#endif
177#endif 178#endif
178} 179}
179 180