1384740dcSRalf Baechle /*
2384740dcSRalf Baechle  * This file is subject to the terms and conditions of the GNU General Public
3384740dcSRalf Baechle  * License.  See the file "COPYING" in the main directory of this archive
4384740dcSRalf Baechle  * for more details.
5384740dcSRalf Baechle  *
6384740dcSRalf Baechle  * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
7384740dcSRalf Baechle  * Copyright (C) 2000, 2002  Maciej W. Rozycki
8384740dcSRalf Baechle  * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
9384740dcSRalf Baechle  */
10384740dcSRalf Baechle #ifndef _ASM_MACH_GENERIC_SPACES_H
11384740dcSRalf Baechle #define _ASM_MACH_GENERIC_SPACES_H
12384740dcSRalf Baechle 
13384740dcSRalf Baechle #include <linux/const.h>
14384740dcSRalf Baechle 
15384740dcSRalf Baechle /*
16384740dcSRalf Baechle  * This gives the physical RAM offset.
17384740dcSRalf Baechle  */
18384740dcSRalf Baechle #ifndef PHYS_OFFSET
19384740dcSRalf Baechle #define PHYS_OFFSET		_AC(0, UL)
20384740dcSRalf Baechle #endif
21384740dcSRalf Baechle 
22384740dcSRalf Baechle #ifdef CONFIG_32BIT
239843b030SSanjay Lal #ifdef CONFIG_KVM_GUEST
249843b030SSanjay Lal #define CAC_BASE		_AC(0x40000000, UL)
259843b030SSanjay Lal #else
26384740dcSRalf Baechle #define CAC_BASE		_AC(0x80000000, UL)
279843b030SSanjay Lal #endif
287ad18dd0SSteven J. Hill #ifndef IO_BASE
29384740dcSRalf Baechle #define IO_BASE			_AC(0xa0000000, UL)
307ad18dd0SSteven J. Hill #endif
317ad18dd0SSteven J. Hill #ifndef UNCAC_BASE
32384740dcSRalf Baechle #define UNCAC_BASE		_AC(0xa0000000, UL)
337ad18dd0SSteven J. Hill #endif
34384740dcSRalf Baechle 
35384740dcSRalf Baechle #ifndef MAP_BASE
369843b030SSanjay Lal #ifdef CONFIG_KVM_GUEST
379843b030SSanjay Lal #define MAP_BASE		_AC(0x60000000, UL)
389843b030SSanjay Lal #else
39384740dcSRalf Baechle #define MAP_BASE		_AC(0xc0000000, UL)
40384740dcSRalf Baechle #endif
419843b030SSanjay Lal #endif
42384740dcSRalf Baechle 
43384740dcSRalf Baechle /*
44384740dcSRalf Baechle  * Memory above this physical address will be considered highmem.
45384740dcSRalf Baechle  */
46384740dcSRalf Baechle #ifndef HIGHMEM_START
47384740dcSRalf Baechle #define HIGHMEM_START		_AC(0x20000000, UL)
48384740dcSRalf Baechle #endif
49384740dcSRalf Baechle 
50384740dcSRalf Baechle #endif /* CONFIG_32BIT */
51384740dcSRalf Baechle 
52384740dcSRalf Baechle #ifdef CONFIG_64BIT
53384740dcSRalf Baechle 
54384740dcSRalf Baechle #ifndef CAC_BASE
55384740dcSRalf Baechle #ifdef CONFIG_DMA_NONCOHERENT
56384740dcSRalf Baechle #define CAC_BASE		_AC(0x9800000000000000, UL)
57384740dcSRalf Baechle #else
58384740dcSRalf Baechle #define CAC_BASE		_AC(0xa800000000000000, UL)
59384740dcSRalf Baechle #endif
60384740dcSRalf Baechle #endif
61384740dcSRalf Baechle 
62384740dcSRalf Baechle #ifndef IO_BASE
63384740dcSRalf Baechle #define IO_BASE			_AC(0x9000000000000000, UL)
64384740dcSRalf Baechle #endif
65384740dcSRalf Baechle 
66384740dcSRalf Baechle #ifndef UNCAC_BASE
67384740dcSRalf Baechle #define UNCAC_BASE		_AC(0x9000000000000000, UL)
68384740dcSRalf Baechle #endif
69384740dcSRalf Baechle 
70384740dcSRalf Baechle #ifndef MAP_BASE
71384740dcSRalf Baechle #define MAP_BASE		_AC(0xc000000000000000, UL)
72384740dcSRalf Baechle #endif
73384740dcSRalf Baechle 
74384740dcSRalf Baechle /*
75384740dcSRalf Baechle  * Memory above this physical address will be considered highmem.
76384740dcSRalf Baechle  * Fixme: 59 bits is a fictive number and makes assumptions about processors
77384740dcSRalf Baechle  * in the distant future.  Nobody will care for a few years :-)
78384740dcSRalf Baechle  */
79384740dcSRalf Baechle #ifndef HIGHMEM_START
80384740dcSRalf Baechle #define HIGHMEM_START		(_AC(1, UL) << _AC(59, UL))
81384740dcSRalf Baechle #endif
82384740dcSRalf Baechle 
83384740dcSRalf Baechle #define TO_PHYS(x)		(	      ((x) & TO_PHYS_MASK))
84384740dcSRalf Baechle #define TO_CAC(x)		(CAC_BASE   | ((x) & TO_PHYS_MASK))
85384740dcSRalf Baechle #define TO_UNCAC(x)		(UNCAC_BASE | ((x) & TO_PHYS_MASK))
86384740dcSRalf Baechle 
87384740dcSRalf Baechle #endif /* CONFIG_64BIT */
88384740dcSRalf Baechle 
89384740dcSRalf Baechle /*
90384740dcSRalf Baechle  * This handles the memory map.
91384740dcSRalf Baechle  */
92384740dcSRalf Baechle #ifndef PAGE_OFFSET
93384740dcSRalf Baechle #define PAGE_OFFSET		(CAC_BASE + PHYS_OFFSET)
94384740dcSRalf Baechle #endif
95384740dcSRalf Baechle 
96565b60deSKevin Cernekee #ifndef FIXADDR_TOP
97565b60deSKevin Cernekee #define FIXADDR_TOP		((unsigned long)(long)(int)0xfffe0000)
98565b60deSKevin Cernekee #endif
99565b60deSKevin Cernekee 
100384740dcSRalf Baechle #endif /* __ASM_MACH_GENERIC_SPACES_H */
101