Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * This file is subject to the terms and conditions of the GNU General Public
0003  * License.  See the file "COPYING" in the main directory of this archive
0004  * for more details.
0005  *
0006  * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
0007  * Copyright (C) 2000, 2002  Maciej W. Rozycki
0008  * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
0009  */
0010 #ifndef _ASM_MACH_GENERIC_SPACES_H
0011 #define _ASM_MACH_GENERIC_SPACES_H
0012 
0013 #include <linux/const.h>
0014 
0015 #include <asm/mipsregs.h>
0016 
0017 #ifndef IO_SPACE_LIMIT
0018 #define IO_SPACE_LIMIT 0xffff
0019 #endif
0020 
0021 /*
0022  * This gives the physical RAM offset.
0023  */
0024 #ifndef __ASSEMBLY__
0025 # if defined(CONFIG_MIPS_AUTO_PFN_OFFSET)
0026 #  define PHYS_OFFSET       ((unsigned long)PFN_PHYS(ARCH_PFN_OFFSET))
0027 # elif !defined(PHYS_OFFSET)
0028 #  define PHYS_OFFSET       _AC(0, UL)
0029 # endif
0030 #endif /* __ASSEMBLY__ */
0031 
0032 #ifdef CONFIG_32BIT
0033 #define CAC_BASE        _AC(0x80000000, UL)
0034 #ifndef IO_BASE
0035 #define IO_BASE         _AC(0xa0000000, UL)
0036 #endif
0037 #ifndef UNCAC_BASE
0038 #define UNCAC_BASE      _AC(0xa0000000, UL)
0039 #endif
0040 
0041 #ifndef MAP_BASE
0042 #define MAP_BASE        _AC(0xc0000000, UL)
0043 #endif
0044 
0045 /*
0046  * Memory above this physical address will be considered highmem.
0047  */
0048 #ifndef HIGHMEM_START
0049 #define HIGHMEM_START       _AC(0x20000000, UL)
0050 #endif
0051 
0052 #endif /* CONFIG_32BIT */
0053 
0054 #ifdef CONFIG_64BIT
0055 
0056 #ifndef CAC_BASE
0057 #define CAC_BASE    PHYS_TO_XKPHYS(read_c0_config() & CONF_CM_CMASK, 0)
0058 #endif
0059 
0060 #ifndef IO_BASE
0061 #define IO_BASE         _AC(0x9000000000000000, UL)
0062 #endif
0063 
0064 #ifndef UNCAC_BASE
0065 #define UNCAC_BASE      _AC(0x9000000000000000, UL)
0066 #endif
0067 
0068 #ifndef MAP_BASE
0069 #define MAP_BASE        _AC(0xc000000000000000, UL)
0070 #endif
0071 
0072 /*
0073  * Memory above this physical address will be considered highmem.
0074  * Fixme: 59 bits is a fictive number and makes assumptions about processors
0075  * in the distant future.  Nobody will care for a few years :-)
0076  */
0077 #ifndef HIGHMEM_START
0078 #define HIGHMEM_START       (_AC(1, UL) << _AC(59, UL))
0079 #endif
0080 
0081 #define TO_PHYS(x)      (         ((x) & TO_PHYS_MASK))
0082 #define TO_CAC(x)       (CAC_BASE   | ((x) & TO_PHYS_MASK))
0083 #define TO_UNCAC(x)     (UNCAC_BASE | ((x) & TO_PHYS_MASK))
0084 
0085 #endif /* CONFIG_64BIT */
0086 
0087 /*
0088  * This handles the memory map.
0089  */
0090 #ifndef PAGE_OFFSET
0091 #define PAGE_OFFSET     (CAC_BASE + PHYS_OFFSET)
0092 #endif
0093 
0094 #ifndef FIXADDR_TOP
0095 #define FIXADDR_TOP     ((unsigned long)(long)(int)0xfffe0000)
0096 #endif
0097 
0098 #endif /* __ASM_MACH_GENERIC_SPACES_H */