Blame view

arch/sh/mm/uncached.c 1.15 KB
9edef2865   Paul Mundt   sh: uncached mapp...
1
  #include <linux/init.h>
5b34d1ee1   Paul Mundt   sh: Export uncach...
2
  #include <linux/module.h>
9edef2865   Paul Mundt   sh: uncached mapp...
3
4
  #include <asm/sizes.h>
  #include <asm/page.h>
40d1f0048   Paul Mundt   sh: Fix up uncach...
5
  #include <asm/addrspace.h>
9edef2865   Paul Mundt   sh: uncached mapp...
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  
  /*
   * This is the offset of the uncached section from its cached alias.
   *
   * Legacy platforms handle trivial transitions between cached and
   * uncached segments by making use of the 1:1 mapping relationship in
   * 512MB lowmem, others via a special uncached mapping.
   *
   * Default value only valid in 29 bit mode, in 32bit mode this will be
   * updated by the early PMB initialization code.
   */
  unsigned long cached_to_uncached = SZ_512M;
  unsigned long uncached_size = SZ_512M;
  unsigned long uncached_start, uncached_end;
5b34d1ee1   Paul Mundt   sh: Export uncach...
20
21
  EXPORT_SYMBOL(uncached_start);
  EXPORT_SYMBOL(uncached_end);
9edef2865   Paul Mundt   sh: uncached mapp...
22
23
24
25
26
  
  int virt_addr_uncached(unsigned long kaddr)
  {
  	return (kaddr >= uncached_start) && (kaddr < uncached_end);
  }
5b34d1ee1   Paul Mundt   sh: Export uncach...
27
  EXPORT_SYMBOL(virt_addr_uncached);
9edef2865   Paul Mundt   sh: uncached mapp...
28
29
30
  
  void __init uncached_init(void)
  {
e2fcf74f3   Paul Mundt   sh: nommu: use 32...
31
  #if defined(CONFIG_29BIT) || !defined(CONFIG_MMU)
40d1f0048   Paul Mundt   sh: Fix up uncach...
32
33
  	uncached_start = P2SEG;
  #else
9edef2865   Paul Mundt   sh: uncached mapp...
34
  	uncached_start = memory_end;
40d1f0048   Paul Mundt   sh: Fix up uncach...
35
  #endif
9edef2865   Paul Mundt   sh: uncached mapp...
36
37
  	uncached_end = uncached_start + uncached_size;
  }
d01447b31   Paul Mundt   sh: Merge legacy ...
38
39
40
41
42
43
  
  void __init uncached_resize(unsigned long size)
  {
  	uncached_size = size;
  	uncached_end = uncached_start + uncached_size;
  }