diff options
Diffstat (limited to 'nvdebug.h')
| -rw-r--r-- | nvdebug.h | 59 |
1 files changed, 50 insertions, 9 deletions
| @@ -390,6 +390,7 @@ typedef union { | |||
| 390 | #define NV_CHIP_ID_GV11B 0x15B // Jetson Xavier embedded GPU | 390 | #define NV_CHIP_ID_GV11B 0x15B // Jetson Xavier embedded GPU |
| 391 | #define NV_CHIP_ID_KEPLER 0x0E0 | 391 | #define NV_CHIP_ID_KEPLER 0x0E0 |
| 392 | #define NV_CHIP_ID_VOLTA 0x140 | 392 | #define NV_CHIP_ID_VOLTA 0x140 |
| 393 | #define NV_CHIP_ID_AMPERE 0x170 | ||
| 393 | 394 | ||
| 394 | inline static const char* ARCH2NAME(uint32_t arch) { | 395 | inline static const char* ARCH2NAME(uint32_t arch) { |
| 395 | switch (arch) { | 396 | switch (arch) { |
| @@ -461,8 +462,7 @@ typedef union { | |||
| 461 | } __attribute__((packed)); | 462 | } __attribute__((packed)); |
| 462 | } mc_boot_0_t; | 463 | } mc_boot_0_t; |
| 463 | 464 | ||
| 464 | 465 | /* GPU engine information and control register offsets (GPU TOPology) | |
| 465 | /* GPU engine information and control register offsets | ||
| 466 | Each engine is described by one or more entries (terminated by an entry with | 466 | Each engine is described by one or more entries (terminated by an entry with |
| 467 | the `has_next_entry` flag unset) in the fixed-size PTOP_DEVICE_INFO table. A | 467 | the `has_next_entry` flag unset) in the fixed-size PTOP_DEVICE_INFO table. A |
| 468 | typical device, such as the graphics/compute engine and any copy engines, are | 468 | typical device, such as the graphics/compute engine and any copy engines, are |
| @@ -473,6 +473,12 @@ typedef union { | |||
| 473 | code should check all NV_PTOP_DEVICE_INFO__SIZE_1 entries and not terminate | 473 | code should check all NV_PTOP_DEVICE_INFO__SIZE_1 entries and not terminate |
| 474 | upon reaching the first entry of INFO_TYPE_NOT_VALID. | 474 | upon reaching the first entry of INFO_TYPE_NOT_VALID. |
| 475 | 475 | ||
| 476 | The fields for the Ampere version of the GPU are a strict subset of those for | ||
| 477 | the earlier versions. They are in different positions within the struct and | ||
| 478 | have names ending in _ampere to distinguish them. Other than that, each | ||
| 479 | Ampere device info field is functionally identical to the equivalent field in | ||
| 480 | the previous version. | ||
| 481 | |||
| 476 | INFO_TYPE : Is this a DATA, ENUM, or ENGINE_TYPE table entry? | 482 | INFO_TYPE : Is this a DATA, ENUM, or ENGINE_TYPE table entry? |
| 477 | HAS_NEXT_ENTRY : Does the following entry refer to the same engine? | 483 | HAS_NEXT_ENTRY : Does the following entry refer to the same engine? |
| 478 | 484 | ||
| @@ -517,8 +523,11 @@ typedef union { | |||
| 517 | Support: Kepler, Maxwell, Pascal, Volta, Ampere | 523 | Support: Kepler, Maxwell, Pascal, Volta, Ampere |
| 518 | See dev_top.ref.txt of NVIDIA's open-gpu-doc for more info. | 524 | See dev_top.ref.txt of NVIDIA's open-gpu-doc for more info. |
| 519 | */ | 525 | */ |
| 520 | #define NV_PTOP_DEVICE_INFO(i) (0x00022700+(i)*4) | 526 | |
| 521 | #define NV_PTOP_DEVICE_INFO__SIZE_1 64 | 527 | #define NV_PTOP_DEVICE_INFO_GA100(i) (0x00022800+(i)*4) |
| 528 | #define NV_PTOP_DEVICE_INFO_GK104(i) (0x00022700+(i)*4) | ||
| 529 | #define NV_PTOP_DEVICE_INFO__SIZE_1_GA100(g) (nvdebug_readl(g, 0x0224fc) >> 20) | ||
| 530 | #define NV_PTOP_DEVICE_INFO__SIZE_1_GK104 64 | ||
| 522 | enum DEVICE_INFO_TYPE {INFO_TYPE_NOT_VALID = 0, INFO_TYPE_DATA = 1, INFO_TYPE_ENUM = 2, INFO_TYPE_ENGINE_TYPE = 3}; | 531 | enum DEVICE_INFO_TYPE {INFO_TYPE_NOT_VALID = 0, INFO_TYPE_DATA = 1, INFO_TYPE_ENUM = 2, INFO_TYPE_ENGINE_TYPE = 3}; |
| 523 | enum ENGINE_TYPES { | 532 | enum ENGINE_TYPES { |
| 524 | ENGINE_GRAPHICS = 0, // GRAPHICS [/compute] | 533 | ENGINE_GRAPHICS = 0, // GRAPHICS [/compute] |
| @@ -527,7 +536,7 @@ enum ENGINE_TYPES { | |||
| 527 | ENGINE_COPY2 = 3, // [raw/physical] COPY #2 | 536 | ENGINE_COPY2 = 3, // [raw/physical] COPY #2 |
| 528 | 537 | ||
| 529 | ENGINE_MSPDEC = 8, // Picture DECoder | 538 | ENGINE_MSPDEC = 8, // Picture DECoder |
| 530 | ENGINE_MSPPP = 9, // [Video] Post Processing | 539 | ENGINE_MSPPP = 9, // [Video] Picture Post Processor |
| 531 | ENGINE_MSVLD = 10, // [Video] Variable Length Decoder | 540 | ENGINE_MSVLD = 10, // [Video] Variable Length Decoder |
| 532 | ENGINE_MSENC = 11, // [Video] ENCoding | 541 | ENGINE_MSENC = 11, // [Video] ENCoding |
| 533 | ENGINE_VIC = 12, // Video Image Compositor | 542 | ENGINE_VIC = 12, // Video Image Compositor |
| @@ -538,10 +547,12 @@ enum ENGINE_TYPES { | |||
| 538 | 547 | ||
| 539 | ENGINE_IOCTRL = 18, // I/O ConTRoLler [of NVLINK at least] | 548 | ENGINE_IOCTRL = 18, // I/O ConTRoLler [of NVLINK at least] |
| 540 | ENGINE_LCE = 19, // Logical Copy Engine | 549 | ENGINE_LCE = 19, // Logical Copy Engine |
| 541 | ENGINE_GSP = 20, // Gpu System Processor | 550 | ENGINE_GSP = 20, // Gpu System Processor (Volta+) |
| 542 | ENGINE_NVJPG = 21, // NVidia JPeG [Decoder] (Ampere+) | 551 | ENGINE_NVJPG = 21, // NVidia JPeG [Decoder] (Turing+) |
| 552 | ENGINE_OFA = 22, // Optical Flow Accelerator (Turing+) | ||
| 553 | ENGINE_FLA = 23, // [NVLink] Fabric Logical Addressing [?] | ||
| 543 | }; | 554 | }; |
| 544 | #define ENGINE_TYPES_LEN 22 | 555 | #define ENGINE_TYPES_LEN 24 |
| 545 | static const char* const ENGINE_TYPES_NAMES[ENGINE_TYPES_LEN] = { | 556 | static const char* const ENGINE_TYPES_NAMES[ENGINE_TYPES_LEN] = { |
| 546 | "Graphics/Compute", | 557 | "Graphics/Compute", |
| 547 | "COPY0", | 558 | "COPY0", |
| @@ -565,8 +576,38 @@ static const char* const ENGINE_TYPES_NAMES[ENGINE_TYPES_LEN] = { | |||
| 565 | "LCE: Logical Copy Engine", | 576 | "LCE: Logical Copy Engine", |
| 566 | "GSP: GPU System Processor", | 577 | "GSP: GPU System Processor", |
| 567 | "NVJPG: NVIDIA JPEG Decoder", | 578 | "NVJPG: NVIDIA JPEG Decoder", |
| 579 | "OFA: Optical Flow Accelerator", | ||
| 580 | "FLA: Fabric Logical Addressing", | ||
| 568 | }; | 581 | }; |
| 569 | 582 | ||
| 583 | // These field are from nvgpu/include/nvgpu/hw/ga100/hw_top_ga100.h | ||
| 584 | typedef union { | ||
| 585 | // _info type fields | ||
| 586 | struct { | ||
| 587 | uint32_t fault_id:11; | ||
| 588 | uint32_t padding0:5; | ||
| 589 | uint32_t inst_id:8; | ||
| 590 | enum ENGINE_TYPES engine_type:7; // "type_enum" | ||
| 591 | bool has_next_entry:1; | ||
| 592 | } __attribute__((packed)); | ||
| 593 | // _info2 type fields | ||
| 594 | struct { | ||
| 595 | uint32_t reset_id:8; | ||
| 596 | uint32_t pri_base:18; // "device_pri_base" | ||
| 597 | uint32_t padding1:4; | ||
| 598 | uint32_t is_engine:1; | ||
| 599 | uint32_t padding2:1; | ||
| 600 | } __attribute__((packed)); | ||
| 601 | struct { | ||
| 602 | uint32_t rleng_id:2; | ||
| 603 | uint32_t padding3:8; | ||
| 604 | uint32_t runlist_pri_base:16; | ||
| 605 | uint32_t padding4:6; | ||
| 606 | } __attribute__((packed)); | ||
| 607 | uint32_t raw; | ||
| 608 | } ptop_device_info_ga100_t; | ||
| 609 | |||
| 610 | // These field are from open-gpu-doc/manuals/volta/gv100/dev_top.ref.txt | ||
| 570 | typedef union { | 611 | typedef union { |
| 571 | // DATA type fields | 612 | // DATA type fields |
| 572 | struct { | 613 | struct { |
| @@ -604,7 +645,7 @@ typedef union { | |||
| 604 | uint32_t padding9:1; | 645 | uint32_t padding9:1; |
| 605 | } __attribute__((packed)); | 646 | } __attribute__((packed)); |
| 606 | uint32_t raw; | 647 | uint32_t raw; |
| 607 | } ptop_device_info_t; | 648 | } ptop_device_info_gk104_t; |
| 608 | 649 | ||
| 609 | /* Graphics Processing Cluster (GPC) information | 650 | /* Graphics Processing Cluster (GPC) information |
| 610 | The GPU's Compute/Graphics engine is subdivided into Graphics Processing | 651 | The GPU's Compute/Graphics engine is subdivided into Graphics Processing |
