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

drm/amdgpu: add amdgpu_mmhub_funcs definition

add amdgpu_mmhub_funcs definition and initialize it,
prepare for mmhub ras enablement

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Tao Zhou and committed by
Alex Deucher
3d093da0 44494f96

+56
+2
drivers/gpu/drm/amd/amdgpu/amdgpu.h
··· 87 87 #include "amdgpu_discovery.h" 88 88 #include "amdgpu_mes.h" 89 89 #include "amdgpu_umc.h" 90 + #include "amdgpu_mmhub.h" 90 91 91 92 #define MAX_GPU_INSTANCE 16 92 93 ··· 977 976 978 977 const struct amdgpu_nbio_funcs *nbio_funcs; 979 978 const struct amdgpu_df_funcs *df_funcs; 979 + const struct amdgpu_mmhub_funcs *mmhub_funcs; 980 980 981 981 /* delayed work_func for deferring clockgating during resume */ 982 982 struct delayed_work delayed_init_work;
+31
drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.h
··· 1 + /* 2 + * Copyright (C) 2019 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 12 + * in all copies or substantial portions of the Software. 13 + * 14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 + * OR 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) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 18 + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 + */ 21 + #ifndef __AMDGPU_MMHUB_H__ 22 + #define __AMDGPU_MMHUB_H__ 23 + 24 + struct amdgpu_mmhub_funcs { 25 + void (*ras_init)(struct amdgpu_device *adev); 26 + void (*query_ras_error_count)(struct amdgpu_device *adev, 27 + void *ras_error_status); 28 + }; 29 + 30 + #endif 31 +
+12
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
··· 656 656 } 657 657 } 658 658 659 + static void gmc_v9_0_set_mmhub_funcs(struct amdgpu_device *adev) 660 + { 661 + switch (adev->asic_type) { 662 + case CHIP_VEGA20: 663 + adev->mmhub_funcs = &mmhub_v1_0_funcs; 664 + break; 665 + default: 666 + break; 667 + } 668 + } 669 + 659 670 static int gmc_v9_0_early_init(void *handle) 660 671 { 661 672 struct amdgpu_device *adev = (struct amdgpu_device *)handle; ··· 674 663 gmc_v9_0_set_gmc_funcs(adev); 675 664 gmc_v9_0_set_irq_funcs(adev); 676 665 gmc_v9_0_set_umc_funcs(adev); 666 + gmc_v9_0_set_mmhub_funcs(adev); 677 667 678 668 adev->gmc.shared_aperture_start = 0x2000000000000000ULL; 679 669 adev->gmc.shared_aperture_end =
+9
drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
··· 584 584 if (data & ATC_L2_MISC_CG__MEM_LS_ENABLE_MASK) 585 585 *flags |= AMD_CG_SUPPORT_MC_LS; 586 586 } 587 + 588 + static void mmhub_v1_0_query_ras_error_count(struct amdgpu_device *adev, 589 + void *ras_error_status) 590 + { 591 + } 592 + 593 + const struct amdgpu_mmhub_funcs mmhub_v1_0_funcs = { 594 + .query_ras_error_count = mmhub_v1_0_query_ras_error_count, 595 + };
+2
drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.h
··· 23 23 #ifndef __MMHUB_V1_0_H__ 24 24 #define __MMHUB_V1_0_H__ 25 25 26 + extern const struct amdgpu_mmhub_funcs mmhub_v1_0_funcs; 27 + 26 28 u64 mmhub_v1_0_get_fb_location(struct amdgpu_device *adev); 27 29 int mmhub_v1_0_gart_enable(struct amdgpu_device *adev); 28 30 void mmhub_v1_0_gart_disable(struct amdgpu_device *adev);