Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0
0002  *
0003  * Copyright 2020-2022 HabanaLabs, Ltd.
0004  * All Rights Reserved.
0005  *
0006  */
0007 
0008 #ifndef GAUDI2_H
0009 #define GAUDI2_H
0010 
0011 #define SRAM_CFG_BAR_ID     0
0012 #define MSIX_BAR_ID     2
0013 #define DRAM_BAR_ID     4
0014 
0015 /* Refers to CFG_REGION_SIZE, BAR0_RSRVD_SIZE and SRAM_SIZE */
0016 #define CFG_BAR_SIZE        0x10000000ull       /* 256MB */
0017 
0018 #define MSIX_BAR_SIZE       0x4000ull       /* 16KB */
0019 
0020 #define CFG_BASE        0x1000007FF8000000ull
0021 #define CFG_SIZE        0x8000000ull        /* 96MB CFG + 32MB DBG*/
0022 #define CFG_REGION_SIZE     0xC000000ull        /* 192MB */
0023 
0024 #define STM_FLASH_BASE_ADDR 0x1000007FF4000000ull   /* Not 256MB aligned */
0025 #define STM_FLASH_ALIGNED_OFF   0x4000000ull        /* 256 MB alignment */
0026 #define STM_FLASH_SIZE      0x2000000ull        /* 32MB */
0027 
0028 #define SPI_FLASH_BASE_ADDR 0x1000007FF6000000ull
0029 #define SPI_FLASH_SIZE      0x1000000ull        /* 16MB */
0030 
0031 #define SCRATCHPAD_SRAM_ADDR    0x1000007FF7FE0000ull
0032 #define SCRATCHPAD_SRAM_SIZE    0x10000ull      /* 64KB */
0033 
0034 #define PCIE_FW_SRAM_ADDR   0x1000007FF7FF0000ull
0035 #define PCIE_FW_SRAM_SIZE   0x8000          /* 32KB */
0036 
0037 #define BAR0_RSRVD_BASE_ADDR    0x1000FFFFFC000000ull
0038 #define BAR0_RSRVD_SIZE     0x1000000ull        /* 16MB */
0039 
0040 #define SRAM_BASE_ADDR      0x1000FFFFFD000000ull
0041 #define SRAM_SIZE       0x3000000ull        /* 48MB */
0042 
0043 #define DRAM_PHYS_BASE      0x1001000000000000ull
0044 
0045 /* every hint address is masked accordingly */
0046 #define DRAM_VA_HINT_MASK   0xFFFFFFFFFFFFull   /* 48bit mask */
0047 
0048 #define HOST_PHYS_BASE_0    0x0000000000000000ull
0049 #define HOST_PHYS_SIZE_0    0x0100000000000000ull   /* 64PB (56 bits) */
0050 
0051 #define HOST_PHYS_BASE_1    0xFF00000000000000ull
0052 #define HOST_PHYS_SIZE_1    0x0100000000000000ull   /* 64PB (56 bits) */
0053 
0054 #define RESERVED_VA_RANGE_FOR_ARC_ON_HBM_START  0x1001500000000000ull
0055 #define RESERVED_VA_RANGE_FOR_ARC_ON_HBM_END    0x10016FFFFFFFFFFFull
0056 
0057 #define RESERVED_VA_FOR_VIRTUAL_MSIX_DOORBELL_START 0xFFF077FFFFFF0000ull
0058 #define RESERVED_VA_FOR_VIRTUAL_MSIX_DOORBELL_END   0xFFF077FFFFFFFFFFull
0059 
0060 #define RESERVED_VA_RANGE_FOR_ARC_ON_HOST_START 0xFFF0780000000000ull
0061 #define RESERVED_VA_RANGE_FOR_ARC_ON_HOST_END   0xFFF07FFFFFFFFFFFull
0062 
0063 #define RESERVED_VA_RANGE_FOR_ARC_ON_HOST_HPAGE_START   0xFFF0F80000000000ull
0064 #define RESERVED_VA_RANGE_FOR_ARC_ON_HOST_HPAGE_END 0xFFF0FFFFFFFFFFFFull
0065 
0066 #define GAUDI2_MSIX_ENTRIES 512
0067 
0068 #define QMAN_PQ_ENTRY_SIZE  16          /* Bytes */
0069 
0070 #define MAX_ASID        2
0071 
0072 #define NUM_ARC_CPUS            69
0073 
0074 /* Every ARC cpu in the system contains a single DCCM block
0075  * except MME and Scheduler ARCs which contain 2 DCCM blocks
0076  */
0077 #define ARC_DCCM_BLOCK_SIZE     0x8000
0078 
0079 #define NUM_OF_DCORES           4
0080 #define NUM_OF_SFT          4
0081 #define NUM_OF_PSOC_ARC         2
0082 #define NUM_OF_SCHEDULER_ARC        6
0083 
0084 #define NUM_OF_PQ_PER_QMAN      4
0085 #define NUM_OF_CQ_PER_QMAN      5
0086 #define NUM_OF_CP_PER_QMAN      5
0087 #define NUM_OF_EDMA_PER_DCORE       2
0088 #define NUM_OF_HIF_PER_DCORE        4
0089 #define NUM_OF_PDMA         2
0090 #define NUM_OF_TPC_PER_DCORE        6
0091 #define NUM_DCORE0_TPC          7
0092 #define NUM_DCORE1_TPC          NUM_OF_TPC_PER_DCORE
0093 #define NUM_DCORE2_TPC          NUM_OF_TPC_PER_DCORE
0094 #define NUM_DCORE3_TPC          NUM_OF_TPC_PER_DCORE
0095 #define NUM_OF_DEC_PER_DCORE        2
0096 #define NUM_OF_ROT          2
0097 #define NUM_OF_HMMU_PER_DCORE       4
0098 #define NUM_OF_MME_PER_DCORE        1
0099 #define NUM_OF_MME_SBTE_PER_DCORE   5
0100 #define NUM_OF_MME_WB_PER_DCORE     2
0101 #define NUM_OF_RTR_PER_DCORE        8
0102 #define NUM_OF_VDEC_PER_DCORE       2
0103 #define NUM_OF_IF_RTR_PER_SFT       3
0104 #define NUM_OF_PCIE_VDEC        2
0105 #define NUM_OF_ARC_FARMS_ARC        4
0106 #define NUM_OF_XBAR         4
0107 
0108 #define TPC_NUM_OF_KERNEL_TENSORS   16
0109 #define TPC_NUM_OF_QM_TENSORS       16
0110 
0111 #define MME_NUM_OF_LFSR_SEEDS       256
0112 
0113 #define NIC_NUMBER_OF_MACROS        12
0114 
0115 #define NIC_NUMBER_OF_QM_PER_MACRO  2
0116 
0117 #define NIC_NUMBER_OF_ENGINES       (NIC_NUMBER_OF_MACROS * 2)
0118 
0119 #define NIC_MAX_NUMBER_OF_PORTS     (NIC_NUMBER_OF_ENGINES * 2)
0120 
0121 #define DEVICE_CACHE_LINE_SIZE      128
0122 
0123 #endif /* GAUDI2_H */