18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: MIT */ 28c2ecf20Sopenharmony_ci#ifndef __NVIF_CL0080_H__ 38c2ecf20Sopenharmony_ci#define __NVIF_CL0080_H__ 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_cistruct nv_device_v0 { 68c2ecf20Sopenharmony_ci __u8 version; 78c2ecf20Sopenharmony_ci __u8 pad01[7]; 88c2ecf20Sopenharmony_ci __u64 device; /* device identifier, ~0 for client default */ 98c2ecf20Sopenharmony_ci}; 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#define NV_DEVICE_V0_INFO 0x00 128c2ecf20Sopenharmony_ci#define NV_DEVICE_V0_TIME 0x01 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_cistruct nv_device_info_v0 { 158c2ecf20Sopenharmony_ci __u8 version; 168c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_V0_IGP 0x00 178c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_V0_PCI 0x01 188c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_V0_AGP 0x02 198c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_V0_PCIE 0x03 208c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_V0_SOC 0x04 218c2ecf20Sopenharmony_ci __u8 platform; 228c2ecf20Sopenharmony_ci __u16 chipset; /* from NV_PMC_BOOT_0 */ 238c2ecf20Sopenharmony_ci __u8 revision; /* from NV_PMC_BOOT_0 */ 248c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_V0_TNT 0x01 258c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_V0_CELSIUS 0x02 268c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_V0_KELVIN 0x03 278c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_V0_RANKINE 0x04 288c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_V0_CURIE 0x05 298c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_V0_TESLA 0x06 308c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_V0_FERMI 0x07 318c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_V0_KEPLER 0x08 328c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_V0_MAXWELL 0x09 338c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_V0_PASCAL 0x0a 348c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_V0_VOLTA 0x0b 358c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_V0_TURING 0x0c 368c2ecf20Sopenharmony_ci __u8 family; 378c2ecf20Sopenharmony_ci __u8 pad06[2]; 388c2ecf20Sopenharmony_ci __u64 ram_size; 398c2ecf20Sopenharmony_ci __u64 ram_user; 408c2ecf20Sopenharmony_ci char chip[16]; 418c2ecf20Sopenharmony_ci char name[64]; 428c2ecf20Sopenharmony_ci}; 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_cistruct nv_device_info_v1 { 458c2ecf20Sopenharmony_ci __u8 version; 468c2ecf20Sopenharmony_ci __u8 count; 478c2ecf20Sopenharmony_ci __u8 pad02[6]; 488c2ecf20Sopenharmony_ci struct nv_device_info_v1_data { 498c2ecf20Sopenharmony_ci __u64 mthd; /* NV_DEVICE_INFO_* (see below). */ 508c2ecf20Sopenharmony_ci __u64 data; 518c2ecf20Sopenharmony_ci } data[]; 528c2ecf20Sopenharmony_ci}; 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_cistruct nv_device_time_v0 { 558c2ecf20Sopenharmony_ci __u8 version; 568c2ecf20Sopenharmony_ci __u8 pad01[7]; 578c2ecf20Sopenharmony_ci __u64 time; 588c2ecf20Sopenharmony_ci}; 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_UNIT (0xffffffffULL << 32) 618c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO(n) ((n) | (0x00000000ULL << 32)) 628c2ecf20Sopenharmony_ci#define NV_DEVICE_FIFO(n) ((n) | (0x00000001ULL << 32)) 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci/* This will be returned for unsupported queries. */ 658c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_INVALID ~0ULL 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci/* These return a mask of available engines of particular type. */ 688c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_ENGINE_SW NV_DEVICE_INFO(0x00000000) 698c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_ENGINE_GR NV_DEVICE_INFO(0x00000001) 708c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_ENGINE_MPEG NV_DEVICE_INFO(0x00000002) 718c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_ENGINE_ME NV_DEVICE_INFO(0x00000003) 728c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_ENGINE_CIPHER NV_DEVICE_INFO(0x00000004) 738c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_ENGINE_BSP NV_DEVICE_INFO(0x00000005) 748c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_ENGINE_VP NV_DEVICE_INFO(0x00000006) 758c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_ENGINE_CE NV_DEVICE_INFO(0x00000007) 768c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_ENGINE_SEC NV_DEVICE_INFO(0x00000008) 778c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_ENGINE_MSVLD NV_DEVICE_INFO(0x00000009) 788c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_ENGINE_MSPDEC NV_DEVICE_INFO(0x0000000a) 798c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_ENGINE_MSPPP NV_DEVICE_INFO(0x0000000b) 808c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_ENGINE_MSENC NV_DEVICE_INFO(0x0000000c) 818c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_ENGINE_VIC NV_DEVICE_INFO(0x0000000d) 828c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_ENGINE_SEC2 NV_DEVICE_INFO(0x0000000e) 838c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_ENGINE_NVDEC NV_DEVICE_INFO(0x0000000f) 848c2ecf20Sopenharmony_ci#define NV_DEVICE_INFO_ENGINE_NVENC NV_DEVICE_INFO(0x00000010) 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ci/* Returns the number of available channels. */ 878c2ecf20Sopenharmony_ci#define NV_DEVICE_FIFO_CHANNELS NV_DEVICE_FIFO(0x00000000) 888c2ecf20Sopenharmony_ci 898c2ecf20Sopenharmony_ci/* Returns a mask of available runlists. */ 908c2ecf20Sopenharmony_ci#define NV_DEVICE_FIFO_RUNLISTS NV_DEVICE_FIFO(0x00000001) 918c2ecf20Sopenharmony_ci 928c2ecf20Sopenharmony_ci/* These return a mask of engines available on a particular runlist. */ 938c2ecf20Sopenharmony_ci#define NV_DEVICE_FIFO_RUNLIST_ENGINES(n) ((n) + NV_DEVICE_FIFO(0x00000010)) 948c2ecf20Sopenharmony_ci#define NV_DEVICE_FIFO_RUNLIST_ENGINES__SIZE 64 958c2ecf20Sopenharmony_ci#endif 96