spaces.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
  3. * Copyright (C) 2000, 2002 Maciej W. Rozycki
  4. * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
  5. *
  6. * SPDX-License-Identifier: GPL-2.0
  7. */
  8. #ifndef _ASM_MACH_GENERIC_SPACES_H
  9. #define _ASM_MACH_GENERIC_SPACES_H
  10. #include <asm/const.h>
  11. /*
  12. * This gives the physical RAM offset.
  13. */
  14. #ifndef PHYS_OFFSET
  15. #define PHYS_OFFSET _AC(0, UL)
  16. #endif
  17. #ifdef CONFIG_32BIT
  18. #ifdef CONFIG_KVM_GUEST
  19. #define CAC_BASE _AC(0x40000000, UL)
  20. #else
  21. #define CAC_BASE _AC(0x80000000, UL)
  22. #endif
  23. #ifndef IO_BASE
  24. #define IO_BASE _AC(0xa0000000, UL)
  25. #endif
  26. #ifndef UNCAC_BASE
  27. #define UNCAC_BASE _AC(0xa0000000, UL)
  28. #endif
  29. #ifndef MAP_BASE
  30. #ifdef CONFIG_KVM_GUEST
  31. #define MAP_BASE _AC(0x60000000, UL)
  32. #else
  33. #define MAP_BASE _AC(0xc0000000, UL)
  34. #endif
  35. #endif
  36. /*
  37. * Memory above this physical address will be considered highmem.
  38. */
  39. #ifndef HIGHMEM_START
  40. #define HIGHMEM_START _AC(0x20000000, UL)
  41. #endif
  42. #endif /* CONFIG_32BIT */
  43. #ifdef CONFIG_64BIT
  44. #ifndef CAC_BASE
  45. #ifdef CONFIG_DMA_NONCOHERENT
  46. #define CAC_BASE _AC(0x9800000000000000, UL)
  47. #else
  48. #define CAC_BASE _AC(0xa800000000000000, UL)
  49. #endif
  50. #endif
  51. #ifndef IO_BASE
  52. #define IO_BASE _AC(0x9000000000000000, UL)
  53. #endif
  54. #ifndef UNCAC_BASE
  55. #define UNCAC_BASE _AC(0x9000000000000000, UL)
  56. #endif
  57. #ifndef MAP_BASE
  58. #define MAP_BASE _AC(0xc000000000000000, UL)
  59. #endif
  60. /*
  61. * Memory above this physical address will be considered highmem.
  62. * Fixme: 59 bits is a fictive number and makes assumptions about processors
  63. * in the distant future. Nobody will care for a few years :-)
  64. */
  65. #ifndef HIGHMEM_START
  66. #define HIGHMEM_START (_AC(1, UL) << _AC(59, UL))
  67. #endif
  68. #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
  69. #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
  70. #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
  71. #endif /* CONFIG_64BIT */
  72. /*
  73. * This handles the memory map.
  74. */
  75. #ifndef PAGE_OFFSET
  76. #define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
  77. #endif
  78. #ifndef FIXADDR_TOP
  79. #ifdef CONFIG_KVM_GUEST
  80. #define FIXADDR_TOP ((unsigned long)(long)(int)0x7ffe0000)
  81. #else
  82. #define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000)
  83. #endif
  84. #endif
  85. #endif /* __ASM_MACH_GENERIC_SPACES_H */