pvr_rogue_heap_config.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
  2. /* Copyright (c) 2023 Imagination Technologies Ltd. */
  3. #ifndef PVR_ROGUE_HEAP_CONFIG_H
  4. #define PVR_ROGUE_HEAP_CONFIG_H
  5. #include <linux/sizes.h>
  6. /*
  7. * ROGUE Device Virtual Address Space Definitions
  8. *
  9. * This file defines the ROGUE virtual address heaps that are used in
  10. * application memory contexts. It also shows where the Firmware memory heap
  11. * fits into this, but the firmware heap is only ever created in the
  12. * kernel driver and never exposed to userspace.
  13. *
  14. * ROGUE_PDSCODEDATA_HEAP_BASE and ROGUE_USCCODE_HEAP_BASE will be programmed,
  15. * on a global basis, into ROGUE_CR_PDS_EXEC_BASE and ROGUE_CR_USC_CODE_BASE_*
  16. * respectively. Therefore if client drivers use multiple configs they must
  17. * still be consistent with their definitions for these heaps.
  18. *
  19. * Base addresses have to be a multiple of 4MiB.
  20. * Heaps must not start at 0x0000000000, as this is reserved for internal
  21. * use within the driver.
  22. * Range comments, those starting in column 0 below are a section heading of
  23. * sorts and are above the heaps in that range. Often this is the reserved
  24. * size of the heap within the range.
  25. */
  26. /* 0x00_0000_0000 ************************************************************/
  27. /* 0x00_0000_0000 - 0x00_0040_0000 */
  28. /* 0 MiB to 4 MiB, size of 4 MiB : RESERVED */
  29. /* 0x00_0040_0000 - 0x7F_FFC0_0000 **/
  30. /* 4 MiB to 512 GiB, size of 512 GiB less 4 MiB : RESERVED **/
  31. /* 0x80_0000_0000 ************************************************************/
  32. /* 0x80_0000_0000 - 0x9F_FFFF_FFFF **/
  33. /* 512 GiB to 640 GiB, size of 128 GiB : GENERAL_HEAP **/
  34. #define ROGUE_GENERAL_HEAP_BASE 0x8000000000ull
  35. #define ROGUE_GENERAL_HEAP_SIZE SZ_128G
  36. /* 0xA0_0000_0000 - 0xAF_FFFF_FFFF */
  37. /* 640 GiB to 704 GiB, size of 64 GiB : FREE */
  38. /* B0_0000_0000 - 0xB7_FFFF_FFFF */
  39. /* 704 GiB to 736 GiB, size of 32 GiB : FREE */
  40. /* 0xB8_0000_0000 - 0xBF_FFFF_FFFF */
  41. /* 736 GiB to 768 GiB, size of 32 GiB : RESERVED */
  42. /* 0xC0_0000_0000 ************************************************************/
  43. /* 0xC0_0000_0000 - 0xD9_FFFF_FFFF */
  44. /* 768 GiB to 872 GiB, size of 104 GiB : FREE */
  45. /* 0xDA_0000_0000 - 0xDA_FFFF_FFFF */
  46. /* 872 GiB to 876 GiB, size of 4 GiB : PDSCODEDATA_HEAP */
  47. #define ROGUE_PDSCODEDATA_HEAP_BASE 0xDA00000000ull
  48. #define ROGUE_PDSCODEDATA_HEAP_SIZE SZ_4G
  49. /* 0xDB_0000_0000 - 0xDB_FFFF_FFFF */
  50. /* 876 GiB to 880 GiB, size of 256 MiB (reserved 4GiB) : BRN **/
  51. /*
  52. * The BRN63142 quirk workaround requires Region Header memory to be at the top
  53. * of a 16GiB aligned range. This is so when masked with 0x03FFFFFFFF the
  54. * address will avoid aliasing PB addresses. Start at 879.75GiB. Size of 256MiB.
  55. */
  56. #define ROGUE_RGNHDR_HEAP_BASE 0xDBF0000000ull
  57. #define ROGUE_RGNHDR_HEAP_SIZE SZ_256M
  58. /* 0xDC_0000_0000 - 0xDF_FFFF_FFFF */
  59. /* 880 GiB to 896 GiB, size of 16 GiB : FREE */
  60. /* 0xE0_0000_0000 - 0xE0_FFFF_FFFF */
  61. /* 896 GiB to 900 GiB, size of 4 GiB : USCCODE_HEAP */
  62. #define ROGUE_USCCODE_HEAP_BASE 0xE000000000ull
  63. #define ROGUE_USCCODE_HEAP_SIZE SZ_4G
  64. /* 0xE1_0000_0000 - 0xE1_BFFF_FFFF */
  65. /* 900 GiB to 903 GiB, size of 3 GiB : RESERVED */
  66. /* 0xE1_C000_000 - 0xE1_FFFF_FFFF */
  67. /* 903 GiB to 904 GiB, reserved 1 GiB, : FIRMWARE_HEAP */
  68. #define ROGUE_FW_HEAP_BASE 0xE1C0000000ull
  69. /* 0xE2_0000_0000 - 0xE3_FFFF_FFFF */
  70. /* 904 GiB to 912 GiB, size of 8 GiB : FREE */
  71. /* 0xE4_0000_0000 - 0xE7_FFFF_FFFF */
  72. /* 912 GiB to 968 GiB, size of 16 GiB : TRANSFER_FRAG */
  73. #define ROGUE_TRANSFER_FRAG_HEAP_BASE 0xE400000000ull
  74. #define ROGUE_TRANSFER_FRAG_HEAP_SIZE SZ_16G
  75. /* 0xE8_0000_0000 - 0xF1_FFFF_FFFF */
  76. /* 928 GiB to 968 GiB, size of 40 GiB : RESERVED */
  77. /* 0xF2_0000_0000 - 0xF2_001F_FFFF **/
  78. /* 968 GiB to 969 GiB, size of 2 MiB : VISTEST_HEAP */
  79. #define ROGUE_VISTEST_HEAP_BASE 0xF200000000ull
  80. #define ROGUE_VISTEST_HEAP_SIZE SZ_2M
  81. /* 0xF2_4000_0000 - 0xF2_FFFF_FFFF */
  82. /* 969 GiB to 972 GiB, size of 3 GiB : FREE */
  83. /* 0xF3_0000_0000 - 0xFF_FFFF_FFFF */
  84. /* 972 GiB to 1024 GiB, size of 52 GiB : FREE */
  85. /* 0xFF_FFFF_FFFF ************************************************************/
  86. #endif /* PVR_ROGUE_HEAP_CONFIG_H */