1
2
3
4
5
6
7
8
9
10#ifndef _ASM_MACH_GENERIC_SPACES_H
11#define _ASM_MACH_GENERIC_SPACES_H
12
13#include <linux/const.h>
14
15#include <asm/mipsregs.h>
16
17
18
19
20#ifndef PHYS_OFFSET
21#define PHYS_OFFSET _AC(0, UL)
22#endif
23
24#ifdef CONFIG_32BIT
25#ifdef CONFIG_KVM_GUEST
26#define CAC_BASE _AC(0x40000000, UL)
27#else
28#define CAC_BASE _AC(0x80000000, UL)
29#endif
30#ifndef IO_BASE
31#define IO_BASE _AC(0xa0000000, UL)
32#endif
33#ifndef UNCAC_BASE
34#define UNCAC_BASE _AC(0xa0000000, UL)
35#endif
36
37#ifndef MAP_BASE
38#ifdef CONFIG_KVM_GUEST
39#define MAP_BASE _AC(0x60000000, UL)
40#else
41#define MAP_BASE _AC(0xc0000000, UL)
42#endif
43#endif
44
45
46
47
48#ifndef HIGHMEM_START
49#define HIGHMEM_START _AC(0x20000000, UL)
50#endif
51
52#endif
53
54#ifdef CONFIG_64BIT
55
56#ifndef CAC_BASE
57#define CAC_BASE PHYS_TO_XKPHYS(read_c0_config() & CONF_CM_CMASK, 0)
58#endif
59
60#ifndef IO_BASE
61#define IO_BASE _AC(0x9000000000000000, UL)
62#endif
63
64#ifndef UNCAC_BASE
65#define UNCAC_BASE _AC(0x9000000000000000, UL)
66#endif
67
68#ifndef MAP_BASE
69#define MAP_BASE _AC(0xc000000000000000, UL)
70#endif
71
72
73
74
75
76
77#ifndef HIGHMEM_START
78#define HIGHMEM_START (_AC(1, UL) << _AC(59, UL))
79#endif
80
81#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
82#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
83#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
84
85#endif
86
87
88
89
90#ifndef PAGE_OFFSET
91#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
92#endif
93
94#ifndef FIXADDR_TOP
95#ifdef CONFIG_KVM_GUEST
96#define FIXADDR_TOP ((unsigned long)(long)(int)0x7ffe0000)
97#else
98#define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000)
99#endif
100#endif
101
102#endif
103