blob: 9488fa5f886603fdef1ac258182bf82d61004faf [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
7 * Copyright (C) 2000, 2002 Maciej W. Rozycki
8 * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_MACH_GENERIC_SPACES_H
11#define _ASM_MACH_GENERIC_SPACES_H
12
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020013#include <linux/const.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
Franck Bui-Huu41b04832007-06-04 17:46:34 +020015/*
16 * This gives the physical RAM offset.
17 */
18#ifndef PHYS_OFFSET
19#define PHYS_OFFSET _AC(0, UL)
20#endif
21
Ralf Baechle875d43e2005-09-03 15:56:16 -070022#ifdef CONFIG_32BIT
Sanjay Lal9843b032012-11-21 18:34:03 -080023#ifdef CONFIG_KVM_GUEST
24#define CAC_BASE _AC(0x40000000, UL)
25#else
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020026#define CAC_BASE _AC(0x80000000, UL)
Sanjay Lal9843b032012-11-21 18:34:03 -080027#endif
Steven J. Hill7ad18dd2013-07-03 17:28:22 +000028#ifndef IO_BASE
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020029#define IO_BASE _AC(0xa0000000, UL)
Steven J. Hill7ad18dd2013-07-03 17:28:22 +000030#endif
31#ifndef UNCAC_BASE
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020032#define UNCAC_BASE _AC(0xa0000000, UL)
Steven J. Hill7ad18dd2013-07-03 17:28:22 +000033#endif
Franck Bui-Huu09bb9ce2007-06-04 17:46:31 +020034
35#ifndef MAP_BASE
Sanjay Lal9843b032012-11-21 18:34:03 -080036#ifdef CONFIG_KVM_GUEST
37#define MAP_BASE _AC(0x60000000, UL)
38#else
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020039#define MAP_BASE _AC(0xc0000000, UL)
Franck Bui-Huu09bb9ce2007-06-04 17:46:31 +020040#endif
Sanjay Lal9843b032012-11-21 18:34:03 -080041#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070042
43/*
44 * Memory above this physical address will be considered highmem.
45 */
46#ifndef HIGHMEM_START
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020047#define HIGHMEM_START _AC(0x20000000, UL)
Linus Torvalds1da177e2005-04-16 15:20:36 -070048#endif
49
Ralf Baechle875d43e2005-09-03 15:56:16 -070050#endif /* CONFIG_32BIT */
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Ralf Baechle875d43e2005-09-03 15:56:16 -070052#ifdef CONFIG_64BIT
Linus Torvalds1da177e2005-04-16 15:20:36 -070053
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020054#ifndef CAC_BASE
Linus Torvalds1da177e2005-04-16 15:20:36 -070055#ifdef CONFIG_DMA_NONCOHERENT
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020056#define CAC_BASE _AC(0x9800000000000000, UL)
Linus Torvalds1da177e2005-04-16 15:20:36 -070057#else
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020058#define CAC_BASE _AC(0xa800000000000000, UL)
Linus Torvalds1da177e2005-04-16 15:20:36 -070059#endif
Franck Bui-Huu09bb9ce2007-06-04 17:46:31 +020060#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070061
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020062#ifndef IO_BASE
63#define IO_BASE _AC(0x9000000000000000, UL)
64#endif
65
66#ifndef UNCAC_BASE
67#define UNCAC_BASE _AC(0x9000000000000000, UL)
68#endif
69
70#ifndef MAP_BASE
71#define MAP_BASE _AC(0xc000000000000000, UL)
72#endif
73
Linus Torvalds1da177e2005-04-16 15:20:36 -070074/*
75 * Memory above this physical address will be considered highmem.
76 * Fixme: 59 bits is a fictive number and makes assumptions about processors
77 * in the distant future. Nobody will care for a few years :-)
78 */
79#ifndef HIGHMEM_START
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020080#define HIGHMEM_START (_AC(1, UL) << _AC(59, UL))
Franck Bui-Huu09bb9ce2007-06-04 17:46:31 +020081#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070082
Ralf Baechle70342282013-01-22 12:59:30 +010083#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
Linus Torvalds1da177e2005-04-16 15:20:36 -070084#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
85#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
86
Ralf Baechle875d43e2005-09-03 15:56:16 -070087#endif /* CONFIG_64BIT */
Linus Torvalds1da177e2005-04-16 15:20:36 -070088
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020089/*
90 * This handles the memory map.
91 */
92#ifndef PAGE_OFFSET
Franck Bui-Huudb385012007-06-04 17:46:33 +020093#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020094#endif
95
Kevin Cernekee565b60d2010-09-07 12:59:15 -070096#ifndef FIXADDR_TOP
97#define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000)
98#endif
99
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100#endif /* __ASM_MACH_GENERIC_SPACES_H */