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 __ASSEMBLY__
21# if defined(CONFIG_MIPS_AUTO_PFN_OFFSET)
22# define PHYS_OFFSET ((unsigned long)PFN_PHYS(ARCH_PFN_OFFSET))
23# elif !defined(PHYS_OFFSET)
24# define PHYS_OFFSET _AC(0, UL)
25# endif
26#endif
27
28#ifdef CONFIG_32BIT
29#ifdef CONFIG_KVM_GUEST
30#define CAC_BASE _AC(0x40000000, UL)
31#else
32#define CAC_BASE _AC(0x80000000, UL)
33#endif
34#ifndef IO_BASE
35#define IO_BASE _AC(0xa0000000, UL)
36#endif
37#ifndef UNCAC_BASE
38#define UNCAC_BASE _AC(0xa0000000, UL)
39#endif
40
41#ifndef MAP_BASE
42#ifdef CONFIG_KVM_GUEST
43#define MAP_BASE _AC(0x60000000, UL)
44#else
45#define MAP_BASE _AC(0xc0000000, UL)
46#endif
47#endif
48
49
50
51
52#ifndef HIGHMEM_START
53#define HIGHMEM_START _AC(0x20000000, UL)
54#endif
55
56#endif
57
58#ifdef CONFIG_64BIT
59
60#ifndef CAC_BASE
61#define CAC_BASE PHYS_TO_XKPHYS(read_c0_config() & CONF_CM_CMASK, 0)
62#endif
63
64#ifndef IO_BASE
65#define IO_BASE _AC(0x9000000000000000, UL)
66#endif
67
68#ifndef UNCAC_BASE
69#define UNCAC_BASE _AC(0x9000000000000000, UL)
70#endif
71
72#ifndef MAP_BASE
73#define MAP_BASE _AC(0xc000000000000000, UL)
74#endif
75
76
77
78
79
80
81#ifndef HIGHMEM_START
82#define HIGHMEM_START (_AC(1, UL) << _AC(59, UL))
83#endif
84
85#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
86#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
87#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
88
89#endif
90
91
92
93
94#ifndef PAGE_OFFSET
95#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
96#endif
97
98#ifndef FIXADDR_TOP
99#ifdef CONFIG_KVM_GUEST
100#define FIXADDR_TOP ((unsigned long)(long)(int)0x7ffe0000)
101#else
102#define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000)
103#endif
104#endif
105
106#endif
107