For future ASIC support the driver allows user to map certain regions in the device's configuration space for direct access from userspace.
Showing the changes to include/uapi (1 of 6 files). Show all
Unified · Split
| @@ -718,6 +718,8 @@ union hl_wait_cs_args { · 717 unmodified lines | ||
| 718 | 718 | #define HL_MEM_OP_MAP 2 |
| 719 | 719 | /* Opcode to unmap previously mapped host and device memory */ |
| 720 | 720 | #define HL_MEM_OP_UNMAP 3 |
| 721 | +/* Opcode to map a hw block */ | |
| 722 | +#define HL_MEM_OP_MAP_BLOCK 4 | |
| 721 | 723 | |
| 722 | 724 | /* Memory flags */ |
| 723 | 725 | #define HL_MEM_CONTIGUOUS 0x1 |
| @@ -772,6 +774,17 @@ struct hl_mem_in { · 48 unmodified lines | ||
| 772 | 774 | __u64 mem_size; |
| 773 | 775 | } map_host; |
| 774 | 776 | |
| 777 | + /* HL_MEM_OP_MAP_BLOCK - map a hw block */ | |
| 778 | + struct { | |
| 779 | + /* | |
| 780 | + * HW block address to map, a handle will be returned | |
| 781 | + * to the user and will be used to mmap the relevant | |
| 782 | + * block. Only addresses from configuration space are | |
| 783 | + * allowed. | |
| 784 | + */ | |
| 785 | + __u64 block_addr; | |
| 786 | + } map_block; | |
| 787 | + | |
| 775 | 788 | /* HL_MEM_OP_UNMAP - unmap host memory */ |
| 776 | 789 | struct { |
| 777 | 790 | /* Virtual address returned from HL_MEM_OP_MAP */ |
| @@ -798,8 +811,9 @@ struct hl_mem_out { · 20 unmodified lines | ||
| 798 | 811 | __u64 device_virt_addr; |
| 799 | 812 | |
| 800 | 813 | /* |
| 801 | − * Used for HL_MEM_OP_ALLOC. This is the assigned | |
| 802 | − * handle for the allocated memory | |
| 814 | + * Used for HL_MEM_OP_ALLOC and HL_MEM_OP_MAP_BLOCK. | |
| 815 | + * This is the assigned handle for the allocated memory | |
| 816 | + * or mapped block | |
| 803 | 817 | */ |
| 804 | 818 | __u64 handle; |
| 805 | 819 | }; |