Path: blob/master/drivers/accel/habanalabs/include/gaudi2/gaudi2.h
26446 views
/* SPDX-License-Identifier: GPL-2.01*2* Copyright 2020-2022 HabanaLabs, Ltd.3* All Rights Reserved.4*5*/67#ifndef GAUDI2_H8#define GAUDI2_H910#define SRAM_CFG_BAR_ID 011#define MSIX_BAR_ID 212#define DRAM_BAR_ID 41314/* Refers to CFG_REGION_SIZE, BAR0_RSRVD_SIZE and SRAM_SIZE */15#define CFG_BAR_SIZE 0x10000000ull /* 256MB */1617#define MSIX_BAR_SIZE 0x4000ull /* 16KB */1819#define CFG_BASE 0x1000007FF8000000ull20#define CFG_SIZE 0x8000000ull /* 96MB CFG + 32MB DBG*/21#define CFG_REGION_SIZE 0xC000000ull /* 192MB */2223#define STM_FLASH_BASE_ADDR 0x1000007FF4000000ull /* Not 256MB aligned */24#define STM_FLASH_ALIGNED_OFF 0x4000000ull /* 256 MB alignment */25#define STM_FLASH_SIZE 0x2000000ull /* 32MB */2627#define SPI_FLASH_BASE_ADDR 0x1000007FF6000000ull28#define SPI_FLASH_SIZE 0x1000000ull /* 16MB */2930#define SCRATCHPAD_SRAM_ADDR 0x1000007FF7FE0000ull31#define SCRATCHPAD_SRAM_SIZE 0x10000ull /* 64KB */3233#define PCIE_FW_SRAM_ADDR 0x1000007FF7FF0000ull34#define PCIE_FW_SRAM_SIZE 0x8000 /* 32KB */3536#define BAR0_RSRVD_BASE_ADDR 0x1000FFFFFC000000ull37#define BAR0_RSRVD_SIZE 0x1000000ull /* 16MB */3839#define SRAM_BASE_ADDR 0x1000FFFFFD000000ull40#define SRAM_SIZE 0x3000000ull /* 48MB */4142#define DRAM_PHYS_BASE 0x1001000000000000ull4344/* every hint address is masked accordingly */45#define DRAM_VA_HINT_MASK 0xFFFFFFFFFFFFull /* 48bit mask */4647#define HOST_PHYS_BASE_0 0x0000000000000000ull48#define HOST_PHYS_SIZE_0 0x0100000000000000ull /* 64PB (56 bits) */4950#define HOST_PHYS_BASE_1 0xFF00000000000000ull51#define HOST_PHYS_SIZE_1 0x0100000000000000ull /* 64PB (56 bits) */5253#define RESERVED_VA_RANGE_FOR_ARC_ON_HBM_START 0x1001500000000000ull54#define RESERVED_VA_RANGE_FOR_ARC_ON_HBM_END 0x10016FFFFFFFFFFFull5556#define RESERVED_VA_FOR_VIRTUAL_MSIX_DOORBELL_START 0xFFF077FFFFFF0000ull57#define RESERVED_VA_FOR_VIRTUAL_MSIX_DOORBELL_END 0xFFF077FFFFFFFFFFull5859#define RESERVED_VA_RANGE_FOR_ARC_ON_HOST_START 0xFFF0780000000000ull60#define RESERVED_VA_RANGE_FOR_ARC_ON_HOST_END 0xFFF07FFFFFFFFFFFull6162#define RESERVED_VA_RANGE_FOR_ARC_ON_HOST_HPAGE_START 0xFFF0F80000000000ull63#define RESERVED_VA_RANGE_FOR_ARC_ON_HOST_HPAGE_END 0xFFF0FFFFFFFFFFFFull6465#define RESERVED_MSIX_UNEXPECTED_USER_ERROR_INTERRUPT 1276667#define GAUDI2_MSIX_ENTRIES 1286869#define QMAN_PQ_ENTRY_SIZE 16 /* Bytes */7071#define MAX_ASID 27273#define NUM_ARC_CPUS 697475/* Every ARC cpu in the system contains a single DCCM block76* except MME and Scheduler ARCs which contain 2 DCCM blocks77*/78#define ARC_DCCM_BLOCK_SIZE 0x80007980#define NUM_OF_DCORES 481#define NUM_OF_SFT 482#define NUM_OF_PSOC_ARC 283#define NUM_OF_SCHEDULER_ARC 68485#define NUM_OF_PQ_PER_QMAN 486#define NUM_OF_CQ_PER_QMAN 587#define NUM_OF_CP_PER_QMAN 588#define NUM_OF_EDMA_PER_DCORE 289#define NUM_OF_HIF_PER_DCORE 490#define NUM_OF_PDMA 291#define NUM_OF_TPC_PER_DCORE 692#define NUM_DCORE0_TPC 793#define NUM_DCORE1_TPC NUM_OF_TPC_PER_DCORE94#define NUM_DCORE2_TPC NUM_OF_TPC_PER_DCORE95#define NUM_DCORE3_TPC NUM_OF_TPC_PER_DCORE96#define NUM_OF_DEC_PER_DCORE 297#define NUM_OF_ROT 298#define NUM_OF_HMMU_PER_DCORE 499#define NUM_OF_MME_PER_DCORE 1100#define NUM_OF_MME_SBTE_PER_DCORE 5101#define NUM_OF_MME_WB_PER_DCORE 2102#define NUM_OF_RTR_PER_DCORE 8103#define NUM_OF_VDEC_PER_DCORE 2104#define NUM_OF_IF_RTR_PER_SFT 3105#define NUM_OF_PCIE_VDEC 2106#define NUM_OF_ARC_FARMS_ARC 4107#define NUM_OF_XBAR 4108109#define TPC_NUM_OF_KERNEL_TENSORS 16110#define TPC_NUM_OF_QM_TENSORS 16111112#define MME_NUM_OF_LFSR_SEEDS 256113114#define NIC_NUMBER_OF_MACROS 12115116#define NIC_NUMBER_OF_QM_PER_MACRO 2117118#define NIC_NUMBER_OF_ENGINES (NIC_NUMBER_OF_MACROS * 2)119120#define NIC_MAX_NUMBER_OF_PORTS (NIC_NUMBER_OF_ENGINES * 2)121122#define DEVICE_CACHE_LINE_SIZE 128123124#endif /* GAUDI2_H */125126127