]> git.karo-electronics.de Git - karo-tx-linux.git/blob - arch/sh/mm/uncached.c
Merge branch 'sh/driver-core' into sh/clkfwk
[karo-tx-linux.git] / arch / sh / mm / uncached.c
1 #include <linux/init.h>
2 #include <asm/sizes.h>
3 #include <asm/page.h>
4 #include <asm/addrspace.h>
5
6 /*
7  * This is the offset of the uncached section from its cached alias.
8  *
9  * Legacy platforms handle trivial transitions between cached and
10  * uncached segments by making use of the 1:1 mapping relationship in
11  * 512MB lowmem, others via a special uncached mapping.
12  *
13  * Default value only valid in 29 bit mode, in 32bit mode this will be
14  * updated by the early PMB initialization code.
15  */
16 unsigned long cached_to_uncached = SZ_512M;
17 unsigned long uncached_size = SZ_512M;
18 unsigned long uncached_start, uncached_end;
19
20 int virt_addr_uncached(unsigned long kaddr)
21 {
22         return (kaddr >= uncached_start) && (kaddr < uncached_end);
23 }
24
25 void __init uncached_init(void)
26 {
27 #ifdef CONFIG_29BIT
28         uncached_start = P2SEG;
29 #else
30         uncached_start = memory_end;
31 #endif
32         uncached_end = uncached_start + uncached_size;
33 }
34
35 void __init uncached_resize(unsigned long size)
36 {
37         uncached_size = size;
38         uncached_end = uncached_start + uncached_size;
39 }