spaces.h 2.2 KB

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