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 
153ffc17d8SPaul Burton #include <asm/mipsregs.h>
163ffc17d8SPaul Burton 
1721a379a8SJiaxun Yang #ifndef IO_SPACE_LIMIT
1821a379a8SJiaxun Yang #define IO_SPACE_LIMIT 0xffff
1921a379a8SJiaxun Yang #endif
2021a379a8SJiaxun Yang 
21384740dcSRalf Baechle /*
22384740dcSRalf Baechle  * This gives the physical RAM offset.
23384740dcSRalf Baechle  */
246c359eb1SPaul Burton #ifndef __ASSEMBLY__
256c359eb1SPaul Burton # if defined(CONFIG_MIPS_AUTO_PFN_OFFSET)
266c359eb1SPaul Burton #  define PHYS_OFFSET		((unsigned long)PFN_PHYS(ARCH_PFN_OFFSET))
276c359eb1SPaul Burton # elif !defined(PHYS_OFFSET)
28384740dcSRalf Baechle #  define PHYS_OFFSET		_AC(0, UL)
29384740dcSRalf Baechle # endif
306c359eb1SPaul Burton #endif /* __ASSEMBLY__ */
31384740dcSRalf Baechle 
32384740dcSRalf Baechle #ifdef CONFIG_32BIT
33384740dcSRalf Baechle #define CAC_BASE		_AC(0x80000000, UL)
347ad18dd0SSteven J. Hill #ifndef IO_BASE
35384740dcSRalf Baechle #define IO_BASE			_AC(0xa0000000, UL)
367ad18dd0SSteven J. Hill #endif
377ad18dd0SSteven J. Hill #ifndef UNCAC_BASE
38384740dcSRalf Baechle #define UNCAC_BASE		_AC(0xa0000000, UL)
397ad18dd0SSteven J. Hill #endif
40384740dcSRalf Baechle 
41384740dcSRalf Baechle #ifndef MAP_BASE
42384740dcSRalf Baechle #define MAP_BASE		_AC(0xc0000000, UL)
43384740dcSRalf Baechle #endif
44384740dcSRalf Baechle 
45384740dcSRalf Baechle /*
46384740dcSRalf Baechle  * Memory above this physical address will be considered highmem.
47384740dcSRalf Baechle  */
48384740dcSRalf Baechle #ifndef HIGHMEM_START
49384740dcSRalf Baechle #define HIGHMEM_START		_AC(0x20000000, UL)
50384740dcSRalf Baechle #endif
51384740dcSRalf Baechle 
52384740dcSRalf Baechle #endif /* CONFIG_32BIT */
53384740dcSRalf Baechle 
54384740dcSRalf Baechle #ifdef CONFIG_64BIT
55384740dcSRalf Baechle 
56384740dcSRalf Baechle #ifndef CAC_BASE
573ffc17d8SPaul Burton #define CAC_BASE	PHYS_TO_XKPHYS(read_c0_config() & CONF_CM_CMASK, 0)
58384740dcSRalf Baechle #endif
59384740dcSRalf Baechle 
60384740dcSRalf Baechle #ifndef IO_BASE
61384740dcSRalf Baechle #define IO_BASE			_AC(0x9000000000000000, UL)
62384740dcSRalf Baechle #endif
63384740dcSRalf Baechle 
64384740dcSRalf Baechle #ifndef UNCAC_BASE
65384740dcSRalf Baechle #define UNCAC_BASE		_AC(0x9000000000000000, UL)
66384740dcSRalf Baechle #endif
67384740dcSRalf Baechle 
68384740dcSRalf Baechle #ifndef MAP_BASE
69384740dcSRalf Baechle #define MAP_BASE		_AC(0xc000000000000000, UL)
70384740dcSRalf Baechle #endif
71384740dcSRalf Baechle 
72384740dcSRalf Baechle /*
73384740dcSRalf Baechle  * Memory above this physical address will be considered highmem.
74384740dcSRalf Baechle  * Fixme: 59 bits is a fictive number and makes assumptions about processors
75384740dcSRalf Baechle  * in the distant future.  Nobody will care for a few years :-)
76384740dcSRalf Baechle  */
77384740dcSRalf Baechle #ifndef HIGHMEM_START
78384740dcSRalf Baechle #define HIGHMEM_START		(_AC(1, UL) << _AC(59, UL))
79384740dcSRalf Baechle #endif
80384740dcSRalf Baechle 
81384740dcSRalf Baechle #define TO_PHYS(x)		(	      ((x) & TO_PHYS_MASK))
82384740dcSRalf Baechle #define TO_CAC(x)		(CAC_BASE   | ((x) & TO_PHYS_MASK))
83384740dcSRalf Baechle #define TO_UNCAC(x)		(UNCAC_BASE | ((x) & TO_PHYS_MASK))
84384740dcSRalf Baechle 
85384740dcSRalf Baechle #endif /* CONFIG_64BIT */
86384740dcSRalf Baechle 
87384740dcSRalf Baechle /*
88384740dcSRalf Baechle  * This handles the memory map.
89384740dcSRalf Baechle  */
90384740dcSRalf Baechle #ifndef PAGE_OFFSET
91384740dcSRalf Baechle #define PAGE_OFFSET		(CAC_BASE + PHYS_OFFSET)
92384740dcSRalf Baechle #endif
93384740dcSRalf Baechle 
94565b60deSKevin Cernekee #ifndef FIXADDR_TOP
95565b60deSKevin Cernekee #define FIXADDR_TOP		((unsigned long)(long)(int)0xfffe0000)
96565b60deSKevin Cernekee #endif
97565b60deSKevin Cernekee 
98384740dcSRalf Baechle #endif /* __ASM_MACH_GENERIC_SPACES_H */
99