xref: /linux/drivers/gpu/drm/amd/amdgpu/amdgpu_lsdma.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
11b491330SLikun Gao /*
21b491330SLikun Gao  * Copyright 2022 Advanced Micro Devices, Inc.
31b491330SLikun Gao  *
41b491330SLikun Gao  * Permission is hereby granted, free of charge, to any person obtaining a
51b491330SLikun Gao  * copy of this software and associated documentation files (the "Software"),
61b491330SLikun Gao  * to deal in the Software without restriction, including without limitation
71b491330SLikun Gao  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
81b491330SLikun Gao  * and/or sell copies of the Software, and to permit persons to whom the
91b491330SLikun Gao  * Software is furnished to do so, subject to the following conditions:
101b491330SLikun Gao  *
111b491330SLikun Gao  * The above copyright notice and this permission notice shall be included in
121b491330SLikun Gao  * all copies or substantial portions of the Software.
131b491330SLikun Gao  *
141b491330SLikun Gao  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
151b491330SLikun Gao  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
161b491330SLikun Gao  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
171b491330SLikun Gao  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
181b491330SLikun Gao  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
191b491330SLikun Gao  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
201b491330SLikun Gao  * OTHER DEALINGS IN THE SOFTWARE.
211b491330SLikun Gao  *
221b491330SLikun Gao  */
231b491330SLikun Gao 
241b491330SLikun Gao #ifndef __AMDGPU_LSDMA_H__
251b491330SLikun Gao #define __AMDGPU_LSDMA_H__
261b491330SLikun Gao 
271b491330SLikun Gao struct amdgpu_lsdma {
281b491330SLikun Gao 	const struct amdgpu_lsdma_funcs      *funcs;
291b491330SLikun Gao };
301b491330SLikun Gao 
311b491330SLikun Gao struct amdgpu_lsdma_funcs {
32f932ffbbSLikun Gao 	int (*copy_mem)(struct amdgpu_device *adev, uint64_t src_addr,
33f932ffbbSLikun Gao 			uint64_t dst_addr, uint64_t size);
34d9b9aaaeSLikun Gao 	int (*fill_mem)(struct amdgpu_device *adev, uint64_t dst_addr,
35d9b9aaaeSLikun Gao 			uint32_t data, uint64_t size);
36*41967850SLikun Gao 	void (*update_memory_power_gating)(struct amdgpu_device *adev, bool enable);
371b491330SLikun Gao };
381b491330SLikun Gao 
39f932ffbbSLikun Gao int amdgpu_lsdma_copy_mem(struct amdgpu_device *adev, uint64_t src_addr,
40f932ffbbSLikun Gao 			  uint64_t dst_addr, uint64_t mem_size);
41d9b9aaaeSLikun Gao int amdgpu_lsdma_fill_mem(struct amdgpu_device *adev, uint64_t dst_addr,
42d9b9aaaeSLikun Gao 			  uint32_t data, uint64_t mem_size);
43d9b9aaaeSLikun Gao int amdgpu_lsdma_wait_for(struct amdgpu_device *adev, uint32_t reg_index,
44d9b9aaaeSLikun Gao 			  uint32_t reg_val, uint32_t mask);
45f932ffbbSLikun Gao 
461b491330SLikun Gao #endif
47