spaces.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
  4. * Copyright (C) 2000, 2002 Maciej W. Rozycki
  5. * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
  6. */
  7. #ifndef _ASM_MACH_GENERIC_SPACES_H
  8. #define _ASM_MACH_GENERIC_SPACES_H
  9. #include <linux/const.h>
  10. /*
  11. * This gives the physical RAM offset.
  12. */
  13. #ifndef PHYS_OFFSET
  14. #define PHYS_OFFSET _AC(0, UL)
  15. #endif
  16. #ifdef CONFIG_32BIT
  17. #ifdef CONFIG_KVM_GUEST
  18. #define CAC_BASE _AC(0x40000000, UL)
  19. #else
  20. #define CAC_BASE _AC(0x80000000, UL)
  21. #endif
  22. #ifndef IO_BASE
  23. #define IO_BASE _AC(0xa0000000, UL)
  24. #endif
  25. #ifndef UNCAC_BASE
  26. #define UNCAC_BASE _AC(0xa0000000, UL)
  27. #endif
  28. #ifndef MAP_BASE
  29. #ifdef CONFIG_KVM_GUEST
  30. #define MAP_BASE _AC(0x60000000, UL)
  31. #else
  32. #define MAP_BASE _AC(0xc0000000, UL)
  33. #endif
  34. #endif
  35. /*
  36. * Memory above this physical address will be considered highmem.
  37. */
  38. #ifndef HIGHMEM_START
  39. #define HIGHMEM_START _AC(0x20000000, UL)
  40. #endif
  41. #endif /* CONFIG_32BIT */
  42. #ifdef CONFIG_64BIT
  43. #ifndef CAC_BASE
  44. #ifdef CONFIG_DMA_NONCOHERENT
  45. #define CAC_BASE _AC(0x9800000000000000, UL)
  46. #else
  47. #define CAC_BASE _AC(0xa800000000000000, UL)
  48. #endif
  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 */