Loading drivers/gpu/drm/amd/powerplay/Makefile +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ AMD_POWERPLAY = $(addsuffix /Makefile,$(addprefix $(FULL_AMD_PATH)/powerplay/,$( include $(AMD_POWERPLAY) POWER_MGR = amd_powerplay.o amdgpu_smu.o POWER_MGR = amd_powerplay.o amdgpu_smu.o smu_v11_0.o AMD_PP_POWER = $(addprefix $(AMD_PP_PATH)/,$(POWER_MGR)) Loading drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +20 −0 Original line number Diff line number Diff line Loading @@ -26,9 +26,20 @@ #include "amdgpu.h" #include "amdgpu_smu.h" #include "soc15_common.h" #include "smu_v11_0.h" static int smu_set_funcs(struct amdgpu_device *adev) { struct smu_context *smu = &adev->smu; switch (adev->asic_type) { case CHIP_VEGA20: smu_v11_0_set_smu_funcs(smu); break; default: return -EINVAL; } return 0; } Loading Loading @@ -164,3 +175,12 @@ const struct amd_ip_funcs smu_ip_funcs = { .set_clockgating_state = smu_set_clockgating_state, .set_powergating_state = smu_set_powergating_state, }; const struct amdgpu_ip_block_version smu_v11_0_ip_block = { .type = AMD_IP_BLOCK_TYPE_SMC, .major = 11, .minor = 0, .rev = 0, .funcs = &smu_ip_funcs, }; drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +2 −0 Original line number Diff line number Diff line Loading @@ -42,4 +42,6 @@ struct smu_funcs extern const struct amd_ip_funcs smu_ip_funcs; extern const struct amdgpu_ip_block_version smu_v11_0_ip_block; #endif drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h 0 → 100644 +30 −0 Original line number Diff line number Diff line /* * Copyright 2019 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * */ #ifndef __SMU_V11_0_H__ #define __SMU_V11_0_H__ #include "amdgpu_smu.h" void smu_v11_0_set_smu_funcs(struct smu_context *smu); #endif drivers/gpu/drm/amd/powerplay/smu_v11_0.c 0 → 100644 +42 −0 Original line number Diff line number Diff line /* * Copyright 2019 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #include "pp_debug.h" #include <linux/firmware.h> #include "amdgpu.h" #include "amdgpu_smu.h" static int smu_v11_0_init_microcode(struct smu_context *smu) { struct amdgpu_device *adev = smu->adev; return 0; } static const struct smu_funcs smu_v11_0_funcs = { .init_microcode = smu_v11_0_init_microcode, }; void smu_v11_0_set_smu_funcs(struct smu_context *smu) { smu->funcs = &smu_v11_0_funcs; } Loading
drivers/gpu/drm/amd/powerplay/Makefile +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ AMD_POWERPLAY = $(addsuffix /Makefile,$(addprefix $(FULL_AMD_PATH)/powerplay/,$( include $(AMD_POWERPLAY) POWER_MGR = amd_powerplay.o amdgpu_smu.o POWER_MGR = amd_powerplay.o amdgpu_smu.o smu_v11_0.o AMD_PP_POWER = $(addprefix $(AMD_PP_PATH)/,$(POWER_MGR)) Loading
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +20 −0 Original line number Diff line number Diff line Loading @@ -26,9 +26,20 @@ #include "amdgpu.h" #include "amdgpu_smu.h" #include "soc15_common.h" #include "smu_v11_0.h" static int smu_set_funcs(struct amdgpu_device *adev) { struct smu_context *smu = &adev->smu; switch (adev->asic_type) { case CHIP_VEGA20: smu_v11_0_set_smu_funcs(smu); break; default: return -EINVAL; } return 0; } Loading Loading @@ -164,3 +175,12 @@ const struct amd_ip_funcs smu_ip_funcs = { .set_clockgating_state = smu_set_clockgating_state, .set_powergating_state = smu_set_powergating_state, }; const struct amdgpu_ip_block_version smu_v11_0_ip_block = { .type = AMD_IP_BLOCK_TYPE_SMC, .major = 11, .minor = 0, .rev = 0, .funcs = &smu_ip_funcs, };
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +2 −0 Original line number Diff line number Diff line Loading @@ -42,4 +42,6 @@ struct smu_funcs extern const struct amd_ip_funcs smu_ip_funcs; extern const struct amdgpu_ip_block_version smu_v11_0_ip_block; #endif
drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h 0 → 100644 +30 −0 Original line number Diff line number Diff line /* * Copyright 2019 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * */ #ifndef __SMU_V11_0_H__ #define __SMU_V11_0_H__ #include "amdgpu_smu.h" void smu_v11_0_set_smu_funcs(struct smu_context *smu); #endif
drivers/gpu/drm/amd/powerplay/smu_v11_0.c 0 → 100644 +42 −0 Original line number Diff line number Diff line /* * Copyright 2019 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #include "pp_debug.h" #include <linux/firmware.h> #include "amdgpu.h" #include "amdgpu_smu.h" static int smu_v11_0_init_microcode(struct smu_context *smu) { struct amdgpu_device *adev = smu->adev; return 0; } static const struct smu_funcs smu_v11_0_funcs = { .init_microcode = smu_v11_0_init_microcode, }; void smu_v11_0_set_smu_funcs(struct smu_context *smu) { smu->funcs = &smu_v11_0_funcs; }