gaudi2.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /* SPDX-License-Identifier: GPL-2.0
  2. *
  3. * Copyright 2020-2022 HabanaLabs, Ltd.
  4. * All Rights Reserved.
  5. *
  6. */
  7. #ifndef GAUDI2_H
  8. #define GAUDI2_H
  9. #define SRAM_CFG_BAR_ID 0
  10. #define MSIX_BAR_ID 2
  11. #define DRAM_BAR_ID 4
  12. /* Refers to CFG_REGION_SIZE, BAR0_RSRVD_SIZE and SRAM_SIZE */
  13. #define CFG_BAR_SIZE 0x10000000ull /* 256MB */
  14. #define MSIX_BAR_SIZE 0x4000ull /* 16KB */
  15. #define CFG_BASE 0x1000007FF8000000ull
  16. #define CFG_SIZE 0x8000000ull /* 96MB CFG + 32MB DBG*/
  17. #define CFG_REGION_SIZE 0xC000000ull /* 192MB */
  18. #define STM_FLASH_BASE_ADDR 0x1000007FF4000000ull /* Not 256MB aligned */
  19. #define STM_FLASH_ALIGNED_OFF 0x4000000ull /* 256 MB alignment */
  20. #define STM_FLASH_SIZE 0x2000000ull /* 32MB */
  21. #define SPI_FLASH_BASE_ADDR 0x1000007FF6000000ull
  22. #define SPI_FLASH_SIZE 0x1000000ull /* 16MB */
  23. #define SCRATCHPAD_SRAM_ADDR 0x1000007FF7FE0000ull
  24. #define SCRATCHPAD_SRAM_SIZE 0x10000ull /* 64KB */
  25. #define PCIE_FW_SRAM_ADDR 0x1000007FF7FF0000ull
  26. #define PCIE_FW_SRAM_SIZE 0x8000 /* 32KB */
  27. #define BAR0_RSRVD_BASE_ADDR 0x1000FFFFFC000000ull
  28. #define BAR0_RSRVD_SIZE 0x1000000ull /* 16MB */
  29. #define SRAM_BASE_ADDR 0x1000FFFFFD000000ull
  30. #define SRAM_SIZE 0x3000000ull /* 48MB */
  31. #define DRAM_PHYS_BASE 0x1001000000000000ull
  32. /* every hint address is masked accordingly */
  33. #define DRAM_VA_HINT_MASK 0xFFFFFFFFFFFFull /* 48bit mask */
  34. #define HOST_PHYS_BASE_0 0x0000000000000000ull
  35. #define HOST_PHYS_SIZE_0 0x0100000000000000ull /* 64PB (56 bits) */
  36. #define HOST_PHYS_BASE_1 0xFF00000000000000ull
  37. #define HOST_PHYS_SIZE_1 0x0100000000000000ull /* 64PB (56 bits) */
  38. #define RESERVED_VA_RANGE_FOR_ARC_ON_HBM_START 0x1001500000000000ull
  39. #define RESERVED_VA_RANGE_FOR_ARC_ON_HBM_END 0x10016FFFFFFFFFFFull
  40. #define RESERVED_VA_FOR_VIRTUAL_MSIX_DOORBELL_START 0xFFF077FFFFFF0000ull
  41. #define RESERVED_VA_FOR_VIRTUAL_MSIX_DOORBELL_END 0xFFF077FFFFFFFFFFull
  42. #define RESERVED_VA_RANGE_FOR_ARC_ON_HOST_START 0xFFF0780000000000ull
  43. #define RESERVED_VA_RANGE_FOR_ARC_ON_HOST_END 0xFFF07FFFFFFFFFFFull
  44. #define RESERVED_VA_RANGE_FOR_ARC_ON_HOST_HPAGE_START 0xFFF0F80000000000ull
  45. #define RESERVED_VA_RANGE_FOR_ARC_ON_HOST_HPAGE_END 0xFFF0FFFFFFFFFFFFull
  46. #define GAUDI2_MSIX_ENTRIES 512
  47. #define QMAN_PQ_ENTRY_SIZE 16 /* Bytes */
  48. #define MAX_ASID 2
  49. #define NUM_ARC_CPUS 69
  50. /* Every ARC cpu in the system contains a single DCCM block
  51. * except MME and Scheduler ARCs which contain 2 DCCM blocks
  52. */
  53. #define ARC_DCCM_BLOCK_SIZE 0x8000
  54. #define NUM_OF_DCORES 4
  55. #define NUM_OF_SFT 4
  56. #define NUM_OF_PSOC_ARC 2
  57. #define NUM_OF_SCHEDULER_ARC 6
  58. #define NUM_OF_PQ_PER_QMAN 4
  59. #define NUM_OF_CQ_PER_QMAN 5
  60. #define NUM_OF_CP_PER_QMAN 5
  61. #define NUM_OF_EDMA_PER_DCORE 2
  62. #define NUM_OF_HIF_PER_DCORE 4
  63. #define NUM_OF_PDMA 2
  64. #define NUM_OF_TPC_PER_DCORE 6
  65. #define NUM_DCORE0_TPC 7
  66. #define NUM_DCORE1_TPC NUM_OF_TPC_PER_DCORE
  67. #define NUM_DCORE2_TPC NUM_OF_TPC_PER_DCORE
  68. #define NUM_DCORE3_TPC NUM_OF_TPC_PER_DCORE
  69. #define NUM_OF_DEC_PER_DCORE 2
  70. #define NUM_OF_ROT 2
  71. #define NUM_OF_HMMU_PER_DCORE 4
  72. #define NUM_OF_MME_PER_DCORE 1
  73. #define NUM_OF_MME_SBTE_PER_DCORE 5
  74. #define NUM_OF_MME_WB_PER_DCORE 2
  75. #define NUM_OF_RTR_PER_DCORE 8
  76. #define NUM_OF_VDEC_PER_DCORE 2
  77. #define NUM_OF_IF_RTR_PER_SFT 3
  78. #define NUM_OF_PCIE_VDEC 2
  79. #define NUM_OF_ARC_FARMS_ARC 4
  80. #define NUM_OF_XBAR 4
  81. #define TPC_NUM_OF_KERNEL_TENSORS 16
  82. #define TPC_NUM_OF_QM_TENSORS 16
  83. #define MME_NUM_OF_LFSR_SEEDS 256
  84. #define NIC_NUMBER_OF_MACROS 12
  85. #define NIC_NUMBER_OF_QM_PER_MACRO 2
  86. #define NIC_NUMBER_OF_ENGINES (NIC_NUMBER_OF_MACROS * 2)
  87. #define NIC_MAX_NUMBER_OF_PORTS (NIC_NUMBER_OF_ENGINES * 2)
  88. #define DEVICE_CACHE_LINE_SIZE 128
  89. #endif /* GAUDI2_H */