Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: add lsdma block

Add Light SDMA (LSDMA) block and related function. LSDMA
is a small instance of SDMA mainly for kernel driver use.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Likun Gao and committed by
Alex Deucher
1b491330 81570d6d

+134 -2
+2 -2
drivers/gpu/drm/amd/amdgpu/Makefile
··· 58 58 amdgpu_vm_sdma.o amdgpu_discovery.o amdgpu_ras_eeprom.o amdgpu_nbio.o \ 59 59 amdgpu_umc.o smu_v11_0_i2c.o amdgpu_fru_eeprom.o amdgpu_rap.o \ 60 60 amdgpu_fw_attestation.o amdgpu_securedisplay.o \ 61 - amdgpu_eeprom.o amdgpu_mca.o amdgpu_psp_ta.o 61 + amdgpu_eeprom.o amdgpu_mca.o amdgpu_psp_ta.o amdgpu_lsdma.o 62 62 63 63 amdgpu-$(CONFIG_PROC_FS) += amdgpu_fdinfo.o 64 64 ··· 75 75 vi.o mxgpu_vi.o nbio_v6_1.o soc15.o emu_soc.o mxgpu_ai.o nbio_v7_0.o vega10_reg_init.o \ 76 76 vega20_reg_init.o nbio_v7_4.o nbio_v2_3.o nv.o arct_reg_init.o mxgpu_nv.o \ 77 77 nbio_v7_2.o hdp_v4_0.o hdp_v5_0.o aldebaran_reg_init.o aldebaran.o soc21.o \ 78 - nbio_v4_3.o hdp_v6_0.o nbio_v7_7.o hdp_v5_2.o 78 + nbio_v4_3.o hdp_v6_0.o nbio_v7_7.o hdp_v5_2.o lsdma_v6_0.o 79 79 80 80 # add DF block 81 81 amdgpu-y += \
+5
drivers/gpu/drm/amd/amdgpu/amdgpu.h
··· 86 86 #include "amdgpu_gmc.h" 87 87 #include "amdgpu_gfx.h" 88 88 #include "amdgpu_sdma.h" 89 + #include "amdgpu_lsdma.h" 89 90 #include "amdgpu_nbio.h" 90 91 #include "amdgpu_hdp.h" 91 92 #include "amdgpu_dm.h" ··· 644 643 SDMA5_HWIP, 645 644 SDMA6_HWIP, 646 645 SDMA7_HWIP, 646 + LSDMA_HWIP, 647 647 MMHUB_HWIP, 648 648 ATHUB_HWIP, 649 649 NBIO_HWIP, ··· 910 908 911 909 /* sdma */ 912 910 struct amdgpu_sdma sdma; 911 + 912 + /* lsdma */ 913 + struct amdgpu_lsdma lsdma; 913 914 914 915 /* uvd */ 915 916 struct amdgpu_uvd uvd;
+3
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
··· 66 66 #include "sdma_v5_0.h" 67 67 #include "sdma_v5_2.h" 68 68 #include "sdma_v6_0.h" 69 + #include "lsdma_v6_0.h" 69 70 #include "vcn_v2_0.h" 70 71 #include "jpeg_v2_0.h" 71 72 #include "vcn_v3_0.h" ··· 125 124 [SDMA1_HWID] = "SDMA1", 126 125 [SDMA2_HWID] = "SDMA2", 127 126 [SDMA3_HWID] = "SDMA3", 127 + [LSDMA_HWID] = "LSDMA", 128 128 [ISP_HWID] = "ISP", 129 129 [DBGU_IO_HWID] = "DBGU_IO", 130 130 [DF_HWID] = "DF", ··· 175 173 [SDMA1_HWIP] = SDMA1_HWID, 176 174 [SDMA2_HWIP] = SDMA2_HWID, 177 175 [SDMA3_HWIP] = SDMA3_HWID, 176 + [LSDMA_HWIP] = LSDMA_HWID, 178 177 [MMHUB_HWIP] = MMHUB_HWID, 179 178 [ATHUB_HWIP] = ATHUB_HWID, 180 179 [NBIO_HWIP] = NBIF_HWID,
+25
drivers/gpu/drm/amd/amdgpu/amdgpu_lsdma.c
··· 1 + /* 2 + * Copyright 2022 Advanced Micro Devices, Inc. 3 + * 4 + * Permission is hereby granted, free of charge, to any person obtaining a 5 + * copy of this software and associated documentation files (the "Software"), 6 + * to deal in the Software without restriction, including without limitation 7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 + * and/or sell copies of the Software, and to permit persons to whom the 9 + * Software is furnished to do so, subject to the following conditions: 10 + * 11 + * The above copyright notice and this permission notice shall be included in 12 + * all copies or substantial portions of the Software. 13 + * 14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 + * OTHER DEALINGS IN THE SOFTWARE. 21 + * 22 + */ 23 + 24 + #include "amdgpu.h" 25 + #include "amdgpu_lsdma.h"
+34
drivers/gpu/drm/amd/amdgpu/amdgpu_lsdma.h
··· 1 + /* 2 + * Copyright 2022 Advanced Micro Devices, Inc. 3 + * 4 + * Permission is hereby granted, free of charge, to any person obtaining a 5 + * copy of this software and associated documentation files (the "Software"), 6 + * to deal in the Software without restriction, including without limitation 7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 + * and/or sell copies of the Software, and to permit persons to whom the 9 + * Software is furnished to do so, subject to the following conditions: 10 + * 11 + * The above copyright notice and this permission notice shall be included in 12 + * all copies or substantial portions of the Software. 13 + * 14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 + * OTHER DEALINGS IN THE SOFTWARE. 21 + * 22 + */ 23 + 24 + #ifndef __AMDGPU_LSDMA_H__ 25 + #define __AMDGPU_LSDMA_H__ 26 + 27 + struct amdgpu_lsdma { 28 + const struct amdgpu_lsdma_funcs *funcs; 29 + }; 30 + 31 + struct amdgpu_lsdma_funcs { 32 + }; 33 + 34 + #endif
+33
drivers/gpu/drm/amd/amdgpu/lsdma_v6_0.c
··· 1 + /* 2 + * Copyright 2022 Advanced Micro Devices, Inc. 3 + * 4 + * Permission is hereby granted, free of charge, to any person obtaining a 5 + * copy of this software and associated documentation files (the "Software"), 6 + * to deal in the Software without restriction, including without limitation 7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 + * and/or sell copies of the Software, and to permit persons to whom the 9 + * Software is furnished to do so, subject to the following conditions: 10 + * 11 + * The above copyright notice and this permission notice shall be included in 12 + * all copies or substantial portions of the Software. 13 + * 14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 + * OTHER DEALINGS IN THE SOFTWARE. 21 + * 22 + */ 23 + 24 + #include <linux/delay.h> 25 + #include "amdgpu.h" 26 + #include "lsdma_v6_0.h" 27 + #include "amdgpu_lsdma.h" 28 + 29 + #include "lsdma/lsdma_6_0_0_offset.h" 30 + #include "lsdma/lsdma_6_0_0_sh_mask.h" 31 + 32 + const struct amdgpu_lsdma_funcs lsdma_v6_0_funcs = { 33 + };
+31
drivers/gpu/drm/amd/amdgpu/lsdma_v6_0.h
··· 1 + /* 2 + * Copyright 2022 Advanced Micro Devices, Inc. 3 + * 4 + * Permission is hereby granted, free of charge, to any person obtaining a 5 + * copy of this software and associated documentation files (the "Software"), 6 + * to deal in the Software without restriction, including without limitation 7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 + * and/or sell copies of the Software, and to permit persons to whom the 9 + * Software is furnished to do so, subject to the following conditions: 10 + * 11 + * The above copyright notice and this permission notice shall be included in 12 + * all copies or substantial portions of the Software. 13 + * 14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 + * OTHER DEALINGS IN THE SOFTWARE. 21 + * 22 + */ 23 + 24 + #ifndef __LSDMA_V6_0_H__ 25 + #define __LSDMA_V6_0_H__ 26 + 27 + #include "soc15_common.h" 28 + 29 + extern const struct amdgpu_lsdma_funcs lsdma_v6_0_funcs; 30 + 31 + #endif /* __LSDMA_V6_0_H__ */
+1
drivers/gpu/drm/amd/include/soc15_hw_ip.h
··· 86 86 #define PCS_HWID 80 87 87 #define DDCL_HWID 89 88 88 #define SST_HWID 90 89 + #define LSDMA_HWID 91 89 90 #define IOAGR_HWID 100 90 91 #define NBIF_HWID 108 91 92 #define IOAPIC_HWID 124