spaces.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. #include <linux/const.h>
  13. #include <asm/mipsregs.h>
  14. #ifndef IO_SPACE_LIMIT
  15. #define IO_SPACE_LIMIT 0xffff
  16. #endif
  17. /*
  18. * This gives the physical RAM offset.
  19. */
  20. #ifndef __ASSEMBLY__
  21. # if defined(CONFIG_MIPS_AUTO_PFN_OFFSET)
  22. # define PHYS_OFFSET ((unsigned long)PFN_PHYS(ARCH_PFN_OFFSET))
  23. # elif !defined(PHYS_OFFSET)
  24. # define PHYS_OFFSET _AC(0, UL)
  25. # endif
  26. #endif /* __ASSEMBLY__ */
  27. #ifdef CONFIG_32BIT
  28. #define CAC_BASE _AC(0x80000000, UL)
  29. #ifndef IO_BASE
  30. #define IO_BASE _AC(0xa0000000, UL)
  31. #endif
  32. #ifndef UNCAC_BASE
  33. #define UNCAC_BASE _AC(0xa0000000, UL)
  34. #endif
  35. #ifndef MAP_BASE
  36. #define MAP_BASE _AC(0xc0000000, UL)
  37. #endif
  38. /*
  39. * Memory above this physical address will be considered highmem.
  40. */
  41. #ifndef HIGHMEM_START
  42. #define HIGHMEM_START _AC(0x20000000, UL)
  43. #endif
  44. #endif /* CONFIG_32BIT */
  45. #ifdef CONFIG_64BIT
  46. #ifndef CAC_BASE
  47. #define CAC_BASE PHYS_TO_XKPHYS(read_c0_config() & CONF_CM_CMASK, 0)
  48. #endif
  49. #ifndef IO_BASE
  50. #define IO_BASE _AC(0x9000000000000000, UL)
  51. #endif
  52. #ifndef UNCAC_BASE
  53. #define UNCAC_BASE _AC(0x9000000000000000, UL)
  54. #endif
  55. #ifndef MAP_BASE
  56. #define MAP_BASE _AC(0xc000000000000000, UL)
  57. #endif
  58. /*
  59. * Memory above this physical address will be considered highmem.
  60. * Fixme: 59 bits is a fictive number and makes assumptions about processors
  61. * in the distant future. Nobody will care for a few years :-)
  62. */
  63. #ifndef HIGHMEM_START
  64. #define HIGHMEM_START (_AC(1, UL) << _AC(59, UL))
  65. #endif
  66. #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
  67. #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
  68. #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
  69. #endif /* CONFIG_64BIT */
  70. /*
  71. * This handles the memory map.
  72. */
  73. #ifndef PAGE_OFFSET
  74. #define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
  75. #endif
  76. #ifndef FIXADDR_TOP
  77. #define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000)
  78. #endif
  79. #endif /* __ASM_MACH_GENERIC_SPACES_H */