blob: c9fa4b14968d483ff6dd224c3a4daf23dc3b1143 [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
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020024#define CAC_BASE _AC(0x80000000, UL)
25#define IO_BASE _AC(0xa0000000, UL)
26#define UNCAC_BASE _AC(0xa0000000, UL)
Franck Bui-Huu09bb9ce2007-06-04 17:46:31 +020027
28#ifndef MAP_BASE
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020029#define MAP_BASE _AC(0xc0000000, UL)
Franck Bui-Huu09bb9ce2007-06-04 17:46:31 +020030#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070031
32/*
33 * Memory above this physical address will be considered highmem.
34 */
35#ifndef HIGHMEM_START
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020036#define HIGHMEM_START _AC(0x20000000, UL)
Linus Torvalds1da177e2005-04-16 15:20:36 -070037#endif
38
Ralf Baechle875d43e2005-09-03 15:56:16 -070039#endif /* CONFIG_32BIT */
Linus Torvalds1da177e2005-04-16 15:20:36 -070040
Ralf Baechle875d43e2005-09-03 15:56:16 -070041#ifdef CONFIG_64BIT
Linus Torvalds1da177e2005-04-16 15:20:36 -070042
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020043#ifndef CAC_BASE
Linus Torvalds1da177e2005-04-16 15:20:36 -070044#ifdef CONFIG_DMA_NONCOHERENT
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020045#define CAC_BASE _AC(0x9800000000000000, UL)
Linus Torvalds1da177e2005-04-16 15:20:36 -070046#else
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020047#define CAC_BASE _AC(0xa800000000000000, UL)
Linus Torvalds1da177e2005-04-16 15:20:36 -070048#endif
Franck Bui-Huu09bb9ce2007-06-04 17:46:31 +020049#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020051#ifndef IO_BASE
52#define IO_BASE _AC(0x9000000000000000, UL)
53#endif
54
55#ifndef UNCAC_BASE
56#define UNCAC_BASE _AC(0x9000000000000000, UL)
57#endif
58
59#ifndef MAP_BASE
60#define MAP_BASE _AC(0xc000000000000000, UL)
61#endif
62
Linus Torvalds1da177e2005-04-16 15:20:36 -070063/*
64 * Memory above this physical address will be considered highmem.
65 * Fixme: 59 bits is a fictive number and makes assumptions about processors
66 * in the distant future. Nobody will care for a few years :-)
67 */
68#ifndef HIGHMEM_START
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020069#define HIGHMEM_START (_AC(1, UL) << _AC(59, UL))
Franck Bui-Huu09bb9ce2007-06-04 17:46:31 +020070#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
72#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
73#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
74#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
75
Ralf Baechle875d43e2005-09-03 15:56:16 -070076#endif /* CONFIG_64BIT */
Linus Torvalds1da177e2005-04-16 15:20:36 -070077
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020078/*
79 * This handles the memory map.
80 */
81#ifndef PAGE_OFFSET
Franck Bui-Huudb385012007-06-04 17:46:33 +020082#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
Franck Bui-Huuc4612c82007-06-04 17:46:32 +020083#endif
84
Linus Torvalds1da177e2005-04-16 15:20:36 -070085#endif /* __ASM_MACH_GENERIC_SPACES_H */