spaces.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. /*
  15. * This gives the physical RAM offset.
  16. */
  17. #ifndef __ASSEMBLY__
  18. # if defined(CONFIG_MIPS_AUTO_PFN_OFFSET)
  19. # define PHYS_OFFSET ((unsigned long)PFN_PHYS(ARCH_PFN_OFFSET))
  20. # elif !defined(PHYS_OFFSET)
  21. # define PHYS_OFFSET _AC(0, UL)
  22. # endif
  23. #endif /* __ASSEMBLY__ */
  24. #ifdef CONFIG_32BIT
  25. #ifdef CONFIG_KVM_GUEST
  26. #define CAC_BASE _AC(0x40000000, UL)
  27. #else
  28. #define CAC_BASE _AC(0x80000000, UL)
  29. #endif
  30. #ifndef IO_BASE
  31. #define IO_BASE _AC(0xa0000000, UL)
  32. #endif
  33. #ifndef UNCAC_BASE
  34. #define UNCAC_BASE _AC(0xa0000000, UL)
  35. #endif
  36. #ifndef MAP_BASE
  37. #ifdef CONFIG_KVM_GUEST
  38. #define MAP_BASE _AC(0x60000000, UL)
  39. #else
  40. #define MAP_BASE _AC(0xc0000000, UL)
  41. #endif
  42. #endif
  43. /*
  44. * Memory above this physical address will be considered highmem.
  45. */
  46. #ifndef HIGHMEM_START
  47. #define HIGHMEM_START _AC(0x20000000, UL)
  48. #endif
  49. #endif /* CONFIG_32BIT */
  50. #ifdef CONFIG_64BIT
  51. #ifndef CAC_BASE
  52. #define CAC_BASE PHYS_TO_XKPHYS(read_c0_config() & CONF_CM_CMASK, 0)
  53. #endif
  54. #ifndef IO_BASE
  55. #define IO_BASE _AC(0x9000000000000000, UL)
  56. #endif
  57. #ifndef UNCAC_BASE
  58. #define UNCAC_BASE _AC(0x9000000000000000, UL)
  59. #endif
  60. #ifndef MAP_BASE
  61. #define MAP_BASE _AC(0xc000000000000000, UL)
  62. #endif
  63. /*
  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
  69. #define HIGHMEM_START (_AC(1, UL) << _AC(59, UL))
  70. #endif
  71. #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
  72. #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
  73. #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
  74. #endif /* CONFIG_64BIT */
  75. /*
  76. * This handles the memory map.
  77. */
  78. #ifndef PAGE_OFFSET
  79. #define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
  80. #endif
  81. #ifndef FIXADDR_TOP
  82. #ifdef CONFIG_KVM_GUEST
  83. #define FIXADDR_TOP ((unsigned long)(long)(int)0x7ffe0000)
  84. #else
  85. #define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000)
  86. #endif
  87. #endif
  88. #endif /* __ASM_MACH_GENERIC_SPACES_H */