Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 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-Huu | c4612c8 | 2007-06-04 17:46:32 +0200 | [diff] [blame^] | 13 | #include <linux/const.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | |
Ralf Baechle | 875d43e | 2005-09-03 15:56:16 -0700 | [diff] [blame] | 15 | #ifdef CONFIG_32BIT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | |
Franck Bui-Huu | c4612c8 | 2007-06-04 17:46:32 +0200 | [diff] [blame^] | 17 | #define CAC_BASE _AC(0x80000000, UL) |
| 18 | #define IO_BASE _AC(0xa0000000, UL) |
| 19 | #define UNCAC_BASE _AC(0xa0000000, UL) |
Franck Bui-Huu | 09bb9ce | 2007-06-04 17:46:31 +0200 | [diff] [blame] | 20 | |
| 21 | #ifndef MAP_BASE |
Franck Bui-Huu | c4612c8 | 2007-06-04 17:46:32 +0200 | [diff] [blame^] | 22 | #define MAP_BASE _AC(0xc0000000, UL) |
Franck Bui-Huu | 09bb9ce | 2007-06-04 17:46:31 +0200 | [diff] [blame] | 23 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | |
| 25 | /* |
| 26 | * Memory above this physical address will be considered highmem. |
| 27 | */ |
| 28 | #ifndef HIGHMEM_START |
Franck Bui-Huu | c4612c8 | 2007-06-04 17:46:32 +0200 | [diff] [blame^] | 29 | #define HIGHMEM_START _AC(0x20000000, UL) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | #endif |
| 31 | |
Ralf Baechle | 875d43e | 2005-09-03 15:56:16 -0700 | [diff] [blame] | 32 | #endif /* CONFIG_32BIT */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | |
Ralf Baechle | 875d43e | 2005-09-03 15:56:16 -0700 | [diff] [blame] | 34 | #ifdef CONFIG_64BIT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | |
Franck Bui-Huu | c4612c8 | 2007-06-04 17:46:32 +0200 | [diff] [blame^] | 36 | #ifndef CAC_BASE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | #ifdef CONFIG_DMA_NONCOHERENT |
Franck Bui-Huu | c4612c8 | 2007-06-04 17:46:32 +0200 | [diff] [blame^] | 38 | #define CAC_BASE _AC(0x9800000000000000, UL) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | #else |
Franck Bui-Huu | c4612c8 | 2007-06-04 17:46:32 +0200 | [diff] [blame^] | 40 | #define CAC_BASE _AC(0xa800000000000000, UL) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | #endif |
Franck Bui-Huu | 09bb9ce | 2007-06-04 17:46:31 +0200 | [diff] [blame] | 42 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | |
Franck Bui-Huu | c4612c8 | 2007-06-04 17:46:32 +0200 | [diff] [blame^] | 44 | #ifndef IO_BASE |
| 45 | #define IO_BASE _AC(0x9000000000000000, UL) |
| 46 | #endif |
| 47 | |
| 48 | #ifndef UNCAC_BASE |
| 49 | #define UNCAC_BASE _AC(0x9000000000000000, UL) |
| 50 | #endif |
| 51 | |
| 52 | #ifndef MAP_BASE |
| 53 | #define MAP_BASE _AC(0xc000000000000000, UL) |
| 54 | #endif |
| 55 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | /* |
| 57 | * Memory above this physical address will be considered highmem. |
| 58 | * Fixme: 59 bits is a fictive number and makes assumptions about processors |
| 59 | * in the distant future. Nobody will care for a few years :-) |
| 60 | */ |
| 61 | #ifndef HIGHMEM_START |
Franck Bui-Huu | c4612c8 | 2007-06-04 17:46:32 +0200 | [diff] [blame^] | 62 | #define HIGHMEM_START (_AC(1, UL) << _AC(59, UL)) |
Franck Bui-Huu | 09bb9ce | 2007-06-04 17:46:31 +0200 | [diff] [blame] | 63 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | |
| 65 | #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) |
| 66 | #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) |
| 67 | #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) |
| 68 | |
Ralf Baechle | 875d43e | 2005-09-03 15:56:16 -0700 | [diff] [blame] | 69 | #endif /* CONFIG_64BIT */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | |
Franck Bui-Huu | c4612c8 | 2007-06-04 17:46:32 +0200 | [diff] [blame^] | 71 | /* |
| 72 | * This handles the memory map. |
| 73 | */ |
| 74 | #ifndef PAGE_OFFSET |
| 75 | #define PAGE_OFFSET CAC_BASE |
| 76 | #endif |
| 77 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | #endif /* __ASM_MACH_GENERIC_SPACES_H */ |