17d25cae7SOded Gabbay /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note 27d25cae7SOded Gabbay * 37d25cae7SOded Gabbay * Copyright 2016-2022 HabanaLabs, Ltd. 47d25cae7SOded Gabbay * All Rights Reserved. 57d25cae7SOded Gabbay * 67d25cae7SOded Gabbay */ 77d25cae7SOded Gabbay 87d25cae7SOded Gabbay #ifndef HABANALABS_H_ 97d25cae7SOded Gabbay #define HABANALABS_H_ 107d25cae7SOded Gabbay 117d25cae7SOded Gabbay #include <linux/types.h> 127d25cae7SOded Gabbay #include <linux/ioctl.h> 137d25cae7SOded Gabbay 147d25cae7SOded Gabbay /* 157d25cae7SOded Gabbay * Defines that are asic-specific but constitutes as ABI between kernel driver 167d25cae7SOded Gabbay * and userspace 177d25cae7SOded Gabbay */ 187d25cae7SOded Gabbay #define GOYA_KMD_SRAM_RESERVED_SIZE_FROM_START 0x8000 /* 32KB */ 197d25cae7SOded Gabbay #define GAUDI_DRIVER_SRAM_RESERVED_SIZE_FROM_START 0x80 /* 128 bytes */ 207d25cae7SOded Gabbay 217d25cae7SOded Gabbay /* 227d25cae7SOded Gabbay * 128 SOBs reserved for collective wait 237d25cae7SOded Gabbay * 16 SOBs reserved for sync stream 247d25cae7SOded Gabbay */ 257d25cae7SOded Gabbay #define GAUDI_FIRST_AVAILABLE_W_S_SYNC_OBJECT 144 267d25cae7SOded Gabbay 277d25cae7SOded Gabbay /* 287d25cae7SOded Gabbay * 64 monitors reserved for collective wait 297d25cae7SOded Gabbay * 8 monitors reserved for sync stream 307d25cae7SOded Gabbay */ 317d25cae7SOded Gabbay #define GAUDI_FIRST_AVAILABLE_W_S_MONITOR 72 327d25cae7SOded Gabbay 337d25cae7SOded Gabbay /* Max number of elements in timestamps registration buffers */ 347d25cae7SOded Gabbay #define TS_MAX_ELEMENTS_NUM (1 << 20) /* 1MB */ 357d25cae7SOded Gabbay 367d25cae7SOded Gabbay /* 377d25cae7SOded Gabbay * Goya queue Numbering 387d25cae7SOded Gabbay * 397d25cae7SOded Gabbay * The external queues (PCI DMA channels) MUST be before the internal queues 407d25cae7SOded Gabbay * and each group (PCI DMA channels and internal) must be contiguous inside 417d25cae7SOded Gabbay * itself but there can be a gap between the two groups (although not 427d25cae7SOded Gabbay * recommended) 437d25cae7SOded Gabbay */ 447d25cae7SOded Gabbay 457d25cae7SOded Gabbay enum goya_queue_id { 467d25cae7SOded Gabbay GOYA_QUEUE_ID_DMA_0 = 0, 477d25cae7SOded Gabbay GOYA_QUEUE_ID_DMA_1 = 1, 487d25cae7SOded Gabbay GOYA_QUEUE_ID_DMA_2 = 2, 497d25cae7SOded Gabbay GOYA_QUEUE_ID_DMA_3 = 3, 507d25cae7SOded Gabbay GOYA_QUEUE_ID_DMA_4 = 4, 517d25cae7SOded Gabbay GOYA_QUEUE_ID_CPU_PQ = 5, 527d25cae7SOded Gabbay GOYA_QUEUE_ID_MME = 6, /* Internal queues start here */ 537d25cae7SOded Gabbay GOYA_QUEUE_ID_TPC0 = 7, 547d25cae7SOded Gabbay GOYA_QUEUE_ID_TPC1 = 8, 557d25cae7SOded Gabbay GOYA_QUEUE_ID_TPC2 = 9, 567d25cae7SOded Gabbay GOYA_QUEUE_ID_TPC3 = 10, 577d25cae7SOded Gabbay GOYA_QUEUE_ID_TPC4 = 11, 587d25cae7SOded Gabbay GOYA_QUEUE_ID_TPC5 = 12, 597d25cae7SOded Gabbay GOYA_QUEUE_ID_TPC6 = 13, 607d25cae7SOded Gabbay GOYA_QUEUE_ID_TPC7 = 14, 617d25cae7SOded Gabbay GOYA_QUEUE_ID_SIZE 627d25cae7SOded Gabbay }; 637d25cae7SOded Gabbay 647d25cae7SOded Gabbay /* 657d25cae7SOded Gabbay * Gaudi queue Numbering 667d25cae7SOded Gabbay * External queues (PCI DMA channels) are DMA_0_*, DMA_1_* and DMA_5_*. 677d25cae7SOded Gabbay * Except one CPU queue, all the rest are internal queues. 687d25cae7SOded Gabbay */ 697d25cae7SOded Gabbay 707d25cae7SOded Gabbay enum gaudi_queue_id { 717d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_0_0 = 0, /* external */ 727d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_0_1 = 1, /* external */ 737d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_0_2 = 2, /* external */ 747d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_0_3 = 3, /* external */ 757d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_1_0 = 4, /* external */ 767d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_1_1 = 5, /* external */ 777d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_1_2 = 6, /* external */ 787d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_1_3 = 7, /* external */ 797d25cae7SOded Gabbay GAUDI_QUEUE_ID_CPU_PQ = 8, /* CPU */ 807d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_2_0 = 9, /* internal */ 817d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_2_1 = 10, /* internal */ 827d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_2_2 = 11, /* internal */ 837d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_2_3 = 12, /* internal */ 847d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_3_0 = 13, /* internal */ 857d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_3_1 = 14, /* internal */ 867d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_3_2 = 15, /* internal */ 877d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_3_3 = 16, /* internal */ 887d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_4_0 = 17, /* internal */ 897d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_4_1 = 18, /* internal */ 907d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_4_2 = 19, /* internal */ 917d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_4_3 = 20, /* internal */ 927d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_5_0 = 21, /* internal */ 937d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_5_1 = 22, /* internal */ 947d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_5_2 = 23, /* internal */ 957d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_5_3 = 24, /* internal */ 967d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_6_0 = 25, /* internal */ 977d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_6_1 = 26, /* internal */ 987d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_6_2 = 27, /* internal */ 997d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_6_3 = 28, /* internal */ 1007d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_7_0 = 29, /* internal */ 1017d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_7_1 = 30, /* internal */ 1027d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_7_2 = 31, /* internal */ 1037d25cae7SOded Gabbay GAUDI_QUEUE_ID_DMA_7_3 = 32, /* internal */ 1047d25cae7SOded Gabbay GAUDI_QUEUE_ID_MME_0_0 = 33, /* internal */ 1057d25cae7SOded Gabbay GAUDI_QUEUE_ID_MME_0_1 = 34, /* internal */ 1067d25cae7SOded Gabbay GAUDI_QUEUE_ID_MME_0_2 = 35, /* internal */ 1077d25cae7SOded Gabbay GAUDI_QUEUE_ID_MME_0_3 = 36, /* internal */ 1087d25cae7SOded Gabbay GAUDI_QUEUE_ID_MME_1_0 = 37, /* internal */ 1097d25cae7SOded Gabbay GAUDI_QUEUE_ID_MME_1_1 = 38, /* internal */ 1107d25cae7SOded Gabbay GAUDI_QUEUE_ID_MME_1_2 = 39, /* internal */ 1117d25cae7SOded Gabbay GAUDI_QUEUE_ID_MME_1_3 = 40, /* internal */ 1127d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_0_0 = 41, /* internal */ 1137d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_0_1 = 42, /* internal */ 1147d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_0_2 = 43, /* internal */ 1157d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_0_3 = 44, /* internal */ 1167d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_1_0 = 45, /* internal */ 1177d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_1_1 = 46, /* internal */ 1187d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_1_2 = 47, /* internal */ 1197d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_1_3 = 48, /* internal */ 1207d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_2_0 = 49, /* internal */ 1217d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_2_1 = 50, /* internal */ 1227d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_2_2 = 51, /* internal */ 1237d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_2_3 = 52, /* internal */ 1247d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_3_0 = 53, /* internal */ 1257d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_3_1 = 54, /* internal */ 1267d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_3_2 = 55, /* internal */ 1277d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_3_3 = 56, /* internal */ 1287d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_4_0 = 57, /* internal */ 1297d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_4_1 = 58, /* internal */ 1307d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_4_2 = 59, /* internal */ 1317d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_4_3 = 60, /* internal */ 1327d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_5_0 = 61, /* internal */ 1337d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_5_1 = 62, /* internal */ 1347d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_5_2 = 63, /* internal */ 1357d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_5_3 = 64, /* internal */ 1367d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_6_0 = 65, /* internal */ 1377d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_6_1 = 66, /* internal */ 1387d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_6_2 = 67, /* internal */ 1397d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_6_3 = 68, /* internal */ 1407d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_7_0 = 69, /* internal */ 1417d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_7_1 = 70, /* internal */ 1427d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_7_2 = 71, /* internal */ 1437d25cae7SOded Gabbay GAUDI_QUEUE_ID_TPC_7_3 = 72, /* internal */ 1447d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_0_0 = 73, /* internal */ 1457d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_0_1 = 74, /* internal */ 1467d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_0_2 = 75, /* internal */ 1477d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_0_3 = 76, /* internal */ 1487d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_1_0 = 77, /* internal */ 1497d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_1_1 = 78, /* internal */ 1507d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_1_2 = 79, /* internal */ 1517d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_1_3 = 80, /* internal */ 1527d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_2_0 = 81, /* internal */ 1537d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_2_1 = 82, /* internal */ 1547d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_2_2 = 83, /* internal */ 1557d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_2_3 = 84, /* internal */ 1567d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_3_0 = 85, /* internal */ 1577d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_3_1 = 86, /* internal */ 1587d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_3_2 = 87, /* internal */ 1597d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_3_3 = 88, /* internal */ 1607d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_4_0 = 89, /* internal */ 1617d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_4_1 = 90, /* internal */ 1627d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_4_2 = 91, /* internal */ 1637d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_4_3 = 92, /* internal */ 1647d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_5_0 = 93, /* internal */ 1657d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_5_1 = 94, /* internal */ 1667d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_5_2 = 95, /* internal */ 1677d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_5_3 = 96, /* internal */ 1687d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_6_0 = 97, /* internal */ 1697d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_6_1 = 98, /* internal */ 1707d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_6_2 = 99, /* internal */ 1717d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_6_3 = 100, /* internal */ 1727d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_7_0 = 101, /* internal */ 1737d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_7_1 = 102, /* internal */ 1747d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_7_2 = 103, /* internal */ 1757d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_7_3 = 104, /* internal */ 1767d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_8_0 = 105, /* internal */ 1777d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_8_1 = 106, /* internal */ 1787d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_8_2 = 107, /* internal */ 1797d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_8_3 = 108, /* internal */ 1807d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_9_0 = 109, /* internal */ 1817d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_9_1 = 110, /* internal */ 1827d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_9_2 = 111, /* internal */ 1837d25cae7SOded Gabbay GAUDI_QUEUE_ID_NIC_9_3 = 112, /* internal */ 1847d25cae7SOded Gabbay GAUDI_QUEUE_ID_SIZE 1857d25cae7SOded Gabbay }; 1867d25cae7SOded Gabbay 1877d25cae7SOded Gabbay /* 1887d25cae7SOded Gabbay * In GAUDI2 we have two modes of operation in regard to queues: 1897d25cae7SOded Gabbay * 1. Legacy mode, where each QMAN exposes 4 streams to the user 1907d25cae7SOded Gabbay * 2. F/W mode, where we use F/W to schedule the JOBS to the different queues. 1917d25cae7SOded Gabbay * 1927d25cae7SOded Gabbay * When in legacy mode, the user sends the queue id per JOB according to 1937d25cae7SOded Gabbay * enum gaudi2_queue_id below. 1947d25cae7SOded Gabbay * 1957d25cae7SOded Gabbay * When in F/W mode, the user sends a stream id per Command Submission. The 1967d25cae7SOded Gabbay * stream id is a running number from 0 up to (N-1), where N is the number 1977d25cae7SOded Gabbay * of streams the F/W exposes and is passed to the user in 1987d25cae7SOded Gabbay * struct hl_info_hw_ip_info 1997d25cae7SOded Gabbay */ 2007d25cae7SOded Gabbay 2017d25cae7SOded Gabbay enum gaudi2_queue_id { 2027d25cae7SOded Gabbay GAUDI2_QUEUE_ID_PDMA_0_0 = 0, 2037d25cae7SOded Gabbay GAUDI2_QUEUE_ID_PDMA_0_1 = 1, 2047d25cae7SOded Gabbay GAUDI2_QUEUE_ID_PDMA_0_2 = 2, 2057d25cae7SOded Gabbay GAUDI2_QUEUE_ID_PDMA_0_3 = 3, 2067d25cae7SOded Gabbay GAUDI2_QUEUE_ID_PDMA_1_0 = 4, 2077d25cae7SOded Gabbay GAUDI2_QUEUE_ID_PDMA_1_1 = 5, 2087d25cae7SOded Gabbay GAUDI2_QUEUE_ID_PDMA_1_2 = 6, 2097d25cae7SOded Gabbay GAUDI2_QUEUE_ID_PDMA_1_3 = 7, 2107d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_EDMA_0_0 = 8, 2117d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_EDMA_0_1 = 9, 2127d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_EDMA_0_2 = 10, 2137d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_EDMA_0_3 = 11, 2147d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_EDMA_1_0 = 12, 2157d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_EDMA_1_1 = 13, 2167d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_EDMA_1_2 = 14, 2177d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_EDMA_1_3 = 15, 2187d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_MME_0_0 = 16, 2197d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_MME_0_1 = 17, 2207d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_MME_0_2 = 18, 2217d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_MME_0_3 = 19, 2227d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_0_0 = 20, 2237d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_0_1 = 21, 2247d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_0_2 = 22, 2257d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_0_3 = 23, 2267d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_1_0 = 24, 2277d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_1_1 = 25, 2287d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_1_2 = 26, 2297d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_1_3 = 27, 2307d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_2_0 = 28, 2317d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_2_1 = 29, 2327d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_2_2 = 30, 2337d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_2_3 = 31, 2347d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_3_0 = 32, 2357d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_3_1 = 33, 2367d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_3_2 = 34, 2377d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_3_3 = 35, 2387d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_4_0 = 36, 2397d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_4_1 = 37, 2407d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_4_2 = 38, 2417d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_4_3 = 39, 2427d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_5_0 = 40, 2437d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_5_1 = 41, 2447d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_5_2 = 42, 2457d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_5_3 = 43, 2467d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_6_0 = 44, 2477d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_6_1 = 45, 2487d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_6_2 = 46, 2497d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE0_TPC_6_3 = 47, 2507d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_EDMA_0_0 = 48, 2517d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_EDMA_0_1 = 49, 2527d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_EDMA_0_2 = 50, 2537d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_EDMA_0_3 = 51, 2547d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_EDMA_1_0 = 52, 2557d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_EDMA_1_1 = 53, 2567d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_EDMA_1_2 = 54, 2577d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_EDMA_1_3 = 55, 2587d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_MME_0_0 = 56, 2597d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_MME_0_1 = 57, 2607d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_MME_0_2 = 58, 2617d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_MME_0_3 = 59, 2627d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_0_0 = 60, 2637d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_0_1 = 61, 2647d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_0_2 = 62, 2657d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_0_3 = 63, 2667d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_1_0 = 64, 2677d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_1_1 = 65, 2687d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_1_2 = 66, 2697d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_1_3 = 67, 2707d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_2_0 = 68, 2717d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_2_1 = 69, 2727d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_2_2 = 70, 2737d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_2_3 = 71, 2747d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_3_0 = 72, 2757d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_3_1 = 73, 2767d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_3_2 = 74, 2777d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_3_3 = 75, 2787d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_4_0 = 76, 2797d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_4_1 = 77, 2807d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_4_2 = 78, 2817d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_4_3 = 79, 2827d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_5_0 = 80, 2837d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_5_1 = 81, 2847d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_5_2 = 82, 2857d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE1_TPC_5_3 = 83, 2867d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_EDMA_0_0 = 84, 2877d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_EDMA_0_1 = 85, 2887d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_EDMA_0_2 = 86, 2897d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_EDMA_0_3 = 87, 2907d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_EDMA_1_0 = 88, 2917d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_EDMA_1_1 = 89, 2927d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_EDMA_1_2 = 90, 2937d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_EDMA_1_3 = 91, 2947d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_MME_0_0 = 92, 2957d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_MME_0_1 = 93, 2967d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_MME_0_2 = 94, 2977d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_MME_0_3 = 95, 2987d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_0_0 = 96, 2997d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_0_1 = 97, 3007d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_0_2 = 98, 3017d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_0_3 = 99, 3027d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_1_0 = 100, 3037d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_1_1 = 101, 3047d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_1_2 = 102, 3057d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_1_3 = 103, 3067d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_2_0 = 104, 3077d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_2_1 = 105, 3087d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_2_2 = 106, 3097d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_2_3 = 107, 3107d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_3_0 = 108, 3117d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_3_1 = 109, 3127d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_3_2 = 110, 3137d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_3_3 = 111, 3147d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_4_0 = 112, 3157d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_4_1 = 113, 3167d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_4_2 = 114, 3177d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_4_3 = 115, 3187d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_5_0 = 116, 3197d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_5_1 = 117, 3207d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_5_2 = 118, 3217d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE2_TPC_5_3 = 119, 3227d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_EDMA_0_0 = 120, 3237d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_EDMA_0_1 = 121, 3247d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_EDMA_0_2 = 122, 3257d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_EDMA_0_3 = 123, 3267d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_EDMA_1_0 = 124, 3277d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_EDMA_1_1 = 125, 3287d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_EDMA_1_2 = 126, 3297d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_EDMA_1_3 = 127, 3307d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_MME_0_0 = 128, 3317d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_MME_0_1 = 129, 3327d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_MME_0_2 = 130, 3337d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_MME_0_3 = 131, 3347d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_0_0 = 132, 3357d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_0_1 = 133, 3367d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_0_2 = 134, 3377d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_0_3 = 135, 3387d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_1_0 = 136, 3397d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_1_1 = 137, 3407d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_1_2 = 138, 3417d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_1_3 = 139, 3427d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_2_0 = 140, 3437d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_2_1 = 141, 3447d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_2_2 = 142, 3457d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_2_3 = 143, 3467d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_3_0 = 144, 3477d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_3_1 = 145, 3487d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_3_2 = 146, 3497d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_3_3 = 147, 3507d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_4_0 = 148, 3517d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_4_1 = 149, 3527d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_4_2 = 150, 3537d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_4_3 = 151, 3547d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_5_0 = 152, 3557d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_5_1 = 153, 3567d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_5_2 = 154, 3577d25cae7SOded Gabbay GAUDI2_QUEUE_ID_DCORE3_TPC_5_3 = 155, 3587d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_0_0 = 156, 3597d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_0_1 = 157, 3607d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_0_2 = 158, 3617d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_0_3 = 159, 3627d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_1_0 = 160, 3637d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_1_1 = 161, 3647d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_1_2 = 162, 3657d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_1_3 = 163, 3667d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_2_0 = 164, 3677d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_2_1 = 165, 3687d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_2_2 = 166, 3697d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_2_3 = 167, 3707d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_3_0 = 168, 3717d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_3_1 = 169, 3727d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_3_2 = 170, 3737d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_3_3 = 171, 3747d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_4_0 = 172, 3757d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_4_1 = 173, 3767d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_4_2 = 174, 3777d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_4_3 = 175, 3787d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_5_0 = 176, 3797d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_5_1 = 177, 3807d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_5_2 = 178, 3817d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_5_3 = 179, 3827d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_6_0 = 180, 3837d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_6_1 = 181, 3847d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_6_2 = 182, 3857d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_6_3 = 183, 3867d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_7_0 = 184, 3877d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_7_1 = 185, 3887d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_7_2 = 186, 3897d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_7_3 = 187, 3907d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_8_0 = 188, 3917d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_8_1 = 189, 3927d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_8_2 = 190, 3937d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_8_3 = 191, 3947d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_9_0 = 192, 3957d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_9_1 = 193, 3967d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_9_2 = 194, 3977d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_9_3 = 195, 3987d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_10_0 = 196, 3997d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_10_1 = 197, 4007d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_10_2 = 198, 4017d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_10_3 = 199, 4027d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_11_0 = 200, 4037d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_11_1 = 201, 4047d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_11_2 = 202, 4057d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_11_3 = 203, 4067d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_12_0 = 204, 4077d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_12_1 = 205, 4087d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_12_2 = 206, 4097d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_12_3 = 207, 4107d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_13_0 = 208, 4117d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_13_1 = 209, 4127d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_13_2 = 210, 4137d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_13_3 = 211, 4147d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_14_0 = 212, 4157d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_14_1 = 213, 4167d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_14_2 = 214, 4177d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_14_3 = 215, 4187d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_15_0 = 216, 4197d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_15_1 = 217, 4207d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_15_2 = 218, 4217d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_15_3 = 219, 4227d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_16_0 = 220, 4237d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_16_1 = 221, 4247d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_16_2 = 222, 4257d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_16_3 = 223, 4267d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_17_0 = 224, 4277d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_17_1 = 225, 4287d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_17_2 = 226, 4297d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_17_3 = 227, 4307d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_18_0 = 228, 4317d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_18_1 = 229, 4327d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_18_2 = 230, 4337d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_18_3 = 231, 4347d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_19_0 = 232, 4357d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_19_1 = 233, 4367d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_19_2 = 234, 4377d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_19_3 = 235, 4387d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_20_0 = 236, 4397d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_20_1 = 237, 4407d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_20_2 = 238, 4417d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_20_3 = 239, 4427d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_21_0 = 240, 4437d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_21_1 = 241, 4447d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_21_2 = 242, 4457d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_21_3 = 243, 4467d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_22_0 = 244, 4477d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_22_1 = 245, 4487d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_22_2 = 246, 4497d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_22_3 = 247, 4507d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_23_0 = 248, 4517d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_23_1 = 249, 4527d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_23_2 = 250, 4537d25cae7SOded Gabbay GAUDI2_QUEUE_ID_NIC_23_3 = 251, 4547d25cae7SOded Gabbay GAUDI2_QUEUE_ID_ROT_0_0 = 252, 4557d25cae7SOded Gabbay GAUDI2_QUEUE_ID_ROT_0_1 = 253, 4567d25cae7SOded Gabbay GAUDI2_QUEUE_ID_ROT_0_2 = 254, 4577d25cae7SOded Gabbay GAUDI2_QUEUE_ID_ROT_0_3 = 255, 4587d25cae7SOded Gabbay GAUDI2_QUEUE_ID_ROT_1_0 = 256, 4597d25cae7SOded Gabbay GAUDI2_QUEUE_ID_ROT_1_1 = 257, 4607d25cae7SOded Gabbay GAUDI2_QUEUE_ID_ROT_1_2 = 258, 4617d25cae7SOded Gabbay GAUDI2_QUEUE_ID_ROT_1_3 = 259, 4627d25cae7SOded Gabbay GAUDI2_QUEUE_ID_CPU_PQ = 260, 4637d25cae7SOded Gabbay GAUDI2_QUEUE_ID_SIZE 4647d25cae7SOded Gabbay }; 4657d25cae7SOded Gabbay 4667d25cae7SOded Gabbay /* 4677d25cae7SOded Gabbay * Engine Numbering 4687d25cae7SOded Gabbay * 4697d25cae7SOded Gabbay * Used in the "busy_engines_mask" field in `struct hl_info_hw_idle' 4707d25cae7SOded Gabbay */ 4717d25cae7SOded Gabbay 4727d25cae7SOded Gabbay enum goya_engine_id { 4737d25cae7SOded Gabbay GOYA_ENGINE_ID_DMA_0 = 0, 4747d25cae7SOded Gabbay GOYA_ENGINE_ID_DMA_1, 4757d25cae7SOded Gabbay GOYA_ENGINE_ID_DMA_2, 4767d25cae7SOded Gabbay GOYA_ENGINE_ID_DMA_3, 4777d25cae7SOded Gabbay GOYA_ENGINE_ID_DMA_4, 4787d25cae7SOded Gabbay GOYA_ENGINE_ID_MME_0, 4797d25cae7SOded Gabbay GOYA_ENGINE_ID_TPC_0, 4807d25cae7SOded Gabbay GOYA_ENGINE_ID_TPC_1, 4817d25cae7SOded Gabbay GOYA_ENGINE_ID_TPC_2, 4827d25cae7SOded Gabbay GOYA_ENGINE_ID_TPC_3, 4837d25cae7SOded Gabbay GOYA_ENGINE_ID_TPC_4, 4847d25cae7SOded Gabbay GOYA_ENGINE_ID_TPC_5, 4857d25cae7SOded Gabbay GOYA_ENGINE_ID_TPC_6, 4867d25cae7SOded Gabbay GOYA_ENGINE_ID_TPC_7, 4877d25cae7SOded Gabbay GOYA_ENGINE_ID_SIZE 4887d25cae7SOded Gabbay }; 4897d25cae7SOded Gabbay 4907d25cae7SOded Gabbay enum gaudi_engine_id { 4917d25cae7SOded Gabbay GAUDI_ENGINE_ID_DMA_0 = 0, 4927d25cae7SOded Gabbay GAUDI_ENGINE_ID_DMA_1, 4937d25cae7SOded Gabbay GAUDI_ENGINE_ID_DMA_2, 4947d25cae7SOded Gabbay GAUDI_ENGINE_ID_DMA_3, 4957d25cae7SOded Gabbay GAUDI_ENGINE_ID_DMA_4, 4967d25cae7SOded Gabbay GAUDI_ENGINE_ID_DMA_5, 4977d25cae7SOded Gabbay GAUDI_ENGINE_ID_DMA_6, 4987d25cae7SOded Gabbay GAUDI_ENGINE_ID_DMA_7, 4997d25cae7SOded Gabbay GAUDI_ENGINE_ID_MME_0, 5007d25cae7SOded Gabbay GAUDI_ENGINE_ID_MME_1, 5017d25cae7SOded Gabbay GAUDI_ENGINE_ID_MME_2, 5027d25cae7SOded Gabbay GAUDI_ENGINE_ID_MME_3, 5037d25cae7SOded Gabbay GAUDI_ENGINE_ID_TPC_0, 5047d25cae7SOded Gabbay GAUDI_ENGINE_ID_TPC_1, 5057d25cae7SOded Gabbay GAUDI_ENGINE_ID_TPC_2, 5067d25cae7SOded Gabbay GAUDI_ENGINE_ID_TPC_3, 5077d25cae7SOded Gabbay GAUDI_ENGINE_ID_TPC_4, 5087d25cae7SOded Gabbay GAUDI_ENGINE_ID_TPC_5, 5097d25cae7SOded Gabbay GAUDI_ENGINE_ID_TPC_6, 5107d25cae7SOded Gabbay GAUDI_ENGINE_ID_TPC_7, 5117d25cae7SOded Gabbay GAUDI_ENGINE_ID_NIC_0, 5127d25cae7SOded Gabbay GAUDI_ENGINE_ID_NIC_1, 5137d25cae7SOded Gabbay GAUDI_ENGINE_ID_NIC_2, 5147d25cae7SOded Gabbay GAUDI_ENGINE_ID_NIC_3, 5157d25cae7SOded Gabbay GAUDI_ENGINE_ID_NIC_4, 5167d25cae7SOded Gabbay GAUDI_ENGINE_ID_NIC_5, 5177d25cae7SOded Gabbay GAUDI_ENGINE_ID_NIC_6, 5187d25cae7SOded Gabbay GAUDI_ENGINE_ID_NIC_7, 5197d25cae7SOded Gabbay GAUDI_ENGINE_ID_NIC_8, 5207d25cae7SOded Gabbay GAUDI_ENGINE_ID_NIC_9, 5217d25cae7SOded Gabbay GAUDI_ENGINE_ID_SIZE 5227d25cae7SOded Gabbay }; 5237d25cae7SOded Gabbay 5247d25cae7SOded Gabbay enum gaudi2_engine_id { 5257d25cae7SOded Gabbay GAUDI2_DCORE0_ENGINE_ID_EDMA_0 = 0, 5267d25cae7SOded Gabbay GAUDI2_DCORE0_ENGINE_ID_EDMA_1, 5277d25cae7SOded Gabbay GAUDI2_DCORE0_ENGINE_ID_MME, 5287d25cae7SOded Gabbay GAUDI2_DCORE0_ENGINE_ID_TPC_0, 5297d25cae7SOded Gabbay GAUDI2_DCORE0_ENGINE_ID_TPC_1, 5307d25cae7SOded Gabbay GAUDI2_DCORE0_ENGINE_ID_TPC_2, 5317d25cae7SOded Gabbay GAUDI2_DCORE0_ENGINE_ID_TPC_3, 5327d25cae7SOded Gabbay GAUDI2_DCORE0_ENGINE_ID_TPC_4, 5337d25cae7SOded Gabbay GAUDI2_DCORE0_ENGINE_ID_TPC_5, 5347d25cae7SOded Gabbay GAUDI2_DCORE0_ENGINE_ID_DEC_0, 5357d25cae7SOded Gabbay GAUDI2_DCORE0_ENGINE_ID_DEC_1, 5367d25cae7SOded Gabbay GAUDI2_DCORE1_ENGINE_ID_EDMA_0, 5377d25cae7SOded Gabbay GAUDI2_DCORE1_ENGINE_ID_EDMA_1, 5387d25cae7SOded Gabbay GAUDI2_DCORE1_ENGINE_ID_MME, 5397d25cae7SOded Gabbay GAUDI2_DCORE1_ENGINE_ID_TPC_0, 5407d25cae7SOded Gabbay GAUDI2_DCORE1_ENGINE_ID_TPC_1, 5417d25cae7SOded Gabbay GAUDI2_DCORE1_ENGINE_ID_TPC_2, 5427d25cae7SOded Gabbay GAUDI2_DCORE1_ENGINE_ID_TPC_3, 5437d25cae7SOded Gabbay GAUDI2_DCORE1_ENGINE_ID_TPC_4, 5447d25cae7SOded Gabbay GAUDI2_DCORE1_ENGINE_ID_TPC_5, 5457d25cae7SOded Gabbay GAUDI2_DCORE1_ENGINE_ID_DEC_0, 5467d25cae7SOded Gabbay GAUDI2_DCORE1_ENGINE_ID_DEC_1, 5477d25cae7SOded Gabbay GAUDI2_DCORE2_ENGINE_ID_EDMA_0, 5487d25cae7SOded Gabbay GAUDI2_DCORE2_ENGINE_ID_EDMA_1, 5497d25cae7SOded Gabbay GAUDI2_DCORE2_ENGINE_ID_MME, 5507d25cae7SOded Gabbay GAUDI2_DCORE2_ENGINE_ID_TPC_0, 5517d25cae7SOded Gabbay GAUDI2_DCORE2_ENGINE_ID_TPC_1, 5527d25cae7SOded Gabbay GAUDI2_DCORE2_ENGINE_ID_TPC_2, 5537d25cae7SOded Gabbay GAUDI2_DCORE2_ENGINE_ID_TPC_3, 5547d25cae7SOded Gabbay GAUDI2_DCORE2_ENGINE_ID_TPC_4, 5557d25cae7SOded Gabbay GAUDI2_DCORE2_ENGINE_ID_TPC_5, 5567d25cae7SOded Gabbay GAUDI2_DCORE2_ENGINE_ID_DEC_0, 5577d25cae7SOded Gabbay GAUDI2_DCORE2_ENGINE_ID_DEC_1, 5587d25cae7SOded Gabbay GAUDI2_DCORE3_ENGINE_ID_EDMA_0, 5597d25cae7SOded Gabbay GAUDI2_DCORE3_ENGINE_ID_EDMA_1, 5607d25cae7SOded Gabbay GAUDI2_DCORE3_ENGINE_ID_MME, 5617d25cae7SOded Gabbay GAUDI2_DCORE3_ENGINE_ID_TPC_0, 5627d25cae7SOded Gabbay GAUDI2_DCORE3_ENGINE_ID_TPC_1, 5637d25cae7SOded Gabbay GAUDI2_DCORE3_ENGINE_ID_TPC_2, 5647d25cae7SOded Gabbay GAUDI2_DCORE3_ENGINE_ID_TPC_3, 5657d25cae7SOded Gabbay GAUDI2_DCORE3_ENGINE_ID_TPC_4, 5667d25cae7SOded Gabbay GAUDI2_DCORE3_ENGINE_ID_TPC_5, 5677d25cae7SOded Gabbay GAUDI2_DCORE3_ENGINE_ID_DEC_0, 5687d25cae7SOded Gabbay GAUDI2_DCORE3_ENGINE_ID_DEC_1, 5697d25cae7SOded Gabbay GAUDI2_DCORE0_ENGINE_ID_TPC_6, 5707d25cae7SOded Gabbay GAUDI2_ENGINE_ID_PDMA_0, 5717d25cae7SOded Gabbay GAUDI2_ENGINE_ID_PDMA_1, 5727d25cae7SOded Gabbay GAUDI2_ENGINE_ID_ROT_0, 5737d25cae7SOded Gabbay GAUDI2_ENGINE_ID_ROT_1, 5747d25cae7SOded Gabbay GAUDI2_PCIE_ENGINE_ID_DEC_0, 5757d25cae7SOded Gabbay GAUDI2_PCIE_ENGINE_ID_DEC_1, 5767d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC0_0, 5777d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC0_1, 5787d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC1_0, 5797d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC1_1, 5807d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC2_0, 5817d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC2_1, 5827d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC3_0, 5837d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC3_1, 5847d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC4_0, 5857d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC4_1, 5867d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC5_0, 5877d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC5_1, 5887d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC6_0, 5897d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC6_1, 5907d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC7_0, 5917d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC7_1, 5927d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC8_0, 5937d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC8_1, 5947d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC9_0, 5957d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC9_1, 5967d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC10_0, 5977d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC10_1, 5987d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC11_0, 5997d25cae7SOded Gabbay GAUDI2_ENGINE_ID_NIC11_1, 6007d25cae7SOded Gabbay GAUDI2_ENGINE_ID_PCIE, 6017d25cae7SOded Gabbay GAUDI2_ENGINE_ID_PSOC, 6027d25cae7SOded Gabbay GAUDI2_ENGINE_ID_ARC_FARM, 6037d25cae7SOded Gabbay GAUDI2_ENGINE_ID_KDMA, 6047d25cae7SOded Gabbay GAUDI2_ENGINE_ID_SIZE 6057d25cae7SOded Gabbay }; 6067d25cae7SOded Gabbay 6077d25cae7SOded Gabbay /* 6087d25cae7SOded Gabbay * ASIC specific PLL index 6097d25cae7SOded Gabbay * 6107d25cae7SOded Gabbay * Used to retrieve in frequency info of different IPs via 6117d25cae7SOded Gabbay * HL_INFO_PLL_FREQUENCY under HL_IOCTL_INFO IOCTL. The enums need to be 6127d25cae7SOded Gabbay * used as an index in struct hl_pll_frequency_info 6137d25cae7SOded Gabbay */ 6147d25cae7SOded Gabbay 6157d25cae7SOded Gabbay enum hl_goya_pll_index { 6167d25cae7SOded Gabbay HL_GOYA_CPU_PLL = 0, 6177d25cae7SOded Gabbay HL_GOYA_IC_PLL, 6187d25cae7SOded Gabbay HL_GOYA_MC_PLL, 6197d25cae7SOded Gabbay HL_GOYA_MME_PLL, 6207d25cae7SOded Gabbay HL_GOYA_PCI_PLL, 6217d25cae7SOded Gabbay HL_GOYA_EMMC_PLL, 6227d25cae7SOded Gabbay HL_GOYA_TPC_PLL, 6237d25cae7SOded Gabbay HL_GOYA_PLL_MAX 6247d25cae7SOded Gabbay }; 6257d25cae7SOded Gabbay 6267d25cae7SOded Gabbay enum hl_gaudi_pll_index { 6277d25cae7SOded Gabbay HL_GAUDI_CPU_PLL = 0, 6287d25cae7SOded Gabbay HL_GAUDI_PCI_PLL, 6297d25cae7SOded Gabbay HL_GAUDI_SRAM_PLL, 6307d25cae7SOded Gabbay HL_GAUDI_HBM_PLL, 6317d25cae7SOded Gabbay HL_GAUDI_NIC_PLL, 6327d25cae7SOded Gabbay HL_GAUDI_DMA_PLL, 6337d25cae7SOded Gabbay HL_GAUDI_MESH_PLL, 6347d25cae7SOded Gabbay HL_GAUDI_MME_PLL, 6357d25cae7SOded Gabbay HL_GAUDI_TPC_PLL, 6367d25cae7SOded Gabbay HL_GAUDI_IF_PLL, 6377d25cae7SOded Gabbay HL_GAUDI_PLL_MAX 6387d25cae7SOded Gabbay }; 6397d25cae7SOded Gabbay 6407d25cae7SOded Gabbay enum hl_gaudi2_pll_index { 6417d25cae7SOded Gabbay HL_GAUDI2_CPU_PLL = 0, 6427d25cae7SOded Gabbay HL_GAUDI2_PCI_PLL, 6437d25cae7SOded Gabbay HL_GAUDI2_SRAM_PLL, 6447d25cae7SOded Gabbay HL_GAUDI2_HBM_PLL, 6457d25cae7SOded Gabbay HL_GAUDI2_NIC_PLL, 6467d25cae7SOded Gabbay HL_GAUDI2_DMA_PLL, 6477d25cae7SOded Gabbay HL_GAUDI2_MESH_PLL, 6487d25cae7SOded Gabbay HL_GAUDI2_MME_PLL, 6497d25cae7SOded Gabbay HL_GAUDI2_TPC_PLL, 6507d25cae7SOded Gabbay HL_GAUDI2_IF_PLL, 6517d25cae7SOded Gabbay HL_GAUDI2_VID_PLL, 6527d25cae7SOded Gabbay HL_GAUDI2_MSS_PLL, 6537d25cae7SOded Gabbay HL_GAUDI2_PLL_MAX 6547d25cae7SOded Gabbay }; 6557d25cae7SOded Gabbay 6567d25cae7SOded Gabbay /** 6577d25cae7SOded Gabbay * enum hl_goya_dma_direction - Direction of DMA operation inside a LIN_DMA packet that is 6587d25cae7SOded Gabbay * submitted to the GOYA's DMA QMAN. This attribute is not relevant 6597d25cae7SOded Gabbay * to the H/W but the kernel driver use it to parse the packet's 6607d25cae7SOded Gabbay * addresses and patch/validate them. 6617d25cae7SOded Gabbay * @HL_DMA_HOST_TO_DRAM: DMA operation from Host memory to GOYA's DDR. 6627d25cae7SOded Gabbay * @HL_DMA_HOST_TO_SRAM: DMA operation from Host memory to GOYA's SRAM. 6637d25cae7SOded Gabbay * @HL_DMA_DRAM_TO_SRAM: DMA operation from GOYA's DDR to GOYA's SRAM. 6647d25cae7SOded Gabbay * @HL_DMA_SRAM_TO_DRAM: DMA operation from GOYA's SRAM to GOYA's DDR. 6657d25cae7SOded Gabbay * @HL_DMA_SRAM_TO_HOST: DMA operation from GOYA's SRAM to Host memory. 6667d25cae7SOded Gabbay * @HL_DMA_DRAM_TO_HOST: DMA operation from GOYA's DDR to Host memory. 6677d25cae7SOded Gabbay * @HL_DMA_DRAM_TO_DRAM: DMA operation from GOYA's DDR to GOYA's DDR. 6687d25cae7SOded Gabbay * @HL_DMA_SRAM_TO_SRAM: DMA operation from GOYA's SRAM to GOYA's SRAM. 6697d25cae7SOded Gabbay * @HL_DMA_ENUM_MAX: number of values in enum 6707d25cae7SOded Gabbay */ 6717d25cae7SOded Gabbay enum hl_goya_dma_direction { 6727d25cae7SOded Gabbay HL_DMA_HOST_TO_DRAM, 6737d25cae7SOded Gabbay HL_DMA_HOST_TO_SRAM, 6747d25cae7SOded Gabbay HL_DMA_DRAM_TO_SRAM, 6757d25cae7SOded Gabbay HL_DMA_SRAM_TO_DRAM, 6767d25cae7SOded Gabbay HL_DMA_SRAM_TO_HOST, 6777d25cae7SOded Gabbay HL_DMA_DRAM_TO_HOST, 6787d25cae7SOded Gabbay HL_DMA_DRAM_TO_DRAM, 6797d25cae7SOded Gabbay HL_DMA_SRAM_TO_SRAM, 6807d25cae7SOded Gabbay HL_DMA_ENUM_MAX 6817d25cae7SOded Gabbay }; 6827d25cae7SOded Gabbay 6837d25cae7SOded Gabbay /** 6847d25cae7SOded Gabbay * enum hl_device_status - Device status information. 6857d25cae7SOded Gabbay * @HL_DEVICE_STATUS_OPERATIONAL: Device is operational. 6867d25cae7SOded Gabbay * @HL_DEVICE_STATUS_IN_RESET: Device is currently during reset. 6877d25cae7SOded Gabbay * @HL_DEVICE_STATUS_MALFUNCTION: Device is unusable. 6887d25cae7SOded Gabbay * @HL_DEVICE_STATUS_NEEDS_RESET: Device needs reset because auto reset was disabled. 6897d25cae7SOded Gabbay * @HL_DEVICE_STATUS_IN_DEVICE_CREATION: Device is operational but its creation is still in 6907d25cae7SOded Gabbay * progress. 6917d25cae7SOded Gabbay * @HL_DEVICE_STATUS_IN_RESET_AFTER_DEVICE_RELEASE: Device is currently during reset that was 6927d25cae7SOded Gabbay * triggered because the user released the device 6937d25cae7SOded Gabbay * @HL_DEVICE_STATUS_LAST: Last status. 6947d25cae7SOded Gabbay */ 6957d25cae7SOded Gabbay enum hl_device_status { 6967d25cae7SOded Gabbay HL_DEVICE_STATUS_OPERATIONAL, 6977d25cae7SOded Gabbay HL_DEVICE_STATUS_IN_RESET, 6987d25cae7SOded Gabbay HL_DEVICE_STATUS_MALFUNCTION, 6997d25cae7SOded Gabbay HL_DEVICE_STATUS_NEEDS_RESET, 7007d25cae7SOded Gabbay HL_DEVICE_STATUS_IN_DEVICE_CREATION, 7017d25cae7SOded Gabbay HL_DEVICE_STATUS_IN_RESET_AFTER_DEVICE_RELEASE, 7027d25cae7SOded Gabbay HL_DEVICE_STATUS_LAST = HL_DEVICE_STATUS_IN_RESET_AFTER_DEVICE_RELEASE 7037d25cae7SOded Gabbay }; 7047d25cae7SOded Gabbay 7057d25cae7SOded Gabbay enum hl_server_type { 7067d25cae7SOded Gabbay HL_SERVER_TYPE_UNKNOWN = 0, 7077d25cae7SOded Gabbay HL_SERVER_GAUDI_HLS1 = 1, 7087d25cae7SOded Gabbay HL_SERVER_GAUDI_HLS1H = 2, 7097d25cae7SOded Gabbay HL_SERVER_GAUDI_TYPE1 = 3, 7107d25cae7SOded Gabbay HL_SERVER_GAUDI_TYPE2 = 4, 711*a25c2f7aSOded Gabbay HL_SERVER_GAUDI2_HLS2 = 5, 712*a25c2f7aSOded Gabbay HL_SERVER_GAUDI2_TYPE1 = 7 7137d25cae7SOded Gabbay }; 7147d25cae7SOded Gabbay 7157d25cae7SOded Gabbay /* 7167d25cae7SOded Gabbay * Notifier event values - for the notification mechanism and the HL_INFO_GET_EVENTS command 7177d25cae7SOded Gabbay * 7187d25cae7SOded Gabbay * HL_NOTIFIER_EVENT_TPC_ASSERT - Indicates TPC assert event 7197d25cae7SOded Gabbay * HL_NOTIFIER_EVENT_UNDEFINED_OPCODE - Indicates undefined operation code 7207d25cae7SOded Gabbay * HL_NOTIFIER_EVENT_DEVICE_RESET - Indicates device requires a reset 7217d25cae7SOded Gabbay * HL_NOTIFIER_EVENT_CS_TIMEOUT - Indicates CS timeout error 7227d25cae7SOded Gabbay * HL_NOTIFIER_EVENT_DEVICE_UNAVAILABLE - Indicates device is unavailable 7237d25cae7SOded Gabbay * HL_NOTIFIER_EVENT_USER_ENGINE_ERR - Indicates device engine in error state 7247d25cae7SOded Gabbay * HL_NOTIFIER_EVENT_GENERAL_HW_ERR - Indicates device HW error 7257d25cae7SOded Gabbay * HL_NOTIFIER_EVENT_RAZWI - Indicates razwi happened 7267d25cae7SOded Gabbay * HL_NOTIFIER_EVENT_PAGE_FAULT - Indicates page fault happened 727313e9f63SMoti Haimovski * HL_NOTIFIER_EVENT_CRITICAL_HW_ERR - Indicates a HW error that requires SW abort and 728313e9f63SMoti Haimovski * HW reset 729313e9f63SMoti Haimovski * HL_NOTIFIER_EVENT_CRITICAL_FW_ERR - Indicates a FW error that requires SW abort and 730313e9f63SMoti Haimovski * HW reset 7317d25cae7SOded Gabbay */ 7327d25cae7SOded Gabbay #define HL_NOTIFIER_EVENT_TPC_ASSERT (1ULL << 0) 7337d25cae7SOded Gabbay #define HL_NOTIFIER_EVENT_UNDEFINED_OPCODE (1ULL << 1) 7347d25cae7SOded Gabbay #define HL_NOTIFIER_EVENT_DEVICE_RESET (1ULL << 2) 7357d25cae7SOded Gabbay #define HL_NOTIFIER_EVENT_CS_TIMEOUT (1ULL << 3) 7367d25cae7SOded Gabbay #define HL_NOTIFIER_EVENT_DEVICE_UNAVAILABLE (1ULL << 4) 7377d25cae7SOded Gabbay #define HL_NOTIFIER_EVENT_USER_ENGINE_ERR (1ULL << 5) 7387d25cae7SOded Gabbay #define HL_NOTIFIER_EVENT_GENERAL_HW_ERR (1ULL << 6) 7397d25cae7SOded Gabbay #define HL_NOTIFIER_EVENT_RAZWI (1ULL << 7) 7407d25cae7SOded Gabbay #define HL_NOTIFIER_EVENT_PAGE_FAULT (1ULL << 8) 741313e9f63SMoti Haimovski #define HL_NOTIFIER_EVENT_CRITICL_HW_ERR (1ULL << 9) 742313e9f63SMoti Haimovski #define HL_NOTIFIER_EVENT_CRITICL_FW_ERR (1ULL << 10) 7437d25cae7SOded Gabbay 7447d25cae7SOded Gabbay /* Opcode for management ioctl 7457d25cae7SOded Gabbay * 7467d25cae7SOded Gabbay * HW_IP_INFO - Receive information about different IP blocks in the 7477d25cae7SOded Gabbay * device. 7487d25cae7SOded Gabbay * HL_INFO_HW_EVENTS - Receive an array describing how many times each event 7497d25cae7SOded Gabbay * occurred since the last hard reset. 7507d25cae7SOded Gabbay * HL_INFO_DRAM_USAGE - Retrieve the dram usage inside the device and of the 7517d25cae7SOded Gabbay * specific context. This is relevant only for devices 7527d25cae7SOded Gabbay * where the dram is managed by the kernel driver 7537d25cae7SOded Gabbay * HL_INFO_HW_IDLE - Retrieve information about the idle status of each 7547d25cae7SOded Gabbay * internal engine. 7557d25cae7SOded Gabbay * HL_INFO_DEVICE_STATUS - Retrieve the device's status. This opcode doesn't 7567d25cae7SOded Gabbay * require an open context. 7577d25cae7SOded Gabbay * HL_INFO_DEVICE_UTILIZATION - Retrieve the total utilization of the device 7587d25cae7SOded Gabbay * over the last period specified by the user. 7597d25cae7SOded Gabbay * The period can be between 100ms to 1s, in 7607d25cae7SOded Gabbay * resolution of 100ms. The return value is a 7617d25cae7SOded Gabbay * percentage of the utilization rate. 7627d25cae7SOded Gabbay * HL_INFO_HW_EVENTS_AGGREGATE - Receive an array describing how many times each 7637d25cae7SOded Gabbay * event occurred since the driver was loaded. 7647d25cae7SOded Gabbay * HL_INFO_CLK_RATE - Retrieve the current and maximum clock rate 7657d25cae7SOded Gabbay * of the device in MHz. The maximum clock rate is 7667d25cae7SOded Gabbay * configurable via sysfs parameter 7677d25cae7SOded Gabbay * HL_INFO_RESET_COUNT - Retrieve the counts of the soft and hard reset 7687d25cae7SOded Gabbay * operations performed on the device since the last 7697d25cae7SOded Gabbay * time the driver was loaded. 7707d25cae7SOded Gabbay * HL_INFO_TIME_SYNC - Retrieve the device's time alongside the host's time 7717d25cae7SOded Gabbay * for synchronization. 7727d25cae7SOded Gabbay * HL_INFO_CS_COUNTERS - Retrieve command submission counters 7737d25cae7SOded Gabbay * HL_INFO_PCI_COUNTERS - Retrieve PCI counters 7747d25cae7SOded Gabbay * HL_INFO_CLK_THROTTLE_REASON - Retrieve clock throttling reason 7757d25cae7SOded Gabbay * HL_INFO_SYNC_MANAGER - Retrieve sync manager info per dcore 7767d25cae7SOded Gabbay * HL_INFO_TOTAL_ENERGY - Retrieve total energy consumption 7777d25cae7SOded Gabbay * HL_INFO_PLL_FREQUENCY - Retrieve PLL frequency 7787d25cae7SOded Gabbay * HL_INFO_POWER - Retrieve power information 7797d25cae7SOded Gabbay * HL_INFO_OPEN_STATS - Retrieve info regarding recent device open calls 7807d25cae7SOded Gabbay * HL_INFO_DRAM_REPLACED_ROWS - Retrieve DRAM replaced rows info 7817d25cae7SOded Gabbay * HL_INFO_DRAM_PENDING_ROWS - Retrieve DRAM pending rows num 7827d25cae7SOded Gabbay * HL_INFO_LAST_ERR_OPEN_DEV_TIME - Retrieve timestamp of the last time the device was opened 7837d25cae7SOded Gabbay * and CS timeout or razwi error occurred. 7847d25cae7SOded Gabbay * HL_INFO_CS_TIMEOUT_EVENT - Retrieve CS timeout timestamp and its related CS sequence number. 7857d25cae7SOded Gabbay * HL_INFO_RAZWI_EVENT - Retrieve parameters of razwi: 7867d25cae7SOded Gabbay * Timestamp of razwi. 7877d25cae7SOded Gabbay * The address which accessing it caused the razwi. 7887d25cae7SOded Gabbay * Razwi initiator. 7897d25cae7SOded Gabbay * Razwi cause, was it a page fault or MMU access error. 7907d25cae7SOded Gabbay * May return 0 even though no new data is available, in that case 7917d25cae7SOded Gabbay * timestamp will be 0. 7927d25cae7SOded Gabbay * HL_INFO_DEV_MEM_ALLOC_PAGE_SIZES - Retrieve valid page sizes for device memory allocation 7937d25cae7SOded Gabbay * HL_INFO_SECURED_ATTESTATION - Retrieve attestation report of the boot. 7947d25cae7SOded Gabbay * HL_INFO_REGISTER_EVENTFD - Register eventfd for event notifications. 7957d25cae7SOded Gabbay * HL_INFO_UNREGISTER_EVENTFD - Unregister eventfd 7967d25cae7SOded Gabbay * HL_INFO_GET_EVENTS - Retrieve the last occurred events 7977d25cae7SOded Gabbay * HL_INFO_UNDEFINED_OPCODE_EVENT - Retrieve last undefined opcode error information. 7987d25cae7SOded Gabbay * May return 0 even though no new data is available, in that case 7997d25cae7SOded Gabbay * timestamp will be 0. 800313e9f63SMoti Haimovski * HL_INFO_ENGINE_STATUS - Retrieve the status of all the h/w engines in the asic. 801313e9f63SMoti Haimovski * HL_INFO_PAGE_FAULT_EVENT - Retrieve parameters of captured page fault. 8027d25cae7SOded Gabbay * May return 0 even though no new data is available, in that case 8037d25cae7SOded Gabbay * timestamp will be 0. 8047d25cae7SOded Gabbay * HL_INFO_USER_MAPPINGS - Retrieve user mappings, captured after page fault event. 8057d25cae7SOded Gabbay * HL_INFO_FW_GENERIC_REQ - Send generic request to FW. 8067d25cae7SOded Gabbay * HL_INFO_HW_ERR_EVENT - Retrieve information on the reported HW error. 8077d25cae7SOded Gabbay * May return 0 even though no new data is available, in that case 8087d25cae7SOded Gabbay * timestamp will be 0. 8097d25cae7SOded Gabbay * HL_INFO_FW_ERR_EVENT - Retrieve information on the reported FW error. 8107d25cae7SOded Gabbay * May return 0 even though no new data is available, in that case 8117d25cae7SOded Gabbay * timestamp will be 0. 8127d25cae7SOded Gabbay */ 8137d25cae7SOded Gabbay #define HL_INFO_HW_IP_INFO 0 8147d25cae7SOded Gabbay #define HL_INFO_HW_EVENTS 1 8157d25cae7SOded Gabbay #define HL_INFO_DRAM_USAGE 2 8167d25cae7SOded Gabbay #define HL_INFO_HW_IDLE 3 8177d25cae7SOded Gabbay #define HL_INFO_DEVICE_STATUS 4 8187d25cae7SOded Gabbay #define HL_INFO_DEVICE_UTILIZATION 6 8197d25cae7SOded Gabbay #define HL_INFO_HW_EVENTS_AGGREGATE 7 8207d25cae7SOded Gabbay #define HL_INFO_CLK_RATE 8 8217d25cae7SOded Gabbay #define HL_INFO_RESET_COUNT 9 8227d25cae7SOded Gabbay #define HL_INFO_TIME_SYNC 10 8237d25cae7SOded Gabbay #define HL_INFO_CS_COUNTERS 11 8247d25cae7SOded Gabbay #define HL_INFO_PCI_COUNTERS 12 8257d25cae7SOded Gabbay #define HL_INFO_CLK_THROTTLE_REASON 13 8267d25cae7SOded Gabbay #define HL_INFO_SYNC_MANAGER 14 8277d25cae7SOded Gabbay #define HL_INFO_TOTAL_ENERGY 15 8287d25cae7SOded Gabbay #define HL_INFO_PLL_FREQUENCY 16 8297d25cae7SOded Gabbay #define HL_INFO_POWER 17 8307d25cae7SOded Gabbay #define HL_INFO_OPEN_STATS 18 8317d25cae7SOded Gabbay #define HL_INFO_DRAM_REPLACED_ROWS 21 8327d25cae7SOded Gabbay #define HL_INFO_DRAM_PENDING_ROWS 22 8337d25cae7SOded Gabbay #define HL_INFO_LAST_ERR_OPEN_DEV_TIME 23 8347d25cae7SOded Gabbay #define HL_INFO_CS_TIMEOUT_EVENT 24 8357d25cae7SOded Gabbay #define HL_INFO_RAZWI_EVENT 25 836313e9f63SMoti Haimovski #define HL_INFO_DEV_MEM_ALLOC_PAGE_SIZES 26 837313e9f63SMoti Haimovski #define HL_INFO_SECURED_ATTESTATION 27 8387d25cae7SOded Gabbay #define HL_INFO_REGISTER_EVENTFD 28 8397d25cae7SOded Gabbay #define HL_INFO_UNREGISTER_EVENTFD 29 8407d25cae7SOded Gabbay #define HL_INFO_GET_EVENTS 30 8417d25cae7SOded Gabbay #define HL_INFO_UNDEFINED_OPCODE_EVENT 31 8427d25cae7SOded Gabbay #define HL_INFO_ENGINE_STATUS 32 8437d25cae7SOded Gabbay #define HL_INFO_PAGE_FAULT_EVENT 33 8447d25cae7SOded Gabbay #define HL_INFO_USER_MAPPINGS 34 8457d25cae7SOded Gabbay #define HL_INFO_FW_GENERIC_REQ 35 8467d25cae7SOded Gabbay #define HL_INFO_HW_ERR_EVENT 36 8477d25cae7SOded Gabbay #define HL_INFO_FW_ERR_EVENT 37 8487d25cae7SOded Gabbay 8497d25cae7SOded Gabbay #define HL_INFO_VERSION_MAX_LEN 128 8507d25cae7SOded Gabbay #define HL_INFO_CARD_NAME_MAX_LEN 16 8517d25cae7SOded Gabbay 8527d25cae7SOded Gabbay /* Maximum buffer size for retrieving engines status */ 8537d25cae7SOded Gabbay #define HL_ENGINES_DATA_MAX_SIZE SZ_1M 8547d25cae7SOded Gabbay 8557d25cae7SOded Gabbay /** 8567d25cae7SOded Gabbay * struct hl_info_hw_ip_info - hardware information on various IPs in the ASIC 8577d25cae7SOded Gabbay * @sram_base_address: The first SRAM physical base address that is free to be 8587d25cae7SOded Gabbay * used by the user. 8597d25cae7SOded Gabbay * @dram_base_address: The first DRAM virtual or physical base address that is 8607d25cae7SOded Gabbay * free to be used by the user. 8617d25cae7SOded Gabbay * @dram_size: The DRAM size that is available to the user. 8627d25cae7SOded Gabbay * @sram_size: The SRAM size that is available to the user. 8637d25cae7SOded Gabbay * @num_of_events: The number of events that can be received from the f/w. This 8647d25cae7SOded Gabbay * is needed so the user can what is the size of the h/w events 8657d25cae7SOded Gabbay * array he needs to pass to the kernel when he wants to fetch 8667d25cae7SOded Gabbay * the event counters. 8677d25cae7SOded Gabbay * @device_id: PCI device ID of the ASIC. 8687d25cae7SOded Gabbay * @module_id: Module ID of the ASIC for mezzanine cards in servers 8697d25cae7SOded Gabbay * (From OCP spec). 8707d25cae7SOded Gabbay * @decoder_enabled_mask: Bit-mask that represents which decoders are enabled. 8717d25cae7SOded Gabbay * @first_available_interrupt_id: The first available interrupt ID for the user 8727d25cae7SOded Gabbay * to be used when it works with user interrupts. 8737d25cae7SOded Gabbay * Relevant for Gaudi2 and later. 8747d25cae7SOded Gabbay * @server_type: Server type that the Gaudi ASIC is currently installed in. 8757d25cae7SOded Gabbay * The value is according to enum hl_server_type 8767d25cae7SOded Gabbay * @cpld_version: CPLD version on the board. 8777d25cae7SOded Gabbay * @psoc_pci_pll_nr: PCI PLL NR value. Needed by the profiler in some ASICs. 8787d25cae7SOded Gabbay * @psoc_pci_pll_nf: PCI PLL NF value. Needed by the profiler in some ASICs. 8797d25cae7SOded Gabbay * @psoc_pci_pll_od: PCI PLL OD value. Needed by the profiler in some ASICs. 8807d25cae7SOded Gabbay * @psoc_pci_pll_div_factor: PCI PLL DIV factor value. Needed by the profiler 8817d25cae7SOded Gabbay * in some ASICs. 8827d25cae7SOded Gabbay * @tpc_enabled_mask: Bit-mask that represents which TPCs are enabled. Relevant 8837d25cae7SOded Gabbay * for Goya/Gaudi only. 8847d25cae7SOded Gabbay * @dram_enabled: Whether the DRAM is enabled. 8857d25cae7SOded Gabbay * @security_enabled: Whether security is enabled on device. 8867d25cae7SOded Gabbay * @mme_master_slave_mode: Indicate whether the MME is working in master/slave 8877d25cae7SOded Gabbay * configuration. Relevant for Greco and later. 8887d25cae7SOded Gabbay * @cpucp_version: The CPUCP f/w version. 8894713ace3SOfir Bitton * @card_name: The card name as passed by the f/w. 890958e4797SOfir Bitton * @tpc_enabled_mask_ext: Bit-mask that represents which TPCs are enabled. 891958e4797SOfir Bitton * Relevant for Greco and later. 8927fc0d011SOfir Bitton * @dram_page_size: The DRAM physical page size. 8937fc0d011SOfir Bitton * @edma_enabled_mask: Bit-mask that represents which EDMAs are enabled. 89476e1ff37SOfir Bitton * Relevant for Gaudi2 and later. 8957d25cae7SOded Gabbay * @number_of_user_interrupts: The number of interrupts that are available to the userspace 8967d25cae7SOded Gabbay * application to use. Relevant for Gaudi2 and later. 8977d25cae7SOded Gabbay * @device_mem_alloc_default_page_size: default page size used in device memory allocation. 8987d25cae7SOded Gabbay * @revision_id: PCI revision ID of the ASIC. 8997d25cae7SOded Gabbay * @tpc_interrupt_id: interrupt id for TPC to use in order to raise events towards the host. 9007d25cae7SOded Gabbay * @rotator_enabled_mask: Bit-mask that represents which rotators are enabled. 9017d25cae7SOded Gabbay * Relevant for Gaudi3 and later. 9027d25cae7SOded Gabbay * @engine_core_interrupt_reg_addr: interrupt register address for engine core to use 9037d25cae7SOded Gabbay * in order to raise events toward FW. 9047d25cae7SOded Gabbay * @reserved_dram_size: DRAM size reserved for driver and firmware. 9057d25cae7SOded Gabbay */ 9067d25cae7SOded Gabbay struct hl_info_hw_ip_info { 9077d25cae7SOded Gabbay __u64 sram_base_address; 9087d25cae7SOded Gabbay __u64 dram_base_address; 9097d25cae7SOded Gabbay __u64 dram_size; 9107d25cae7SOded Gabbay __u32 sram_size; 9117d25cae7SOded Gabbay __u32 num_of_events; 9127d25cae7SOded Gabbay __u32 device_id; 9137d25cae7SOded Gabbay __u32 module_id; 9147d25cae7SOded Gabbay __u32 decoder_enabled_mask; 9157d25cae7SOded Gabbay __u16 first_available_interrupt_id; 9167d25cae7SOded Gabbay __u16 server_type; 9177d25cae7SOded Gabbay __u32 cpld_version; 9187d25cae7SOded Gabbay __u32 psoc_pci_pll_nr; 9197d25cae7SOded Gabbay __u32 psoc_pci_pll_nf; 9207d25cae7SOded Gabbay __u32 psoc_pci_pll_od; 9217d25cae7SOded Gabbay __u32 psoc_pci_pll_div_factor; 92260d7bbb5SOded Gabbay __u8 tpc_enabled_mask; 92360d7bbb5SOded Gabbay __u8 dram_enabled; 92460d7bbb5SOded Gabbay __u8 security_enabled; 9257d25cae7SOded Gabbay __u8 mme_master_slave_mode; 92660d7bbb5SOded Gabbay __u8 cpucp_version[HL_INFO_VERSION_MAX_LEN]; 9277d25cae7SOded Gabbay __u8 card_name[HL_INFO_CARD_NAME_MAX_LEN]; 92860d7bbb5SOded Gabbay __u64 tpc_enabled_mask_ext; 92960d7bbb5SOded Gabbay __u64 dram_page_size; 9307d25cae7SOded Gabbay __u32 edma_enabled_mask; 9314713ace3SOfir Bitton __u16 number_of_user_interrupts; 932958e4797SOfir Bitton __u8 reserved1; 9337fc0d011SOfir Bitton __u8 reserved2; 9347fc0d011SOfir Bitton __u64 reserved3; 93576e1ff37SOfir Bitton __u64 device_mem_alloc_default_page_size; 9367d25cae7SOded Gabbay __u64 reserved4; 9377d25cae7SOded Gabbay __u64 reserved5; 9387d25cae7SOded Gabbay __u32 reserved6; 9397d25cae7SOded Gabbay __u8 reserved7; 9407d25cae7SOded Gabbay __u8 revision_id; 9417d25cae7SOded Gabbay __u16 tpc_interrupt_id; 9427d25cae7SOded Gabbay __u32 rotator_enabled_mask; 9437d25cae7SOded Gabbay __u32 reserved9; 9447d25cae7SOded Gabbay __u64 engine_core_interrupt_reg_addr; 9457d25cae7SOded Gabbay __u64 reserved_dram_size; 9467d25cae7SOded Gabbay }; 9477d25cae7SOded Gabbay 9487d25cae7SOded Gabbay struct hl_info_dram_usage { 9497d25cae7SOded Gabbay __u64 dram_free_mem; 9507d25cae7SOded Gabbay __u64 ctx_dram_mem; 9517d25cae7SOded Gabbay }; 9527d25cae7SOded Gabbay 9537d25cae7SOded Gabbay #define HL_BUSY_ENGINES_MASK_EXT_SIZE 4 9547d25cae7SOded Gabbay 9557d25cae7SOded Gabbay struct hl_info_hw_idle { 9567d25cae7SOded Gabbay __u32 is_idle; 9577d25cae7SOded Gabbay /* 9587d25cae7SOded Gabbay * Bitmask of busy engines. 9597d25cae7SOded Gabbay * Bits definition is according to `enum <chip>_engine_id'. 9607d25cae7SOded Gabbay */ 9617d25cae7SOded Gabbay __u32 busy_engines_mask; 9627d25cae7SOded Gabbay 9637d25cae7SOded Gabbay /* 9647d25cae7SOded Gabbay * Extended Bitmask of busy engines. 9657d25cae7SOded Gabbay * Bits definition is according to `enum <chip>_engine_id'. 9667d25cae7SOded Gabbay */ 9677d25cae7SOded Gabbay __u64 busy_engines_mask_ext[HL_BUSY_ENGINES_MASK_EXT_SIZE]; 9687d25cae7SOded Gabbay }; 9697d25cae7SOded Gabbay 9707d25cae7SOded Gabbay struct hl_info_device_status { 9717d25cae7SOded Gabbay __u32 status; 9727d25cae7SOded Gabbay __u32 pad; 9737d25cae7SOded Gabbay }; 9747d25cae7SOded Gabbay 9757d25cae7SOded Gabbay struct hl_info_device_utilization { 9767d25cae7SOded Gabbay __u32 utilization; 9777d25cae7SOded Gabbay __u32 pad; 9787d25cae7SOded Gabbay }; 9797d25cae7SOded Gabbay 9807d25cae7SOded Gabbay struct hl_info_clk_rate { 9817d25cae7SOded Gabbay __u32 cur_clk_rate_mhz; 9827d25cae7SOded Gabbay __u32 max_clk_rate_mhz; 9837d25cae7SOded Gabbay }; 9847d25cae7SOded Gabbay 9857d25cae7SOded Gabbay struct hl_info_reset_count { 9867d25cae7SOded Gabbay __u32 hard_reset_cnt; 9877d25cae7SOded Gabbay __u32 soft_reset_cnt; 9887d25cae7SOded Gabbay }; 9897d25cae7SOded Gabbay 9907d25cae7SOded Gabbay struct hl_info_time_sync { 9917d25cae7SOded Gabbay __u64 device_time; 9927d25cae7SOded Gabbay __u64 host_time; 9937d25cae7SOded Gabbay }; 9947d25cae7SOded Gabbay 9957d25cae7SOded Gabbay /** 9967d25cae7SOded Gabbay * struct hl_info_pci_counters - pci counters 9977d25cae7SOded Gabbay * @rx_throughput: PCI rx throughput KBps 9987d25cae7SOded Gabbay * @tx_throughput: PCI tx throughput KBps 9997d25cae7SOded Gabbay * @replay_cnt: PCI replay counter 10007d25cae7SOded Gabbay */ 10017d25cae7SOded Gabbay struct hl_info_pci_counters { 10027d25cae7SOded Gabbay __u64 rx_throughput; 10037d25cae7SOded Gabbay __u64 tx_throughput; 10047d25cae7SOded Gabbay __u64 replay_cnt; 10057d25cae7SOded Gabbay }; 10067d25cae7SOded Gabbay 10077d25cae7SOded Gabbay enum hl_clk_throttling_type { 10087d25cae7SOded Gabbay HL_CLK_THROTTLE_TYPE_POWER, 10097d25cae7SOded Gabbay HL_CLK_THROTTLE_TYPE_THERMAL, 10107d25cae7SOded Gabbay HL_CLK_THROTTLE_TYPE_MAX 10117d25cae7SOded Gabbay }; 10127d25cae7SOded Gabbay 10137d25cae7SOded Gabbay /* clk_throttling_reason masks */ 10147d25cae7SOded Gabbay #define HL_CLK_THROTTLE_POWER (1 << HL_CLK_THROTTLE_TYPE_POWER) 10157d25cae7SOded Gabbay #define HL_CLK_THROTTLE_THERMAL (1 << HL_CLK_THROTTLE_TYPE_THERMAL) 10167d25cae7SOded Gabbay 10177d25cae7SOded Gabbay /** 10187d25cae7SOded Gabbay * struct hl_info_clk_throttle - clock throttling reason 10197d25cae7SOded Gabbay * @clk_throttling_reason: each bit represents a clk throttling reason 10207d25cae7SOded Gabbay * @clk_throttling_timestamp_us: represents CPU timestamp in microseconds of the start-event 10217d25cae7SOded Gabbay * @clk_throttling_duration_ns: the clock throttle time in nanosec 10227d25cae7SOded Gabbay */ 10237d25cae7SOded Gabbay struct hl_info_clk_throttle { 10247d25cae7SOded Gabbay __u32 clk_throttling_reason; 10257d25cae7SOded Gabbay __u32 pad; 10267d25cae7SOded Gabbay __u64 clk_throttling_timestamp_us[HL_CLK_THROTTLE_TYPE_MAX]; 10277d25cae7SOded Gabbay __u64 clk_throttling_duration_ns[HL_CLK_THROTTLE_TYPE_MAX]; 10287d25cae7SOded Gabbay }; 10297d25cae7SOded Gabbay 10307d25cae7SOded Gabbay /** 10317d25cae7SOded Gabbay * struct hl_info_energy - device energy information 10327d25cae7SOded Gabbay * @total_energy_consumption: total device energy consumption 10337d25cae7SOded Gabbay */ 10347d25cae7SOded Gabbay struct hl_info_energy { 10357d25cae7SOded Gabbay __u64 total_energy_consumption; 10367d25cae7SOded Gabbay }; 10377d25cae7SOded Gabbay 10387d25cae7SOded Gabbay #define HL_PLL_NUM_OUTPUTS 4 10397d25cae7SOded Gabbay 10407d25cae7SOded Gabbay struct hl_pll_frequency_info { 10417d25cae7SOded Gabbay __u16 output[HL_PLL_NUM_OUTPUTS]; 10427d25cae7SOded Gabbay }; 10437d25cae7SOded Gabbay 10447d25cae7SOded Gabbay /** 10457d25cae7SOded Gabbay * struct hl_open_stats_info - device open statistics information 10467d25cae7SOded Gabbay * @open_counter: ever growing counter, increased on each successful dev open 10477d25cae7SOded Gabbay * @last_open_period_ms: duration (ms) device was open last time 10487d25cae7SOded Gabbay * @is_compute_ctx_active: Whether there is an active compute context executing 10497d25cae7SOded Gabbay * @compute_ctx_in_release: true if the current compute context is being released 10507d25cae7SOded Gabbay */ 10517d25cae7SOded Gabbay struct hl_open_stats_info { 10527d25cae7SOded Gabbay __u64 open_counter; 10537d25cae7SOded Gabbay __u64 last_open_period_ms; 10547d25cae7SOded Gabbay __u8 is_compute_ctx_active; 10557d25cae7SOded Gabbay __u8 compute_ctx_in_release; 10567d25cae7SOded Gabbay __u8 pad[6]; 10577d25cae7SOded Gabbay }; 10587d25cae7SOded Gabbay 10597d25cae7SOded Gabbay /** 10607d25cae7SOded Gabbay * struct hl_power_info - power information 10617d25cae7SOded Gabbay * @power: power consumption 10627d25cae7SOded Gabbay */ 10637d25cae7SOded Gabbay struct hl_power_info { 10647d25cae7SOded Gabbay __u64 power; 10657d25cae7SOded Gabbay }; 10667d25cae7SOded Gabbay 10677d25cae7SOded Gabbay /** 10687d25cae7SOded Gabbay * struct hl_info_sync_manager - sync manager information 10697d25cae7SOded Gabbay * @first_available_sync_object: first available sob 10707d25cae7SOded Gabbay * @first_available_monitor: first available monitor 10717d25cae7SOded Gabbay * @first_available_cq: first available cq 10727d25cae7SOded Gabbay */ 10737d25cae7SOded Gabbay struct hl_info_sync_manager { 10747d25cae7SOded Gabbay __u32 first_available_sync_object; 10757d25cae7SOded Gabbay __u32 first_available_monitor; 10767d25cae7SOded Gabbay __u32 first_available_cq; 10777d25cae7SOded Gabbay __u32 reserved; 10787d25cae7SOded Gabbay }; 10797d25cae7SOded Gabbay 10807d25cae7SOded Gabbay /** 10817d25cae7SOded Gabbay * struct hl_info_cs_counters - command submission counters 10827d25cae7SOded Gabbay * @total_out_of_mem_drop_cnt: total dropped due to memory allocation issue 10837d25cae7SOded Gabbay * @ctx_out_of_mem_drop_cnt: context dropped due to memory allocation issue 10847d25cae7SOded Gabbay * @total_parsing_drop_cnt: total dropped due to error in packet parsing 10857d25cae7SOded Gabbay * @ctx_parsing_drop_cnt: context dropped due to error in packet parsing 10867d25cae7SOded Gabbay * @total_queue_full_drop_cnt: total dropped due to queue full 10877d25cae7SOded Gabbay * @ctx_queue_full_drop_cnt: context dropped due to queue full 10887d25cae7SOded Gabbay * @total_device_in_reset_drop_cnt: total dropped due to device in reset 10897d25cae7SOded Gabbay * @ctx_device_in_reset_drop_cnt: context dropped due to device in reset 10907d25cae7SOded Gabbay * @total_max_cs_in_flight_drop_cnt: total dropped due to maximum CS in-flight 10917d25cae7SOded Gabbay * @ctx_max_cs_in_flight_drop_cnt: context dropped due to maximum CS in-flight 10927d25cae7SOded Gabbay * @total_validation_drop_cnt: total dropped due to validation error 10937d25cae7SOded Gabbay * @ctx_validation_drop_cnt: context dropped due to validation error 10947d25cae7SOded Gabbay */ 10957d25cae7SOded Gabbay struct hl_info_cs_counters { 10967d25cae7SOded Gabbay __u64 total_out_of_mem_drop_cnt; 10977d25cae7SOded Gabbay __u64 ctx_out_of_mem_drop_cnt; 10987d25cae7SOded Gabbay __u64 total_parsing_drop_cnt; 10997d25cae7SOded Gabbay __u64 ctx_parsing_drop_cnt; 11007d25cae7SOded Gabbay __u64 total_queue_full_drop_cnt; 11017d25cae7SOded Gabbay __u64 ctx_queue_full_drop_cnt; 11027d25cae7SOded Gabbay __u64 total_device_in_reset_drop_cnt; 11037d25cae7SOded Gabbay __u64 ctx_device_in_reset_drop_cnt; 11047d25cae7SOded Gabbay __u64 total_max_cs_in_flight_drop_cnt; 11057d25cae7SOded Gabbay __u64 ctx_max_cs_in_flight_drop_cnt; 11067d25cae7SOded Gabbay __u64 total_validation_drop_cnt; 11077d25cae7SOded Gabbay __u64 ctx_validation_drop_cnt; 11087d25cae7SOded Gabbay }; 11097d25cae7SOded Gabbay 11107d25cae7SOded Gabbay /** 11117d25cae7SOded Gabbay * struct hl_info_last_err_open_dev_time - last error boot information. 11127d25cae7SOded Gabbay * @timestamp: timestamp of last time the device was opened and error occurred. 11137d25cae7SOded Gabbay */ 11147d25cae7SOded Gabbay struct hl_info_last_err_open_dev_time { 11157d25cae7SOded Gabbay __s64 timestamp; 11167d25cae7SOded Gabbay }; 11177d25cae7SOded Gabbay 11187d25cae7SOded Gabbay /** 11197d25cae7SOded Gabbay * struct hl_info_cs_timeout_event - last CS timeout information. 11207d25cae7SOded Gabbay * @timestamp: timestamp when last CS timeout event occurred. 11217d25cae7SOded Gabbay * @seq: sequence number of last CS timeout event. 11227d25cae7SOded Gabbay */ 11237d25cae7SOded Gabbay struct hl_info_cs_timeout_event { 11247d25cae7SOded Gabbay __s64 timestamp; 11257d25cae7SOded Gabbay __u64 seq; 11267d25cae7SOded Gabbay }; 11277d25cae7SOded Gabbay 11287d25cae7SOded Gabbay #define HL_RAZWI_NA_ENG_ID U16_MAX 11297d25cae7SOded Gabbay #define HL_RAZWI_MAX_NUM_OF_ENGINES_PER_RTR 128 11307d25cae7SOded Gabbay #define HL_RAZWI_READ BIT(0) 11317d25cae7SOded Gabbay #define HL_RAZWI_WRITE BIT(1) 11327d25cae7SOded Gabbay #define HL_RAZWI_LBW BIT(2) 11337d25cae7SOded Gabbay #define HL_RAZWI_HBW BIT(3) 11347d25cae7SOded Gabbay #define HL_RAZWI_RR BIT(4) 11357d25cae7SOded Gabbay #define HL_RAZWI_ADDR_DEC BIT(5) 11367d25cae7SOded Gabbay 11377d25cae7SOded Gabbay /** 11387d25cae7SOded Gabbay * struct hl_info_razwi_event - razwi information. 11397d25cae7SOded Gabbay * @timestamp: timestamp of razwi. 11407d25cae7SOded Gabbay * @addr: address which accessing it caused razwi. 11417d25cae7SOded Gabbay * @engine_id: engine id of the razwi initiator, if it was initiated by engine that does not 11427d25cae7SOded Gabbay * have engine id it will be set to HL_RAZWI_NA_ENG_ID. If there are several possible 11437d25cae7SOded Gabbay * engines which caused the razwi, it will hold all of them. 11447d25cae7SOded Gabbay * @num_of_possible_engines: contains number of possible engine ids. In some asics, razwi indication 11457d25cae7SOded Gabbay * might be common for several engines and there is no way to get the 11467d25cae7SOded Gabbay * exact engine. In this way, engine_id array will be filled with all 11477d25cae7SOded Gabbay * possible engines caused this razwi. Also, there might be possibility 11487d25cae7SOded Gabbay * in gaudi, where we don't indication on specific engine, in that case 11497d25cae7SOded Gabbay * the value of this parameter will be zero. 11507d25cae7SOded Gabbay * @flags: bitmask for additional data: HL_RAZWI_READ - razwi caused by read operation 11517d25cae7SOded Gabbay * HL_RAZWI_WRITE - razwi caused by write operation 11527d25cae7SOded Gabbay * HL_RAZWI_LBW - razwi caused by lbw fabric transaction 11537d25cae7SOded Gabbay * HL_RAZWI_HBW - razwi caused by hbw fabric transaction 11547d25cae7SOded Gabbay * HL_RAZWI_RR - razwi caused by range register 11557d25cae7SOded Gabbay * HL_RAZWI_ADDR_DEC - razwi caused by address decode error 11567d25cae7SOded Gabbay * Note: this data is not supported by all asics, in that case the relevant bits will not 11577d25cae7SOded Gabbay * be set. 11587d25cae7SOded Gabbay */ 11597d25cae7SOded Gabbay struct hl_info_razwi_event { 11607d25cae7SOded Gabbay __s64 timestamp; 11617d25cae7SOded Gabbay __u64 addr; 11627d25cae7SOded Gabbay __u16 engine_id[HL_RAZWI_MAX_NUM_OF_ENGINES_PER_RTR]; 11637d25cae7SOded Gabbay __u16 num_of_possible_engines; 11647d25cae7SOded Gabbay __u8 flags; 11657d25cae7SOded Gabbay __u8 pad[5]; 11667d25cae7SOded Gabbay }; 11677d25cae7SOded Gabbay 11687d25cae7SOded Gabbay #define MAX_QMAN_STREAMS_INFO 4 11697d25cae7SOded Gabbay #define OPCODE_INFO_MAX_ADDR_SIZE 8 11707d25cae7SOded Gabbay /** 11717d25cae7SOded Gabbay * struct hl_info_undefined_opcode_event - info about last undefined opcode error 11727d25cae7SOded Gabbay * @timestamp: timestamp of the undefined opcode error 11737d25cae7SOded Gabbay * @cb_addr_streams: CB addresses (per stream) that are currently exists in the PQ 11747d25cae7SOded Gabbay * entries. In case all streams array entries are 11757d25cae7SOded Gabbay * filled with values, it means the execution was in Lower-CP. 11767d25cae7SOded Gabbay * @cq_addr: the address of the current handled command buffer 11777d25cae7SOded Gabbay * @cq_size: the size of the current handled command buffer 11787d25cae7SOded Gabbay * @cb_addr_streams_len: num of streams - actual len of cb_addr_streams array. 11797d25cae7SOded Gabbay * should be equal to 1 in case of undefined opcode 11807d25cae7SOded Gabbay * in Upper-CP (specific stream) and equal to 4 incase 11817d25cae7SOded Gabbay * of undefined opcode in Lower-CP. 11827d25cae7SOded Gabbay * @engine_id: engine-id that the error occurred on 11837d25cae7SOded Gabbay * @stream_id: the stream id the error occurred on. In case the stream equals to 11847d25cae7SOded Gabbay * MAX_QMAN_STREAMS_INFO it means the error occurred on a Lower-CP. 11857d25cae7SOded Gabbay */ 11867d25cae7SOded Gabbay struct hl_info_undefined_opcode_event { 1187313e9f63SMoti Haimovski __s64 timestamp; 1188313e9f63SMoti Haimovski __u64 cb_addr_streams[MAX_QMAN_STREAMS_INFO][OPCODE_INFO_MAX_ADDR_SIZE]; 1189313e9f63SMoti Haimovski __u64 cq_addr; 1190313e9f63SMoti Haimovski __u32 cq_size; 1191313e9f63SMoti Haimovski __u32 cb_addr_streams_len; 1192313e9f63SMoti Haimovski __u32 engine_id; 1193313e9f63SMoti Haimovski __u32 stream_id; 1194313e9f63SMoti Haimovski }; 1195313e9f63SMoti Haimovski 1196313e9f63SMoti Haimovski /** 1197313e9f63SMoti Haimovski * struct hl_info_hw_err_event - info about HW error 1198313e9f63SMoti Haimovski * @timestamp: timestamp of error occurrence 1199313e9f63SMoti Haimovski * @event_id: The async event ID (specific to each device type). 1200313e9f63SMoti Haimovski * @pad: size padding for u64 granularity. 1201313e9f63SMoti Haimovski */ 1202313e9f63SMoti Haimovski struct hl_info_hw_err_event { 1203313e9f63SMoti Haimovski __s64 timestamp; 1204313e9f63SMoti Haimovski __u16 event_id; 1205313e9f63SMoti Haimovski __u16 pad[3]; 1206313e9f63SMoti Haimovski }; 1207313e9f63SMoti Haimovski 1208313e9f63SMoti Haimovski /* FW error definition for event_type in struct hl_info_fw_err_event */ 1209313e9f63SMoti Haimovski enum hl_info_fw_err_type { 1210313e9f63SMoti Haimovski HL_INFO_FW_HEARTBEAT_ERR, 1211313e9f63SMoti Haimovski HL_INFO_FW_REPORTED_ERR, 1212313e9f63SMoti Haimovski }; 1213313e9f63SMoti Haimovski 1214313e9f63SMoti Haimovski /** 1215313e9f63SMoti Haimovski * struct hl_info_fw_err_event - info about FW error 1216313e9f63SMoti Haimovski * @timestamp: time-stamp of error occurrence 1217313e9f63SMoti Haimovski * @err_type: The type of event as defined in hl_info_fw_err_type. 1218313e9f63SMoti Haimovski * @event_id: The async event ID (specific to each device type, applicable only when event type is 1219313e9f63SMoti Haimovski * HL_INFO_FW_REPORTED_ERR). 12207d25cae7SOded Gabbay * @pad: size padding for u64 granularity. 12217d25cae7SOded Gabbay */ 12227d25cae7SOded Gabbay struct hl_info_fw_err_event { 12237d25cae7SOded Gabbay __s64 timestamp; 12247d25cae7SOded Gabbay __u16 err_type; 12257d25cae7SOded Gabbay __u16 event_id; 12267d25cae7SOded Gabbay __u32 pad; 12277d25cae7SOded Gabbay }; 12287d25cae7SOded Gabbay 12297d25cae7SOded Gabbay /** 12307d25cae7SOded Gabbay * struct hl_info_dev_memalloc_page_sizes - valid page sizes in device mem alloc information. 12317d25cae7SOded Gabbay * @page_order_bitmask: bitmap in which a set bit represents the order of the supported page size 12327d25cae7SOded Gabbay * (e.g. 0x2100000 means that 1MB and 32MB pages are supported). 12337d25cae7SOded Gabbay */ 12347d25cae7SOded Gabbay struct hl_info_dev_memalloc_page_sizes { 12357d25cae7SOded Gabbay __u64 page_order_bitmask; 12367d25cae7SOded Gabbay }; 12377d25cae7SOded Gabbay 12387d25cae7SOded Gabbay #define SEC_PCR_DATA_BUF_SZ 256 12397d25cae7SOded Gabbay #define SEC_PCR_QUOTE_BUF_SZ 510 /* (512 - 2) 2 bytes used for size */ 12407d25cae7SOded Gabbay #define SEC_SIGNATURE_BUF_SZ 255 /* (256 - 1) 1 byte used for size */ 12417d25cae7SOded Gabbay #define SEC_PUB_DATA_BUF_SZ 510 /* (512 - 2) 2 bytes used for size */ 12427d25cae7SOded Gabbay #define SEC_CERTIFICATE_BUF_SZ 2046 /* (2048 - 2) 2 bytes used for size */ 12437d25cae7SOded Gabbay 12447d25cae7SOded Gabbay /* 12457d25cae7SOded Gabbay * struct hl_info_sec_attest - attestation report of the boot 12467d25cae7SOded Gabbay * @nonce: number only used once. random number provided by host. this also passed to the quote 12477d25cae7SOded Gabbay * command as a qualifying data. 12487d25cae7SOded Gabbay * @pcr_quote_len: length of the attestation quote data (bytes) 12497d25cae7SOded Gabbay * @pub_data_len: length of the public data (bytes) 12507d25cae7SOded Gabbay * @certificate_len: length of the certificate (bytes) 12517d25cae7SOded Gabbay * @pcr_num_reg: number of PCR registers in the pcr_data array 12527d25cae7SOded Gabbay * @pcr_reg_len: length of each PCR register in the pcr_data array (bytes) 12537d25cae7SOded Gabbay * @quote_sig_len: length of the attestation report signature (bytes) 12547d25cae7SOded Gabbay * @pcr_data: raw values of the PCR registers 12557d25cae7SOded Gabbay * @pcr_quote: attestation report data structure 12567d25cae7SOded Gabbay * @quote_sig: signature structure of the attestation report 12577d25cae7SOded Gabbay * @public_data: public key for the signed attestation 12587d25cae7SOded Gabbay * (outPublic + name + qualifiedName) 12597d25cae7SOded Gabbay * @certificate: certificate for the attestation signing key 12607d25cae7SOded Gabbay */ 12617d25cae7SOded Gabbay struct hl_info_sec_attest { 12627d25cae7SOded Gabbay __u32 nonce; 12637d25cae7SOded Gabbay __u16 pcr_quote_len; 12647d25cae7SOded Gabbay __u16 pub_data_len; 12657d25cae7SOded Gabbay __u16 certificate_len; 12667d25cae7SOded Gabbay __u8 pcr_num_reg; 12677d25cae7SOded Gabbay __u8 pcr_reg_len; 12687d25cae7SOded Gabbay __u8 quote_sig_len; 12697d25cae7SOded Gabbay __u8 pcr_data[SEC_PCR_DATA_BUF_SZ]; 12707d25cae7SOded Gabbay __u8 pcr_quote[SEC_PCR_QUOTE_BUF_SZ]; 12717d25cae7SOded Gabbay __u8 quote_sig[SEC_SIGNATURE_BUF_SZ]; 12727d25cae7SOded Gabbay __u8 public_data[SEC_PUB_DATA_BUF_SZ]; 12737d25cae7SOded Gabbay __u8 certificate[SEC_CERTIFICATE_BUF_SZ]; 12747d25cae7SOded Gabbay __u8 pad0[2]; 12757d25cae7SOded Gabbay }; 12767d25cae7SOded Gabbay 12777d25cae7SOded Gabbay /** 12787d25cae7SOded Gabbay * struct hl_page_fault_info - page fault information. 12797d25cae7SOded Gabbay * @timestamp: timestamp of page fault. 12807d25cae7SOded Gabbay * @addr: address which accessing it caused page fault. 12817d25cae7SOded Gabbay * @engine_id: engine id which caused the page fault, supported only in gaudi3. 12827d25cae7SOded Gabbay */ 12837d25cae7SOded Gabbay struct hl_page_fault_info { 12847d25cae7SOded Gabbay __s64 timestamp; 12857d25cae7SOded Gabbay __u64 addr; 12867d25cae7SOded Gabbay __u16 engine_id; 12877d25cae7SOded Gabbay __u8 pad[6]; 12887d25cae7SOded Gabbay }; 12897d25cae7SOded Gabbay 12907d25cae7SOded Gabbay /** 12917d25cae7SOded Gabbay * struct hl_user_mapping - user mapping information. 12927d25cae7SOded Gabbay * @dev_va: device virtual address. 12937d25cae7SOded Gabbay * @size: virtual address mapping size. 12947d25cae7SOded Gabbay */ 12957d25cae7SOded Gabbay struct hl_user_mapping { 12967d25cae7SOded Gabbay __u64 dev_va; 12977d25cae7SOded Gabbay __u64 size; 12987d25cae7SOded Gabbay }; 12997d25cae7SOded Gabbay 13007d25cae7SOded Gabbay enum gaudi_dcores { 13017d25cae7SOded Gabbay HL_GAUDI_WS_DCORE, 13027d25cae7SOded Gabbay HL_GAUDI_WN_DCORE, 13037d25cae7SOded Gabbay HL_GAUDI_EN_DCORE, 13047d25cae7SOded Gabbay HL_GAUDI_ES_DCORE 13057d25cae7SOded Gabbay }; 13067d25cae7SOded Gabbay 13077d25cae7SOded Gabbay /** 13087d25cae7SOded Gabbay * struct hl_info_args - Main structure to retrieve device related information. 13097d25cae7SOded Gabbay * @return_pointer: User space address of the relevant structure related to HL_INFO_* operation 13107d25cae7SOded Gabbay * mentioned in @op. 13117d25cae7SOded Gabbay * @return_size: Size of the structure used in @return_pointer, just like "size" in "snprintf", it 13127d25cae7SOded Gabbay * limits how many bytes the kernel can write. For hw_events array, the size should be 13137d25cae7SOded Gabbay * hl_info_hw_ip_info.num_of_events * sizeof(__u32). 13147d25cae7SOded Gabbay * @op: Defines which type of information to be retrieved. Refer HL_INFO_* for details. 13157d25cae7SOded Gabbay * @dcore_id: DCORE id for which the information is relevant (for Gaudi refer to enum gaudi_dcores). 13167d25cae7SOded Gabbay * @ctx_id: Context ID of the user. Currently not in use. 13177d25cae7SOded Gabbay * @period_ms: Period value, in milliseconds, for utilization rate in range 100ms - 1000ms in 100 ms 13187d25cae7SOded Gabbay * resolution. Currently not in use. 13197d25cae7SOded Gabbay * @pll_index: Index as defined in hl_<asic type>_pll_index enumeration. 13207d25cae7SOded Gabbay * @eventfd: event file descriptor for event notifications. 13217d25cae7SOded Gabbay * @user_buffer_actual_size: Actual data size which was copied to user allocated buffer by the 13227d25cae7SOded Gabbay * driver. It is possible for the user to allocate buffer larger than 13237d25cae7SOded Gabbay * needed, hence updating this variable so user will know the exact amount 13247d25cae7SOded Gabbay * of bytes copied by the kernel to the buffer. 13257d25cae7SOded Gabbay * @sec_attest_nonce: Nonce number used for attestation report. 13267d25cae7SOded Gabbay * @array_size: Number of array members copied to user buffer. 13277d25cae7SOded Gabbay * Relevant for HL_INFO_USER_MAPPINGS info ioctl. 13287d25cae7SOded Gabbay * @fw_sub_opcode: generic requests sub opcodes. 13297d25cae7SOded Gabbay * @pad: Padding to 64 bit. 13307d25cae7SOded Gabbay */ 13317d25cae7SOded Gabbay struct hl_info_args { 13327d25cae7SOded Gabbay __u64 return_pointer; 13337d25cae7SOded Gabbay __u32 return_size; 13347d25cae7SOded Gabbay __u32 op; 13357d25cae7SOded Gabbay 13367d25cae7SOded Gabbay union { 13377d25cae7SOded Gabbay __u32 dcore_id; 13387d25cae7SOded Gabbay __u32 ctx_id; 13397d25cae7SOded Gabbay __u32 period_ms; 13407d25cae7SOded Gabbay __u32 pll_index; 13417d25cae7SOded Gabbay __u32 eventfd; 13427d25cae7SOded Gabbay __u32 user_buffer_actual_size; 13437d25cae7SOded Gabbay __u32 sec_attest_nonce; 13447d25cae7SOded Gabbay __u32 array_size; 13457d25cae7SOded Gabbay __u32 fw_sub_opcode; 13467d25cae7SOded Gabbay }; 13477d25cae7SOded Gabbay 13487d25cae7SOded Gabbay __u32 pad; 13497d25cae7SOded Gabbay }; 13507d25cae7SOded Gabbay 13517d25cae7SOded Gabbay /* Opcode to create a new command buffer */ 13527d25cae7SOded Gabbay #define HL_CB_OP_CREATE 0 13537d25cae7SOded Gabbay /* Opcode to destroy previously created command buffer */ 13547d25cae7SOded Gabbay #define HL_CB_OP_DESTROY 1 13557d25cae7SOded Gabbay /* Opcode to retrieve information about a command buffer */ 13567d25cae7SOded Gabbay #define HL_CB_OP_INFO 2 13577d25cae7SOded Gabbay 13587d25cae7SOded Gabbay /* 2MB minus 32 bytes for 2xMSG_PROT */ 13597d25cae7SOded Gabbay #define HL_MAX_CB_SIZE (0x200000 - 32) 13607d25cae7SOded Gabbay 13617d25cae7SOded Gabbay /* Indicates whether the command buffer should be mapped to the device's MMU */ 13627d25cae7SOded Gabbay #define HL_CB_FLAGS_MAP 0x1 13637d25cae7SOded Gabbay 13647d25cae7SOded Gabbay /* Used with HL_CB_OP_INFO opcode to get the device va address for kernel mapped CB */ 13657d25cae7SOded Gabbay #define HL_CB_FLAGS_GET_DEVICE_VA 0x2 13667d25cae7SOded Gabbay 13677d25cae7SOded Gabbay struct hl_cb_in { 13687d25cae7SOded Gabbay /* Handle of CB or 0 if we want to create one */ 13697d25cae7SOded Gabbay __u64 cb_handle; 13707d25cae7SOded Gabbay /* HL_CB_OP_* */ 13717d25cae7SOded Gabbay __u32 op; 13727d25cae7SOded Gabbay 13737d25cae7SOded Gabbay /* Size of CB. Maximum size is HL_MAX_CB_SIZE. The minimum size that 13747d25cae7SOded Gabbay * will be allocated, regardless of this parameter's value, is PAGE_SIZE 13757d25cae7SOded Gabbay */ 13767d25cae7SOded Gabbay __u32 cb_size; 13777d25cae7SOded Gabbay 13787d25cae7SOded Gabbay /* Context ID - Currently not in use */ 13797d25cae7SOded Gabbay __u32 ctx_id; 13807d25cae7SOded Gabbay /* HL_CB_FLAGS_* */ 13817d25cae7SOded Gabbay __u32 flags; 13827d25cae7SOded Gabbay }; 13837d25cae7SOded Gabbay 13847d25cae7SOded Gabbay struct hl_cb_out { 13857d25cae7SOded Gabbay union { 13867d25cae7SOded Gabbay /* Handle of CB */ 13877d25cae7SOded Gabbay __u64 cb_handle; 13887d25cae7SOded Gabbay 13897d25cae7SOded Gabbay union { 13907d25cae7SOded Gabbay /* Information about CB */ 13917d25cae7SOded Gabbay struct { 13927d25cae7SOded Gabbay /* Usage count of CB */ 13937d25cae7SOded Gabbay __u32 usage_cnt; 13947d25cae7SOded Gabbay __u32 pad; 13957d25cae7SOded Gabbay }; 13967d25cae7SOded Gabbay 13977d25cae7SOded Gabbay /* CB mapped address to device MMU */ 13987d25cae7SOded Gabbay __u64 device_va; 13997d25cae7SOded Gabbay }; 14007d25cae7SOded Gabbay }; 14017d25cae7SOded Gabbay }; 14027d25cae7SOded Gabbay 14037d25cae7SOded Gabbay union hl_cb_args { 14047d25cae7SOded Gabbay struct hl_cb_in in; 14057d25cae7SOded Gabbay struct hl_cb_out out; 14067d25cae7SOded Gabbay }; 14077d25cae7SOded Gabbay 14087d25cae7SOded Gabbay /* HL_CS_CHUNK_FLAGS_ values 14097d25cae7SOded Gabbay * 14107d25cae7SOded Gabbay * HL_CS_CHUNK_FLAGS_USER_ALLOC_CB: 14117d25cae7SOded Gabbay * Indicates if the CB was allocated and mapped by userspace 14127d25cae7SOded Gabbay * (relevant to greco and above). User allocated CB is a command buffer, 14137d25cae7SOded Gabbay * allocated by the user, via malloc (or similar). After allocating the 14147d25cae7SOded Gabbay * CB, the user invokes - “memory ioctl” to map the user memory into a 14157d25cae7SOded Gabbay * device virtual address. The user provides this address via the 14167d25cae7SOded Gabbay * cb_handle field. The interface provides the ability to create a 14177d25cae7SOded Gabbay * large CBs, Which aren’t limited to “HL_MAX_CB_SIZE”. Therefore, it 14187d25cae7SOded Gabbay * increases the PCI-DMA queues throughput. This CB allocation method 14197d25cae7SOded Gabbay * also reduces the use of Linux DMA-able memory pool. Which are limited 14207d25cae7SOded Gabbay * and used by other Linux sub-systems. 14217d25cae7SOded Gabbay */ 14227d25cae7SOded Gabbay #define HL_CS_CHUNK_FLAGS_USER_ALLOC_CB 0x1 14237d25cae7SOded Gabbay 14247d25cae7SOded Gabbay /* 14257d25cae7SOded Gabbay * This structure size must always be fixed to 64-bytes for backward 14267d25cae7SOded Gabbay * compatibility 14277d25cae7SOded Gabbay */ 14287d25cae7SOded Gabbay struct hl_cs_chunk { 14297d25cae7SOded Gabbay union { 14307d25cae7SOded Gabbay /* Goya/Gaudi: 14317d25cae7SOded Gabbay * For external queue, this represents a Handle of CB on the 14327d25cae7SOded Gabbay * Host. 14337d25cae7SOded Gabbay * For internal queue in Goya, this represents an SRAM or 14347d25cae7SOded Gabbay * a DRAM address of the internal CB. In Gaudi, this might also 14357d25cae7SOded Gabbay * represent a mapped host address of the CB. 14367d25cae7SOded Gabbay * 14377d25cae7SOded Gabbay * Greco onwards: 14387d25cae7SOded Gabbay * For H/W queue, this represents either a Handle of CB on the 14397d25cae7SOded Gabbay * Host, or an SRAM, a DRAM, or a mapped host address of the CB. 14407d25cae7SOded Gabbay * 14417d25cae7SOded Gabbay * A mapped host address is in the device address space, after 14427d25cae7SOded Gabbay * a host address was mapped by the device MMU. 14437d25cae7SOded Gabbay */ 14447d25cae7SOded Gabbay __u64 cb_handle; 14457d25cae7SOded Gabbay 14467d25cae7SOded Gabbay /* Relevant only when HL_CS_FLAGS_WAIT or 14477d25cae7SOded Gabbay * HL_CS_FLAGS_COLLECTIVE_WAIT is set 14487d25cae7SOded Gabbay * This holds address of array of u64 values that contain 14497d25cae7SOded Gabbay * signal CS sequence numbers. The wait described by 14507d25cae7SOded Gabbay * this job will listen on all those signals 14517d25cae7SOded Gabbay * (wait event per signal) 14527d25cae7SOded Gabbay */ 14537d25cae7SOded Gabbay __u64 signal_seq_arr; 14547d25cae7SOded Gabbay 14557d25cae7SOded Gabbay /* 14567d25cae7SOded Gabbay * Relevant only when HL_CS_FLAGS_WAIT or 14577d25cae7SOded Gabbay * HL_CS_FLAGS_COLLECTIVE_WAIT is set 14587d25cae7SOded Gabbay * along with HL_CS_FLAGS_ENCAP_SIGNALS. 14597d25cae7SOded Gabbay * This is the CS sequence which has the encapsulated signals. 14607d25cae7SOded Gabbay */ 14617d25cae7SOded Gabbay __u64 encaps_signal_seq; 14627d25cae7SOded Gabbay }; 14637d25cae7SOded Gabbay 14647d25cae7SOded Gabbay /* Index of queue to put the CB on */ 14657d25cae7SOded Gabbay __u32 queue_index; 14667d25cae7SOded Gabbay 14677d25cae7SOded Gabbay union { 14687d25cae7SOded Gabbay /* 14697d25cae7SOded Gabbay * Size of command buffer with valid packets 14707d25cae7SOded Gabbay * Can be smaller then actual CB size 14717d25cae7SOded Gabbay */ 14727d25cae7SOded Gabbay __u32 cb_size; 14737d25cae7SOded Gabbay 14747d25cae7SOded Gabbay /* Relevant only when HL_CS_FLAGS_WAIT or 14757d25cae7SOded Gabbay * HL_CS_FLAGS_COLLECTIVE_WAIT is set. 14767d25cae7SOded Gabbay * Number of entries in signal_seq_arr 14777d25cae7SOded Gabbay */ 14787d25cae7SOded Gabbay __u32 num_signal_seq_arr; 14797d25cae7SOded Gabbay 14807d25cae7SOded Gabbay /* Relevant only when HL_CS_FLAGS_WAIT or 14817d25cae7SOded Gabbay * HL_CS_FLAGS_COLLECTIVE_WAIT is set along 14827d25cae7SOded Gabbay * with HL_CS_FLAGS_ENCAP_SIGNALS 14837d25cae7SOded Gabbay * This set the signals range that the user want to wait for 14847d25cae7SOded Gabbay * out of the whole reserved signals range. 14857d25cae7SOded Gabbay * e.g if the signals range is 20, and user don't want 14867d25cae7SOded Gabbay * to wait for signal 8, so he set this offset to 7, then 14877d25cae7SOded Gabbay * he call the API again with 9 and so on till 20. 14887d25cae7SOded Gabbay */ 14897d25cae7SOded Gabbay __u32 encaps_signal_offset; 14907d25cae7SOded Gabbay }; 14917d25cae7SOded Gabbay 14927d25cae7SOded Gabbay /* HL_CS_CHUNK_FLAGS_* */ 14937d25cae7SOded Gabbay __u32 cs_chunk_flags; 14947d25cae7SOded Gabbay 14957d25cae7SOded Gabbay /* Relevant only when HL_CS_FLAGS_COLLECTIVE_WAIT is set. 14967d25cae7SOded Gabbay * This holds the collective engine ID. The wait described by this job 14977d25cae7SOded Gabbay * will sync with this engine and with all NICs before completion. 14987d25cae7SOded Gabbay */ 14997d25cae7SOded Gabbay __u32 collective_engine_id; 15007d25cae7SOded Gabbay 15017d25cae7SOded Gabbay /* Align structure to 64 bytes */ 15027d25cae7SOded Gabbay __u32 pad[10]; 15037d25cae7SOded Gabbay }; 15047d25cae7SOded Gabbay 15057d25cae7SOded Gabbay /* SIGNAL/WAIT/COLLECTIVE_WAIT flags are mutually exclusive */ 15067d25cae7SOded Gabbay #define HL_CS_FLAGS_FORCE_RESTORE 0x1 15077d25cae7SOded Gabbay #define HL_CS_FLAGS_SIGNAL 0x2 15087d25cae7SOded Gabbay #define HL_CS_FLAGS_WAIT 0x4 15097d25cae7SOded Gabbay #define HL_CS_FLAGS_COLLECTIVE_WAIT 0x8 15107d25cae7SOded Gabbay 15117d25cae7SOded Gabbay #define HL_CS_FLAGS_TIMESTAMP 0x20 15127d25cae7SOded Gabbay #define HL_CS_FLAGS_STAGED_SUBMISSION 0x40 15137d25cae7SOded Gabbay #define HL_CS_FLAGS_STAGED_SUBMISSION_FIRST 0x80 15147d25cae7SOded Gabbay #define HL_CS_FLAGS_STAGED_SUBMISSION_LAST 0x100 15157d25cae7SOded Gabbay #define HL_CS_FLAGS_CUSTOM_TIMEOUT 0x200 15167d25cae7SOded Gabbay #define HL_CS_FLAGS_SKIP_RESET_ON_TIMEOUT 0x400 15177d25cae7SOded Gabbay 15187d25cae7SOded Gabbay /* 15197d25cae7SOded Gabbay * The encapsulated signals CS is merged into the existing CS ioctls. 15207d25cae7SOded Gabbay * In order to use this feature need to follow the below procedure: 15217d25cae7SOded Gabbay * 1. Reserve signals, set the CS type to HL_CS_FLAGS_RESERVE_SIGNALS_ONLY 15227d25cae7SOded Gabbay * the output of this API will be the SOB offset from CFG_BASE. 15237d25cae7SOded Gabbay * this address will be used to patch CB cmds to do the signaling for this 15247d25cae7SOded Gabbay * SOB by incrementing it's value. 15257d25cae7SOded Gabbay * for reverting the reservation use HL_CS_FLAGS_UNRESERVE_SIGNALS_ONLY 15267d25cae7SOded Gabbay * CS type, note that this might fail if out-of-sync happened to the SOB 15277d25cae7SOded Gabbay * value, in case other signaling request to the same SOB occurred between 15287d25cae7SOded Gabbay * reserve-unreserve calls. 15297d25cae7SOded Gabbay * 2. Use the staged CS to do the encapsulated signaling jobs. 15307d25cae7SOded Gabbay * use HL_CS_FLAGS_STAGED_SUBMISSION and HL_CS_FLAGS_STAGED_SUBMISSION_FIRST 15317d25cae7SOded Gabbay * along with HL_CS_FLAGS_ENCAP_SIGNALS flag, and set encaps_signal_offset 15327d25cae7SOded Gabbay * field. This offset allows app to wait on part of the reserved signals. 15337d25cae7SOded Gabbay * 3. Use WAIT/COLLECTIVE WAIT CS along with HL_CS_FLAGS_ENCAP_SIGNALS flag 15347d25cae7SOded Gabbay * to wait for the encapsulated signals. 15357d25cae7SOded Gabbay */ 153620faaeecSOhad Sharabi #define HL_CS_FLAGS_ENCAP_SIGNALS 0x800 153720faaeecSOhad Sharabi #define HL_CS_FLAGS_RESERVE_SIGNALS_ONLY 0x1000 153820faaeecSOhad Sharabi #define HL_CS_FLAGS_UNRESERVE_SIGNALS_ONLY 0x2000 153920faaeecSOhad Sharabi 154020faaeecSOhad Sharabi /* 154120faaeecSOhad Sharabi * The engine cores CS is merged into the existing CS ioctls. 154220faaeecSOhad Sharabi * Use it to control the engine cores mode. 154320faaeecSOhad Sharabi */ 1544f7f0085eSKoby Elbaz #define HL_CS_FLAGS_ENGINE_CORE_COMMAND 0x4000 1545f7f0085eSKoby Elbaz 1546f7f0085eSKoby Elbaz /* 1547f7f0085eSKoby Elbaz * The flush HBW PCI writes is merged into the existing CS ioctls. 1548f7f0085eSKoby Elbaz * Used to flush all HBW PCI writes. 1549f7f0085eSKoby Elbaz * This is a blocking operation and for this reason the user shall not use 15507d25cae7SOded Gabbay * the return sequence number (which will be invalid anyway) 15517d25cae7SOded Gabbay */ 15527d25cae7SOded Gabbay #define HL_CS_FLAGS_FLUSH_PCI_HBW_WRITES 0x8000 15537d25cae7SOded Gabbay 1554f7f0085eSKoby Elbaz /* 1555f7f0085eSKoby Elbaz * The engines CS is merged into the existing CS ioctls. 15567d25cae7SOded Gabbay * Use it to control engines modes. 1557f7f0085eSKoby Elbaz */ 1558f7f0085eSKoby Elbaz #define HL_CS_FLAGS_ENGINES_COMMAND 0x10000 1559f7f0085eSKoby Elbaz 1560f7f0085eSKoby Elbaz #define HL_CS_STATUS_SUCCESS 0 15617d25cae7SOded Gabbay 1562f7f0085eSKoby Elbaz #define HL_MAX_JOBS_PER_CS 512 1563f7f0085eSKoby Elbaz 1564f7f0085eSKoby Elbaz /* 1565f7f0085eSKoby Elbaz * enum hl_engine_command - engine command 1566f7f0085eSKoby Elbaz * 1567f7f0085eSKoby Elbaz * @HL_ENGINE_CORE_HALT: engine core halt 1568f7f0085eSKoby Elbaz * @HL_ENGINE_CORE_RUN: engine core run 15697d25cae7SOded Gabbay * @HL_ENGINE_STALL: user engine/s stall 15707d25cae7SOded Gabbay * @HL_ENGINE_RESUME: user engine/s resume 15717d25cae7SOded Gabbay */ 15727d25cae7SOded Gabbay enum hl_engine_command { 15737d25cae7SOded Gabbay HL_ENGINE_CORE_HALT = 1, 15747d25cae7SOded Gabbay HL_ENGINE_CORE_RUN = 2, 15757d25cae7SOded Gabbay HL_ENGINE_STALL = 3, 15767d25cae7SOded Gabbay HL_ENGINE_RESUME = 4, 15777d25cae7SOded Gabbay HL_ENGINE_COMMAND_MAX 15787d25cae7SOded Gabbay }; 15797d25cae7SOded Gabbay 15807d25cae7SOded Gabbay struct hl_cs_in { 15817d25cae7SOded Gabbay 15827d25cae7SOded Gabbay union { 15837d25cae7SOded Gabbay struct { 15847d25cae7SOded Gabbay /* this holds address of array of hl_cs_chunk for restore phase */ 15857d25cae7SOded Gabbay __u64 chunks_restore; 15867d25cae7SOded Gabbay 15877d25cae7SOded Gabbay /* holds address of array of hl_cs_chunk for execution phase */ 15887d25cae7SOded Gabbay __u64 chunks_execute; 15897d25cae7SOded Gabbay }; 15907d25cae7SOded Gabbay 15917d25cae7SOded Gabbay /* Valid only when HL_CS_FLAGS_ENGINE_CORE_COMMAND is set */ 1592f7f0085eSKoby Elbaz struct { 1593f7f0085eSKoby Elbaz /* this holds address of array of uint32 for engine_cores */ 1594f7f0085eSKoby Elbaz __u64 engine_cores; 1595f7f0085eSKoby Elbaz 1596f7f0085eSKoby Elbaz /* number of engine cores in engine_cores array */ 1597f7f0085eSKoby Elbaz __u32 num_engine_cores; 1598f7f0085eSKoby Elbaz 1599f7f0085eSKoby Elbaz /* the core command to be sent towards engine cores */ 1600f7f0085eSKoby Elbaz __u32 core_command; 1601f7f0085eSKoby Elbaz }; 1602f7f0085eSKoby Elbaz 1603f7f0085eSKoby Elbaz /* Valid only when HL_CS_FLAGS_ENGINES_COMMAND is set */ 16047d25cae7SOded Gabbay struct { 16057d25cae7SOded Gabbay /* this holds address of array of uint32 for engines */ 16067d25cae7SOded Gabbay __u64 engines; 16077d25cae7SOded Gabbay 16087d25cae7SOded Gabbay /* number of engines in engines array */ 16097d25cae7SOded Gabbay __u32 num_engines; 16107d25cae7SOded Gabbay 16117d25cae7SOded Gabbay /* the engine command to be sent towards engines */ 16127d25cae7SOded Gabbay __u32 engine_command; 16137d25cae7SOded Gabbay }; 16147d25cae7SOded Gabbay }; 16157d25cae7SOded Gabbay 16167d25cae7SOded Gabbay union { 16177d25cae7SOded Gabbay /* 16187d25cae7SOded Gabbay * Sequence number of a staged submission CS 16197d25cae7SOded Gabbay * valid only if HL_CS_FLAGS_STAGED_SUBMISSION is set and 16207d25cae7SOded Gabbay * HL_CS_FLAGS_STAGED_SUBMISSION_FIRST is unset. 16217d25cae7SOded Gabbay */ 16227d25cae7SOded Gabbay __u64 seq; 16237d25cae7SOded Gabbay 16247d25cae7SOded Gabbay /* 16257d25cae7SOded Gabbay * Encapsulated signals handle id 16267d25cae7SOded Gabbay * Valid for two flows: 16277d25cae7SOded Gabbay * 1. CS with encapsulated signals: 16287d25cae7SOded Gabbay * when HL_CS_FLAGS_STAGED_SUBMISSION and 16297d25cae7SOded Gabbay * HL_CS_FLAGS_STAGED_SUBMISSION_FIRST 16307d25cae7SOded Gabbay * and HL_CS_FLAGS_ENCAP_SIGNALS are set. 16317d25cae7SOded Gabbay * 2. unreserve signals: 16327d25cae7SOded Gabbay * valid when HL_CS_FLAGS_UNRESERVE_SIGNALS_ONLY is set. 16337d25cae7SOded Gabbay */ 16347d25cae7SOded Gabbay __u32 encaps_sig_handle_id; 16357d25cae7SOded Gabbay 16367d25cae7SOded Gabbay /* Valid only when HL_CS_FLAGS_RESERVE_SIGNALS_ONLY is set */ 16377d25cae7SOded Gabbay struct { 16387d25cae7SOded Gabbay /* Encapsulated signals number */ 16397d25cae7SOded Gabbay __u32 encaps_signals_count; 16407d25cae7SOded Gabbay 16417d25cae7SOded Gabbay /* Encapsulated signals queue index (stream) */ 16427d25cae7SOded Gabbay __u32 encaps_signals_q_idx; 16437d25cae7SOded Gabbay }; 16447d25cae7SOded Gabbay }; 16457d25cae7SOded Gabbay 16467d25cae7SOded Gabbay /* Number of chunks in restore phase array. Maximum number is 16477d25cae7SOded Gabbay * HL_MAX_JOBS_PER_CS 16487d25cae7SOded Gabbay */ 16497d25cae7SOded Gabbay __u32 num_chunks_restore; 16507d25cae7SOded Gabbay 16517d25cae7SOded Gabbay /* Number of chunks in execution array. Maximum number is 16527d25cae7SOded Gabbay * HL_MAX_JOBS_PER_CS 16537d25cae7SOded Gabbay */ 16547d25cae7SOded Gabbay __u32 num_chunks_execute; 16557d25cae7SOded Gabbay 16567d25cae7SOded Gabbay /* timeout in seconds - valid only if HL_CS_FLAGS_CUSTOM_TIMEOUT 16577d25cae7SOded Gabbay * is set 16587d25cae7SOded Gabbay */ 16597d25cae7SOded Gabbay __u32 timeout; 16607d25cae7SOded Gabbay 16617d25cae7SOded Gabbay /* HL_CS_FLAGS_* */ 16627d25cae7SOded Gabbay __u32 cs_flags; 16637d25cae7SOded Gabbay 16647d25cae7SOded Gabbay /* Context ID - Currently not in use */ 16657d25cae7SOded Gabbay __u32 ctx_id; 16667d25cae7SOded Gabbay __u8 pad[4]; 16677d25cae7SOded Gabbay }; 16687d25cae7SOded Gabbay 16697d25cae7SOded Gabbay struct hl_cs_out { 16707d25cae7SOded Gabbay union { 16717d25cae7SOded Gabbay /* 16727d25cae7SOded Gabbay * seq holds the sequence number of the CS to pass to wait 16737d25cae7SOded Gabbay * ioctl. All values are valid except for 0 and ULLONG_MAX 16747d25cae7SOded Gabbay */ 16757d25cae7SOded Gabbay __u64 seq; 16767d25cae7SOded Gabbay 16777d25cae7SOded Gabbay /* Valid only when HL_CS_FLAGS_RESERVE_SIGNALS_ONLY is set */ 16787d25cae7SOded Gabbay struct { 16797d25cae7SOded Gabbay /* This is the reserved signal handle id */ 16807d25cae7SOded Gabbay __u32 handle_id; 16817d25cae7SOded Gabbay 16827d25cae7SOded Gabbay /* This is the signals count */ 16837d25cae7SOded Gabbay __u32 count; 16847d25cae7SOded Gabbay }; 16857d25cae7SOded Gabbay }; 16867d25cae7SOded Gabbay 16877d25cae7SOded Gabbay /* HL_CS_STATUS */ 16887d25cae7SOded Gabbay __u32 status; 16897d25cae7SOded Gabbay 16907d25cae7SOded Gabbay /* 16917d25cae7SOded Gabbay * SOB base address offset 16927d25cae7SOded Gabbay * Valid only when HL_CS_FLAGS_RESERVE_SIGNALS_ONLY or HL_CS_FLAGS_SIGNAL is set 16937d25cae7SOded Gabbay */ 16947d25cae7SOded Gabbay __u32 sob_base_addr_offset; 16957d25cae7SOded Gabbay 16967d25cae7SOded Gabbay /* 16977d25cae7SOded Gabbay * Count of completed signals in SOB before current signal submission. 16987d25cae7SOded Gabbay * Valid only when (HL_CS_FLAGS_ENCAP_SIGNALS & HL_CS_FLAGS_STAGED_SUBMISSION) 16997d25cae7SOded Gabbay * or HL_CS_FLAGS_SIGNAL is set 17007d25cae7SOded Gabbay */ 17017d25cae7SOded Gabbay __u16 sob_count_before_submission; 17027d25cae7SOded Gabbay __u16 pad[3]; 17037d25cae7SOded Gabbay }; 17047d25cae7SOded Gabbay 17057d25cae7SOded Gabbay union hl_cs_args { 17067d25cae7SOded Gabbay struct hl_cs_in in; 17077d25cae7SOded Gabbay struct hl_cs_out out; 17087d25cae7SOded Gabbay }; 17097d25cae7SOded Gabbay 17107d25cae7SOded Gabbay #define HL_WAIT_CS_FLAGS_INTERRUPT 0x2 17117d25cae7SOded Gabbay #define HL_WAIT_CS_FLAGS_INTERRUPT_MASK 0xFFF00000 17127d25cae7SOded Gabbay #define HL_WAIT_CS_FLAGS_ANY_CQ_INTERRUPT 0xFFF00000 17137d25cae7SOded Gabbay #define HL_WAIT_CS_FLAGS_ANY_DEC_INTERRUPT 0xFFE00000 17147d25cae7SOded Gabbay #define HL_WAIT_CS_FLAGS_MULTI_CS 0x4 17157d25cae7SOded Gabbay #define HL_WAIT_CS_FLAGS_INTERRUPT_KERNEL_CQ 0x10 17167d25cae7SOded Gabbay #define HL_WAIT_CS_FLAGS_REGISTER_INTERRUPT 0x20 17177d25cae7SOded Gabbay 17187d25cae7SOded Gabbay #define HL_WAIT_MULTI_CS_LIST_MAX_LEN 32 17197d25cae7SOded Gabbay 17207d25cae7SOded Gabbay struct hl_wait_cs_in { 17217d25cae7SOded Gabbay union { 17227d25cae7SOded Gabbay struct { 17237d25cae7SOded Gabbay /* 17247d25cae7SOded Gabbay * In case of wait_cs holds the CS sequence number. 17257d25cae7SOded Gabbay * In case of wait for multi CS hold a user pointer to 17267d25cae7SOded Gabbay * an array of CS sequence numbers 17277d25cae7SOded Gabbay */ 17287d25cae7SOded Gabbay __u64 seq; 17297d25cae7SOded Gabbay /* Absolute timeout to wait for command submission 17307d25cae7SOded Gabbay * in microseconds 17317d25cae7SOded Gabbay */ 17327d25cae7SOded Gabbay __u64 timeout_us; 17337d25cae7SOded Gabbay }; 17347d25cae7SOded Gabbay 17357d25cae7SOded Gabbay struct { 17367d25cae7SOded Gabbay union { 17377d25cae7SOded Gabbay /* User address for completion comparison. 17387d25cae7SOded Gabbay * upon interrupt, driver will compare the value pointed 17397d25cae7SOded Gabbay * by this address with the supplied target value. 17407d25cae7SOded Gabbay * in order not to perform any comparison, set address 17417d25cae7SOded Gabbay * to all 1s. 17427d25cae7SOded Gabbay * Relevant only when HL_WAIT_CS_FLAGS_INTERRUPT is set 17437d25cae7SOded Gabbay */ 17447d25cae7SOded Gabbay __u64 addr; 17457d25cae7SOded Gabbay 17467d25cae7SOded Gabbay /* cq_counters_handle to a kernel mapped cb which contains 17477d25cae7SOded Gabbay * cq counters. 17487d25cae7SOded Gabbay * Relevant only when HL_WAIT_CS_FLAGS_INTERRUPT_KERNEL_CQ is set 17497d25cae7SOded Gabbay */ 17507d25cae7SOded Gabbay __u64 cq_counters_handle; 17517d25cae7SOded Gabbay }; 17527d25cae7SOded Gabbay 17537d25cae7SOded Gabbay /* Target value for completion comparison */ 17547d25cae7SOded Gabbay __u64 target; 17557d25cae7SOded Gabbay }; 17567d25cae7SOded Gabbay }; 17577d25cae7SOded Gabbay 17587d25cae7SOded Gabbay /* Context ID - Currently not in use */ 17597d25cae7SOded Gabbay __u32 ctx_id; 17607d25cae7SOded Gabbay 17617d25cae7SOded Gabbay /* HL_WAIT_CS_FLAGS_* 17627d25cae7SOded Gabbay * If HL_WAIT_CS_FLAGS_INTERRUPT is set, this field should include 17637d25cae7SOded Gabbay * interrupt id according to HL_WAIT_CS_FLAGS_INTERRUPT_MASK 17647d25cae7SOded Gabbay * 17657d25cae7SOded Gabbay * in order to wait for any CQ interrupt, set interrupt value to 17667d25cae7SOded Gabbay * HL_WAIT_CS_FLAGS_ANY_CQ_INTERRUPT. 17677d25cae7SOded Gabbay * 17687d25cae7SOded Gabbay * in order to wait for any decoder interrupt, set interrupt value to 17697d25cae7SOded Gabbay * HL_WAIT_CS_FLAGS_ANY_DEC_INTERRUPT. 17707d25cae7SOded Gabbay */ 17717d25cae7SOded Gabbay __u32 flags; 17727d25cae7SOded Gabbay 17737d25cae7SOded Gabbay union { 17747d25cae7SOded Gabbay struct { 17757d25cae7SOded Gabbay /* Multi CS API info- valid entries in multi-CS array */ 17767d25cae7SOded Gabbay __u8 seq_arr_len; 17777d25cae7SOded Gabbay __u8 pad[7]; 17787d25cae7SOded Gabbay }; 17797d25cae7SOded Gabbay 17807d25cae7SOded Gabbay /* Absolute timeout to wait for an interrupt in microseconds. 17817d25cae7SOded Gabbay * Relevant only when HL_WAIT_CS_FLAGS_INTERRUPT is set 17827d25cae7SOded Gabbay */ 17837d25cae7SOded Gabbay __u64 interrupt_timeout_us; 17847d25cae7SOded Gabbay }; 17857d25cae7SOded Gabbay 17867d25cae7SOded Gabbay /* 17877d25cae7SOded Gabbay * cq counter offset inside the counters cb pointed by cq_counters_handle above. 17887d25cae7SOded Gabbay * upon interrupt, driver will compare the value pointed 17897d25cae7SOded Gabbay * by this address (cq_counters_handle + cq_counters_offset) 17907d25cae7SOded Gabbay * with the supplied target value. 17917d25cae7SOded Gabbay * relevant only when HL_WAIT_CS_FLAGS_INTERRUPT_KERNEL_CQ is set 17927d25cae7SOded Gabbay */ 17937d25cae7SOded Gabbay __u64 cq_counters_offset; 17947d25cae7SOded Gabbay 17957d25cae7SOded Gabbay /* 17967d25cae7SOded Gabbay * Timestamp_handle timestamps buffer handle. 17977d25cae7SOded Gabbay * relevant only when HL_WAIT_CS_FLAGS_REGISTER_INTERRUPT is set 17987d25cae7SOded Gabbay */ 17997d25cae7SOded Gabbay __u64 timestamp_handle; 18007d25cae7SOded Gabbay 18017d25cae7SOded Gabbay /* 18027d25cae7SOded Gabbay * Timestamp_offset is offset inside the timestamp buffer pointed by timestamp_handle above. 18037d25cae7SOded Gabbay * upon interrupt, if the cq reached the target value then driver will write 18047d25cae7SOded Gabbay * timestamp to this offset. 18057d25cae7SOded Gabbay * relevant only when HL_WAIT_CS_FLAGS_REGISTER_INTERRUPT is set 18067d25cae7SOded Gabbay */ 18077d25cae7SOded Gabbay __u64 timestamp_offset; 18087d25cae7SOded Gabbay }; 18097d25cae7SOded Gabbay 18107d25cae7SOded Gabbay #define HL_WAIT_CS_STATUS_COMPLETED 0 18117d25cae7SOded Gabbay #define HL_WAIT_CS_STATUS_BUSY 1 18127d25cae7SOded Gabbay #define HL_WAIT_CS_STATUS_TIMEDOUT 2 18137d25cae7SOded Gabbay #define HL_WAIT_CS_STATUS_ABORTED 3 18147d25cae7SOded Gabbay 18157d25cae7SOded Gabbay #define HL_WAIT_CS_STATUS_FLAG_GONE 0x1 18167d25cae7SOded Gabbay #define HL_WAIT_CS_STATUS_FLAG_TIMESTAMP_VLD 0x2 18177d25cae7SOded Gabbay 18187d25cae7SOded Gabbay struct hl_wait_cs_out { 18197d25cae7SOded Gabbay /* HL_WAIT_CS_STATUS_* */ 18207d25cae7SOded Gabbay __u32 status; 18217d25cae7SOded Gabbay /* HL_WAIT_CS_STATUS_FLAG* */ 18227d25cae7SOded Gabbay __u32 flags; 18237d25cae7SOded Gabbay /* 18247d25cae7SOded Gabbay * valid only if HL_WAIT_CS_STATUS_FLAG_TIMESTAMP_VLD is set 18257d25cae7SOded Gabbay * for wait_cs: timestamp of CS completion 18267d25cae7SOded Gabbay * for wait_multi_cs: timestamp of FIRST CS completion 18277d25cae7SOded Gabbay */ 18287d25cae7SOded Gabbay __s64 timestamp_nsec; 18297d25cae7SOded Gabbay /* multi CS completion bitmap */ 18307d25cae7SOded Gabbay __u32 cs_completion_map; 18317d25cae7SOded Gabbay __u32 pad; 18327d25cae7SOded Gabbay }; 18337d25cae7SOded Gabbay 18347d25cae7SOded Gabbay union hl_wait_cs_args { 18357d25cae7SOded Gabbay struct hl_wait_cs_in in; 18367d25cae7SOded Gabbay struct hl_wait_cs_out out; 18377d25cae7SOded Gabbay }; 18387d25cae7SOded Gabbay 18397d25cae7SOded Gabbay /* Opcode to allocate device memory */ 18407d25cae7SOded Gabbay #define HL_MEM_OP_ALLOC 0 18417d25cae7SOded Gabbay 18427d25cae7SOded Gabbay /* Opcode to free previously allocated device memory */ 18437d25cae7SOded Gabbay #define HL_MEM_OP_FREE 1 18447d25cae7SOded Gabbay 18457d25cae7SOded Gabbay /* Opcode to map host and device memory */ 18467d25cae7SOded Gabbay #define HL_MEM_OP_MAP 2 18477d25cae7SOded Gabbay 18487d25cae7SOded Gabbay /* Opcode to unmap previously mapped host and device memory */ 18497d25cae7SOded Gabbay #define HL_MEM_OP_UNMAP 3 18507d25cae7SOded Gabbay 18517d25cae7SOded Gabbay /* Opcode to map a hw block */ 18527d25cae7SOded Gabbay #define HL_MEM_OP_MAP_BLOCK 4 18537d25cae7SOded Gabbay 18547d25cae7SOded Gabbay /* Opcode to create DMA-BUF object for an existing device memory allocation 18557d25cae7SOded Gabbay * and to export an FD of that DMA-BUF back to the caller 18567d25cae7SOded Gabbay */ 18577d25cae7SOded Gabbay #define HL_MEM_OP_EXPORT_DMABUF_FD 5 18587d25cae7SOded Gabbay 18597d25cae7SOded Gabbay /* Opcode to create timestamps pool for user interrupts registration support 18607d25cae7SOded Gabbay * The memory will be allocated by the kernel driver, A timestamp buffer which the user 18617d25cae7SOded Gabbay * will get handle to it for mmap, and another internal buffer used by the 18627d25cae7SOded Gabbay * driver for registration management 18637d25cae7SOded Gabbay * The memory will be freed when the user closes the file descriptor(ctx close) 18647d25cae7SOded Gabbay */ 18657d25cae7SOded Gabbay #define HL_MEM_OP_TS_ALLOC 6 18667d25cae7SOded Gabbay 18677d25cae7SOded Gabbay /* Memory flags */ 18687d25cae7SOded Gabbay #define HL_MEM_CONTIGUOUS 0x1 18697d25cae7SOded Gabbay #define HL_MEM_SHARED 0x2 18707d25cae7SOded Gabbay #define HL_MEM_USERPTR 0x4 18717d25cae7SOded Gabbay #define HL_MEM_FORCE_HINT 0x8 18727d25cae7SOded Gabbay #define HL_MEM_PREFETCH 0x40 18737d25cae7SOded Gabbay 18747d25cae7SOded Gabbay /** 18757d25cae7SOded Gabbay * structure hl_mem_in - structure that handle input args for memory IOCTL 18767d25cae7SOded Gabbay * @union arg: union of structures to be used based on the input operation 18777d25cae7SOded Gabbay * @op: specify the requested memory operation (one of the HL_MEM_OP_* definitions). 18787d25cae7SOded Gabbay * @flags: flags for the memory operation (one of the HL_MEM_* definitions). 18797d25cae7SOded Gabbay * For the HL_MEM_OP_EXPORT_DMABUF_FD opcode, this field holds the DMA-BUF file/FD flags. 18807d25cae7SOded Gabbay * @ctx_id: context ID - currently not in use. 18817d25cae7SOded Gabbay * @num_of_elements: number of timestamp elements used only with HL_MEM_OP_TS_ALLOC opcode. 18827d25cae7SOded Gabbay */ 18837d25cae7SOded Gabbay struct hl_mem_in { 18847d25cae7SOded Gabbay union { 18857d25cae7SOded Gabbay /** 18867d25cae7SOded Gabbay * structure for device memory allocation (used with the HL_MEM_OP_ALLOC op) 18877d25cae7SOded Gabbay * @mem_size: memory size to allocate 18887d25cae7SOded Gabbay * @page_size: page size to use on allocation. when the value is 0 the default page 18897d25cae7SOded Gabbay * size will be taken. 18907d25cae7SOded Gabbay */ 18917d25cae7SOded Gabbay struct { 18927d25cae7SOded Gabbay __u64 mem_size; 18937d25cae7SOded Gabbay __u64 page_size; 18947d25cae7SOded Gabbay } alloc; 18957d25cae7SOded Gabbay 18967d25cae7SOded Gabbay /** 18977d25cae7SOded Gabbay * structure for free-ing device memory (used with the HL_MEM_OP_FREE op) 18987d25cae7SOded Gabbay * @handle: handle returned from HL_MEM_OP_ALLOC 18997d25cae7SOded Gabbay */ 19007d25cae7SOded Gabbay struct { 19017d25cae7SOded Gabbay __u64 handle; 19027d25cae7SOded Gabbay } free; 19037d25cae7SOded Gabbay 19047d25cae7SOded Gabbay /** 19057d25cae7SOded Gabbay * structure for mapping device memory (used with the HL_MEM_OP_MAP op) 19067d25cae7SOded Gabbay * @hint_addr: requested virtual address of mapped memory. 19077d25cae7SOded Gabbay * the driver will try to map the requested region to this hint 19087d25cae7SOded Gabbay * address, as long as the address is valid and not already mapped. 19097d25cae7SOded Gabbay * the user should check the returned address of the IOCTL to make 19107d25cae7SOded Gabbay * sure he got the hint address. 19117d25cae7SOded Gabbay * passing 0 here means that the driver will choose the address itself. 19127d25cae7SOded Gabbay * @handle: handle returned from HL_MEM_OP_ALLOC. 19137d25cae7SOded Gabbay */ 19147d25cae7SOded Gabbay struct { 19157d25cae7SOded Gabbay __u64 hint_addr; 19167d25cae7SOded Gabbay __u64 handle; 19177d25cae7SOded Gabbay } map_device; 19187d25cae7SOded Gabbay 19197d25cae7SOded Gabbay /** 19207d25cae7SOded Gabbay * structure for mapping host memory (used with the HL_MEM_OP_MAP op) 19217d25cae7SOded Gabbay * @host_virt_addr: address of allocated host memory. 19227d25cae7SOded Gabbay * @hint_addr: requested virtual address of mapped memory. 19237d25cae7SOded Gabbay * the driver will try to map the requested region to this hint 19247d25cae7SOded Gabbay * address, as long as the address is valid and not already mapped. 19257d25cae7SOded Gabbay * the user should check the returned address of the IOCTL to make 19267d25cae7SOded Gabbay * sure he got the hint address. 19277d25cae7SOded Gabbay * passing 0 here means that the driver will choose the address itself. 19287d25cae7SOded Gabbay * @size: size of allocated host memory. 19297d25cae7SOded Gabbay */ 19307d25cae7SOded Gabbay struct { 19317d25cae7SOded Gabbay __u64 host_virt_addr; 19327d25cae7SOded Gabbay __u64 hint_addr; 19337d25cae7SOded Gabbay __u64 mem_size; 19347d25cae7SOded Gabbay } map_host; 19357d25cae7SOded Gabbay 19367d25cae7SOded Gabbay /** 19377d25cae7SOded Gabbay * structure for mapping hw block (used with the HL_MEM_OP_MAP_BLOCK op) 19387d25cae7SOded Gabbay * @block_addr:HW block address to map, a handle and size will be returned 19397d25cae7SOded Gabbay * to the user and will be used to mmap the relevant block. 19407d25cae7SOded Gabbay * only addresses from configuration space are allowed. 19417d25cae7SOded Gabbay */ 19427d25cae7SOded Gabbay struct { 19437d25cae7SOded Gabbay __u64 block_addr; 19447d25cae7SOded Gabbay } map_block; 19457d25cae7SOded Gabbay 19467d25cae7SOded Gabbay /** 19477d25cae7SOded Gabbay * structure for unmapping host memory (used with the HL_MEM_OP_UNMAP op) 19487d25cae7SOded Gabbay * @device_virt_addr: virtual address returned from HL_MEM_OP_MAP 19497d25cae7SOded Gabbay */ 19507d25cae7SOded Gabbay struct { 19517d25cae7SOded Gabbay __u64 device_virt_addr; 19527d25cae7SOded Gabbay } unmap; 19537d25cae7SOded Gabbay 19547d25cae7SOded Gabbay /** 19557d25cae7SOded Gabbay * structure for exporting DMABUF object (used with 19567d25cae7SOded Gabbay * the HL_MEM_OP_EXPORT_DMABUF_FD op) 19577d25cae7SOded Gabbay * @addr: for Gaudi1, the driver expects a physical address 19587d25cae7SOded Gabbay * inside the device's DRAM. this is because in Gaudi1 19597d25cae7SOded Gabbay * we don't have MMU that covers the device's DRAM. 19607d25cae7SOded Gabbay * for all other ASICs, the driver expects a device 19617d25cae7SOded Gabbay * virtual address that represents the start address of 19627d25cae7SOded Gabbay * a mapped DRAM memory area inside the device. 19637d25cae7SOded Gabbay * the address must be the same as was received from the 19647d25cae7SOded Gabbay * driver during a previous HL_MEM_OP_MAP operation. 19657d25cae7SOded Gabbay * @mem_size: size of memory to export. 19667d25cae7SOded Gabbay * @offset: for Gaudi1, this value must be 0. For all other ASICs, 19677d25cae7SOded Gabbay * the driver expects an offset inside of the memory area 19687d25cae7SOded Gabbay * describe by addr. the offset represents the start 19697d25cae7SOded Gabbay * address of that the exported dma-buf object describes. 19707d25cae7SOded Gabbay */ 19717d25cae7SOded Gabbay struct { 19727d25cae7SOded Gabbay __u64 addr; 19737d25cae7SOded Gabbay __u64 mem_size; 19747d25cae7SOded Gabbay __u64 offset; 19757d25cae7SOded Gabbay } export_dmabuf_fd; 19767d25cae7SOded Gabbay }; 19777d25cae7SOded Gabbay 19787d25cae7SOded Gabbay __u32 op; 19797d25cae7SOded Gabbay __u32 flags; 19807d25cae7SOded Gabbay __u32 ctx_id; 19817d25cae7SOded Gabbay __u32 num_of_elements; 19827d25cae7SOded Gabbay }; 19837d25cae7SOded Gabbay 19847d25cae7SOded Gabbay struct hl_mem_out { 19857d25cae7SOded Gabbay union { 19867d25cae7SOded Gabbay /* 19877d25cae7SOded Gabbay * Used for HL_MEM_OP_MAP as the virtual address that was 19887d25cae7SOded Gabbay * assigned in the device VA space. 19897d25cae7SOded Gabbay * A value of 0 means the requested operation failed. 19907d25cae7SOded Gabbay */ 19917d25cae7SOded Gabbay __u64 device_virt_addr; 19927d25cae7SOded Gabbay 19937d25cae7SOded Gabbay /* 19947d25cae7SOded Gabbay * Used in HL_MEM_OP_ALLOC 19957d25cae7SOded Gabbay * This is the assigned handle for the allocated memory 19967d25cae7SOded Gabbay */ 19977d25cae7SOded Gabbay __u64 handle; 19987d25cae7SOded Gabbay 19997d25cae7SOded Gabbay struct { 20007d25cae7SOded Gabbay /* 20017d25cae7SOded Gabbay * Used in HL_MEM_OP_MAP_BLOCK. 20027d25cae7SOded Gabbay * This is the assigned handle for the mapped block 20037d25cae7SOded Gabbay */ 20047d25cae7SOded Gabbay __u64 block_handle; 20057d25cae7SOded Gabbay 20067d25cae7SOded Gabbay /* 20077d25cae7SOded Gabbay * Used in HL_MEM_OP_MAP_BLOCK 20087d25cae7SOded Gabbay * This is the size of the mapped block 20097d25cae7SOded Gabbay */ 20107d25cae7SOded Gabbay __u32 block_size; 20117d25cae7SOded Gabbay 20127d25cae7SOded Gabbay __u32 pad; 20137d25cae7SOded Gabbay }; 20147d25cae7SOded Gabbay 20157d25cae7SOded Gabbay /* Returned in HL_MEM_OP_EXPORT_DMABUF_FD. Represents the 20167d25cae7SOded Gabbay * DMA-BUF object that was created to describe a memory 20177d25cae7SOded Gabbay * allocation on the device's memory space. The FD should be 20187d25cae7SOded Gabbay * passed to the importer driver 20197d25cae7SOded Gabbay */ 20207d25cae7SOded Gabbay __s32 fd; 20217d25cae7SOded Gabbay }; 20227d25cae7SOded Gabbay }; 20237d25cae7SOded Gabbay 20247d25cae7SOded Gabbay union hl_mem_args { 20257d25cae7SOded Gabbay struct hl_mem_in in; 20267d25cae7SOded Gabbay struct hl_mem_out out; 20277d25cae7SOded Gabbay }; 20287d25cae7SOded Gabbay 20297d25cae7SOded Gabbay #define HL_DEBUG_MAX_AUX_VALUES 10 20307d25cae7SOded Gabbay 20317d25cae7SOded Gabbay struct hl_debug_params_etr { 20327d25cae7SOded Gabbay /* Address in memory to allocate buffer */ 20337d25cae7SOded Gabbay __u64 buffer_address; 20347d25cae7SOded Gabbay 20357d25cae7SOded Gabbay /* Size of buffer to allocate */ 20367d25cae7SOded Gabbay __u64 buffer_size; 20377d25cae7SOded Gabbay 20387d25cae7SOded Gabbay /* Sink operation mode: SW fifo, HW fifo, Circular buffer */ 20397d25cae7SOded Gabbay __u32 sink_mode; 20407d25cae7SOded Gabbay __u32 pad; 20417d25cae7SOded Gabbay }; 20427d25cae7SOded Gabbay 20437d25cae7SOded Gabbay struct hl_debug_params_etf { 20447d25cae7SOded Gabbay /* Address in memory to allocate buffer */ 20457d25cae7SOded Gabbay __u64 buffer_address; 20467d25cae7SOded Gabbay 20477d25cae7SOded Gabbay /* Size of buffer to allocate */ 20487d25cae7SOded Gabbay __u64 buffer_size; 20497d25cae7SOded Gabbay 20507d25cae7SOded Gabbay /* Sink operation mode: SW fifo, HW fifo, Circular buffer */ 20517d25cae7SOded Gabbay __u32 sink_mode; 20527d25cae7SOded Gabbay __u32 pad; 20537d25cae7SOded Gabbay }; 20547d25cae7SOded Gabbay 20557d25cae7SOded Gabbay struct hl_debug_params_stm { 20567d25cae7SOded Gabbay /* Two bit masks for HW event and Stimulus Port */ 20577d25cae7SOded Gabbay __u64 he_mask; 20587d25cae7SOded Gabbay __u64 sp_mask; 20597d25cae7SOded Gabbay 20607d25cae7SOded Gabbay /* Trace source ID */ 20617d25cae7SOded Gabbay __u32 id; 20627d25cae7SOded Gabbay 20637d25cae7SOded Gabbay /* Frequency for the timestamp register */ 20647d25cae7SOded Gabbay __u32 frequency; 20657d25cae7SOded Gabbay }; 20667d25cae7SOded Gabbay 20677d25cae7SOded Gabbay struct hl_debug_params_bmon { 20687d25cae7SOded Gabbay /* Two address ranges that the user can request to filter */ 20697d25cae7SOded Gabbay __u64 start_addr0; 20707d25cae7SOded Gabbay __u64 addr_mask0; 20717d25cae7SOded Gabbay 20727d25cae7SOded Gabbay __u64 start_addr1; 20737d25cae7SOded Gabbay __u64 addr_mask1; 20747d25cae7SOded Gabbay 20757d25cae7SOded Gabbay /* Capture window configuration */ 20767d25cae7SOded Gabbay __u32 bw_win; 20777d25cae7SOded Gabbay __u32 win_capture; 20787d25cae7SOded Gabbay 20797d25cae7SOded Gabbay /* Trace source ID */ 20807d25cae7SOded Gabbay __u32 id; 20817d25cae7SOded Gabbay 20827d25cae7SOded Gabbay /* Control register */ 20837d25cae7SOded Gabbay __u32 control; 20847d25cae7SOded Gabbay 20857d25cae7SOded Gabbay /* Two more address ranges that the user can request to filter */ 20867d25cae7SOded Gabbay __u64 start_addr2; 20877d25cae7SOded Gabbay __u64 end_addr2; 20887d25cae7SOded Gabbay 20897d25cae7SOded Gabbay __u64 start_addr3; 20907d25cae7SOded Gabbay __u64 end_addr3; 20917d25cae7SOded Gabbay }; 20927d25cae7SOded Gabbay 20937d25cae7SOded Gabbay struct hl_debug_params_spmu { 20947d25cae7SOded Gabbay /* Event types selection */ 20957d25cae7SOded Gabbay __u64 event_types[HL_DEBUG_MAX_AUX_VALUES]; 20967d25cae7SOded Gabbay 20977d25cae7SOded Gabbay /* Number of event types selection */ 20987d25cae7SOded Gabbay __u32 event_types_num; 20997d25cae7SOded Gabbay 21007d25cae7SOded Gabbay /* TRC configuration register values */ 21017d25cae7SOded Gabbay __u32 pmtrc_val; 21027d25cae7SOded Gabbay __u32 trc_ctrl_host_val; 21037d25cae7SOded Gabbay __u32 trc_en_host_val; 21047d25cae7SOded Gabbay }; 21057d25cae7SOded Gabbay 21067d25cae7SOded Gabbay /* Opcode for ETR component */ 21077d25cae7SOded Gabbay #define HL_DEBUG_OP_ETR 0 21087d25cae7SOded Gabbay /* Opcode for ETF component */ 21097d25cae7SOded Gabbay #define HL_DEBUG_OP_ETF 1 21107d25cae7SOded Gabbay /* Opcode for STM component */ 21117d25cae7SOded Gabbay #define HL_DEBUG_OP_STM 2 21127d25cae7SOded Gabbay /* Opcode for FUNNEL component */ 21137d25cae7SOded Gabbay #define HL_DEBUG_OP_FUNNEL 3 21147d25cae7SOded Gabbay /* Opcode for BMON component */ 21157d25cae7SOded Gabbay #define HL_DEBUG_OP_BMON 4 21167d25cae7SOded Gabbay /* Opcode for SPMU component */ 21177d25cae7SOded Gabbay #define HL_DEBUG_OP_SPMU 5 21187d25cae7SOded Gabbay /* Opcode for timestamp (deprecated) */ 21197d25cae7SOded Gabbay #define HL_DEBUG_OP_TIMESTAMP 6 21207d25cae7SOded Gabbay /* Opcode for setting the device into or out of debug mode. The enable 21217d25cae7SOded Gabbay * variable should be 1 for enabling debug mode and 0 for disabling it 21227d25cae7SOded Gabbay */ 21237d25cae7SOded Gabbay #define HL_DEBUG_OP_SET_MODE 7 21247d25cae7SOded Gabbay 21257d25cae7SOded Gabbay struct hl_debug_args { 21267d25cae7SOded Gabbay /* 21277d25cae7SOded Gabbay * Pointer to user input structure. 21287d25cae7SOded Gabbay * This field is relevant to specific opcodes. 21297d25cae7SOded Gabbay */ 21307d25cae7SOded Gabbay __u64 input_ptr; 21317d25cae7SOded Gabbay /* Pointer to user output structure */ 21327d25cae7SOded Gabbay __u64 output_ptr; 21337d25cae7SOded Gabbay /* Size of user input structure */ 21347d25cae7SOded Gabbay __u32 input_size; 21357d25cae7SOded Gabbay /* Size of user output structure */ 21367d25cae7SOded Gabbay __u32 output_size; 21377d25cae7SOded Gabbay /* HL_DEBUG_OP_* */ 21387d25cae7SOded Gabbay __u32 op; 21397d25cae7SOded Gabbay /* 21407d25cae7SOded Gabbay * Register index in the component, taken from the debug_regs_index enum 21417d25cae7SOded Gabbay * in the various ASIC header files 21427d25cae7SOded Gabbay */ 21437d25cae7SOded Gabbay __u32 reg_idx; 21447d25cae7SOded Gabbay /* Enable/disable */ 21457d25cae7SOded Gabbay __u32 enable; 21467d25cae7SOded Gabbay /* Context ID - Currently not in use */ 21477d25cae7SOded Gabbay __u32 ctx_id; 21487d25cae7SOded Gabbay }; 21497d25cae7SOded Gabbay 21507d25cae7SOded Gabbay /* 21517d25cae7SOded Gabbay * Various information operations such as: 21527d25cae7SOded Gabbay * - H/W IP information 21537d25cae7SOded Gabbay * - Current dram usage 21547d25cae7SOded Gabbay * 21557d25cae7SOded Gabbay * The user calls this IOCTL with an opcode that describes the required 21567d25cae7SOded Gabbay * information. The user should supply a pointer to a user-allocated memory 21577d25cae7SOded Gabbay * chunk, which will be filled by the driver with the requested information. 21587d25cae7SOded Gabbay * 21597d25cae7SOded Gabbay * The user supplies the maximum amount of size to copy into the user's memory, 21607d25cae7SOded Gabbay * in order to prevent data corruption in case of differences between the 21617d25cae7SOded Gabbay * definitions of structures in kernel and userspace, e.g. in case of old 21627d25cae7SOded Gabbay * userspace and new kernel driver 21637d25cae7SOded Gabbay */ 21647d25cae7SOded Gabbay #define HL_IOCTL_INFO \ 21657d25cae7SOded Gabbay _IOWR('H', 0x01, struct hl_info_args) 21667d25cae7SOded Gabbay 21677d25cae7SOded Gabbay /* 21687d25cae7SOded Gabbay * Command Buffer 21697d25cae7SOded Gabbay * - Request a Command Buffer 21707d25cae7SOded Gabbay * - Destroy a Command Buffer 21717d25cae7SOded Gabbay * 21727d25cae7SOded Gabbay * The command buffers are memory blocks that reside in DMA-able address 21737d25cae7SOded Gabbay * space and are physically contiguous so they can be accessed by the device 21747d25cae7SOded Gabbay * directly. They are allocated using the coherent DMA API. 21757d25cae7SOded Gabbay * 21767d25cae7SOded Gabbay * When creating a new CB, the IOCTL returns a handle of it, and the user-space 21777d25cae7SOded Gabbay * process needs to use that handle to mmap the buffer so it can access them. 21787d25cae7SOded Gabbay * 21797d25cae7SOded Gabbay * In some instances, the device must access the command buffer through the 21807d25cae7SOded Gabbay * device's MMU, and thus its memory should be mapped. In these cases, user can 21817d25cae7SOded Gabbay * indicate the driver that such a mapping is required. 21827d25cae7SOded Gabbay * The resulting device virtual address will be used internally by the driver, 21837d25cae7SOded Gabbay * and won't be returned to user. 21847d25cae7SOded Gabbay * 21857d25cae7SOded Gabbay */ 21867d25cae7SOded Gabbay #define HL_IOCTL_CB \ 21877d25cae7SOded Gabbay _IOWR('H', 0x02, union hl_cb_args) 21887d25cae7SOded Gabbay 21897d25cae7SOded Gabbay /* 21907d25cae7SOded Gabbay * Command Submission 21917d25cae7SOded Gabbay * 21927d25cae7SOded Gabbay * To submit work to the device, the user need to call this IOCTL with a set 21937d25cae7SOded Gabbay * of JOBS. That set of JOBS constitutes a CS object. 21947d25cae7SOded Gabbay * Each JOB will be enqueued on a specific queue, according to the user's input. 21957d25cae7SOded Gabbay * There can be more then one JOB per queue. 21967d25cae7SOded Gabbay * 21977d25cae7SOded Gabbay * The CS IOCTL will receive two sets of JOBS. One set is for "restore" phase 21987d25cae7SOded Gabbay * and a second set is for "execution" phase. 21997d25cae7SOded Gabbay * The JOBS on the "restore" phase are enqueued only after context-switch 22007d25cae7SOded Gabbay * (or if its the first CS for this context). The user can also order the 22017d25cae7SOded Gabbay * driver to run the "restore" phase explicitly 22027d25cae7SOded Gabbay * 22037d25cae7SOded Gabbay * Goya/Gaudi: 22047d25cae7SOded Gabbay * There are two types of queues - external and internal. External queues 22057d25cae7SOded Gabbay * are DMA queues which transfer data from/to the Host. All other queues are 22067d25cae7SOded Gabbay * internal. The driver will get completion notifications from the device only 22077d25cae7SOded Gabbay * on JOBS which are enqueued in the external queues. 22087d25cae7SOded Gabbay * 22097d25cae7SOded Gabbay * Greco onwards: 22107d25cae7SOded Gabbay * There is a single type of queue for all types of engines, either DMA engines 22117d25cae7SOded Gabbay * for transfers from/to the host or inside the device, or compute engines. 22127d25cae7SOded Gabbay * The driver will get completion notifications from the device for all queues. 22137d25cae7SOded Gabbay * 22147d25cae7SOded Gabbay * For jobs on external queues, the user needs to create command buffers 22157d25cae7SOded Gabbay * through the CB ioctl and give the CB's handle to the CS ioctl. For jobs on 22167d25cae7SOded Gabbay * internal queues, the user needs to prepare a "command buffer" with packets 22177d25cae7SOded Gabbay * on either the device SRAM/DRAM or the host, and give the device address of 22187d25cae7SOded Gabbay * that buffer to the CS ioctl. 22197d25cae7SOded Gabbay * For jobs on H/W queues both options of command buffers are valid. 22207d25cae7SOded Gabbay * 22217d25cae7SOded Gabbay * This IOCTL is asynchronous in regard to the actual execution of the CS. This 22227d25cae7SOded Gabbay * means it returns immediately after ALL the JOBS were enqueued on their 22237d25cae7SOded Gabbay * relevant queues. Therefore, the user mustn't assume the CS has been completed 22247d25cae7SOded Gabbay * or has even started to execute. 22257d25cae7SOded Gabbay * 22267d25cae7SOded Gabbay * Upon successful enqueue, the IOCTL returns a sequence number which the user 22277d25cae7SOded Gabbay * can use with the "Wait for CS" IOCTL to check whether the handle's CS 22287d25cae7SOded Gabbay * non-internal JOBS have been completed. Note that if the CS has internal JOBS 22297d25cae7SOded Gabbay * which can execute AFTER the external JOBS have finished, the driver might 22307d25cae7SOded Gabbay * report that the CS has finished executing BEFORE the internal JOBS have 22317d25cae7SOded Gabbay * actually finished executing. 22327d25cae7SOded Gabbay * 22337d25cae7SOded Gabbay * Even though the sequence number increments per CS, the user can NOT 22347d25cae7SOded Gabbay * automatically assume that if CS with sequence number N finished, then CS 22357d25cae7SOded Gabbay * with sequence number N-1 also finished. The user can make this assumption if 22367d25cae7SOded Gabbay * and only if CS N and CS N-1 are exactly the same (same CBs for the same 22377d25cae7SOded Gabbay * queues). 22387d25cae7SOded Gabbay */ 22397d25cae7SOded Gabbay #define HL_IOCTL_CS \ 22407d25cae7SOded Gabbay _IOWR('H', 0x03, union hl_cs_args) 22417d25cae7SOded Gabbay 22427d25cae7SOded Gabbay /* 22437d25cae7SOded Gabbay * Wait for Command Submission 22447d25cae7SOded Gabbay * 22457d25cae7SOded Gabbay * The user can call this IOCTL with a handle it received from the CS IOCTL 22467d25cae7SOded Gabbay * to wait until the handle's CS has finished executing. The user will wait 22477d25cae7SOded Gabbay * inside the kernel until the CS has finished or until the user-requested 22487d25cae7SOded Gabbay * timeout has expired. 22497d25cae7SOded Gabbay * 22507d25cae7SOded Gabbay * If the timeout value is 0, the driver won't sleep at all. It will check 22517d25cae7SOded Gabbay * the status of the CS and return immediately 22527d25cae7SOded Gabbay * 22537d25cae7SOded Gabbay * The return value of the IOCTL is a standard Linux error code. The possible 22547d25cae7SOded Gabbay * values are: 22557d25cae7SOded Gabbay * 22567d25cae7SOded Gabbay * EINTR - Kernel waiting has been interrupted, e.g. due to OS signal 22577d25cae7SOded Gabbay * that the user process received 22587d25cae7SOded Gabbay * ETIMEDOUT - The CS has caused a timeout on the device 22597d25cae7SOded Gabbay * EIO - The CS was aborted (usually because the device was reset) 22607d25cae7SOded Gabbay * ENODEV - The device wants to do hard-reset (so user need to close FD) 22617d25cae7SOded Gabbay * 22627d25cae7SOded Gabbay * The driver also returns a custom define in case the IOCTL call returned 0. 22637d25cae7SOded Gabbay * The define can be one of the following: 22647d25cae7SOded Gabbay * 22657d25cae7SOded Gabbay * HL_WAIT_CS_STATUS_COMPLETED - The CS has been completed successfully (0) 22667d25cae7SOded Gabbay * HL_WAIT_CS_STATUS_BUSY - The CS is still executing (0) 22677d25cae7SOded Gabbay * HL_WAIT_CS_STATUS_TIMEDOUT - The CS has caused a timeout on the device 22687d25cae7SOded Gabbay * (ETIMEDOUT) 22697d25cae7SOded Gabbay * HL_WAIT_CS_STATUS_ABORTED - The CS was aborted, usually because the 22707d25cae7SOded Gabbay * device was reset (EIO) 22717d25cae7SOded Gabbay */ 22727d25cae7SOded Gabbay 22737d25cae7SOded Gabbay #define HL_IOCTL_WAIT_CS \ 22747d25cae7SOded Gabbay _IOWR('H', 0x04, union hl_wait_cs_args) 22757d25cae7SOded Gabbay 22767d25cae7SOded Gabbay /* 22777d25cae7SOded Gabbay * Memory 22787d25cae7SOded Gabbay * - Map host memory to device MMU 22797d25cae7SOded Gabbay * - Unmap host memory from device MMU 22807d25cae7SOded Gabbay * 22817d25cae7SOded Gabbay * This IOCTL allows the user to map host memory to the device MMU 22827d25cae7SOded Gabbay * 22837d25cae7SOded Gabbay * For host memory, the IOCTL doesn't allocate memory. The user is supposed 22847d25cae7SOded Gabbay * to allocate the memory in user-space (malloc/new). The driver pins the 22857d25cae7SOded Gabbay * physical pages (up to the allowed limit by the OS), assigns a virtual 22867d25cae7SOded Gabbay * address in the device VA space and initializes the device MMU. 22877d25cae7SOded Gabbay * 22887d25cae7SOded Gabbay * There is an option for the user to specify the requested virtual address. 22897d25cae7SOded Gabbay * 22907d25cae7SOded Gabbay */ 22917d25cae7SOded Gabbay #define HL_IOCTL_MEMORY \ 22927d25cae7SOded Gabbay _IOWR('H', 0x05, union hl_mem_args) 22937d25cae7SOded Gabbay 22947d25cae7SOded Gabbay /* 22957d25cae7SOded Gabbay * Debug 22967d25cae7SOded Gabbay * - Enable/disable the ETR/ETF/FUNNEL/STM/BMON/SPMU debug traces 22977d25cae7SOded Gabbay * 22987d25cae7SOded Gabbay * This IOCTL allows the user to get debug traces from the chip. 22997d25cae7SOded Gabbay * 23007d25cae7SOded Gabbay * Before the user can send configuration requests of the various 23017d25cae7SOded Gabbay * debug/profile engines, it needs to set the device into debug mode. 23027d25cae7SOded Gabbay * This is because the debug/profile infrastructure is shared component in the 23037d25cae7SOded Gabbay * device and we can't allow multiple users to access it at the same time. 23047d25cae7SOded Gabbay * 23057d25cae7SOded Gabbay * Once a user set the device into debug mode, the driver won't allow other 23067d25cae7SOded Gabbay * users to "work" with the device, i.e. open a FD. If there are multiple users 23077d25cae7SOded Gabbay * opened on the device, the driver won't allow any user to debug the device. 23087d25cae7SOded Gabbay * 23097d25cae7SOded Gabbay * For each configuration request, the user needs to provide the register index 23107d25cae7SOded Gabbay * and essential data such as buffer address and size. 23117d25cae7SOded Gabbay * 23127d25cae7SOded Gabbay * Once the user has finished using the debug/profile engines, he should 23137d25cae7SOded Gabbay * set the device into non-debug mode, i.e. disable debug mode. 23147d25cae7SOded Gabbay * 2315 * The driver can decide to "kick out" the user if he abuses this interface. 2316 * 2317 */ 2318 #define HL_IOCTL_DEBUG \ 2319 _IOWR('H', 0x06, struct hl_debug_args) 2320 2321 #define HL_COMMAND_START 0x01 2322 #define HL_COMMAND_END 0x07 2323 2324 #endif /* HABANALABS_H_ */ 2325