Skip to contentSkip to conversation

drm/amd/pp: Initialize default thermal control type for each asic

PATCH In review Rex Zhu 2 participants 3 messages Mar 21, 2018 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Rex Zhu

author
#0 lore raw

PATCH 1/2 drm/amd/pp: Initialize default thermal control type for each asic

Change-Id: I4e1b3f4bc66f28cc6a015182452d426ddd611224

---
 drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c        | 9 +++++++++
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 2 +-
 drivers/gpu/drm/amd/powerplay/inc/hwmgr.h          | 1 +
 3 files changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +9 -0
index 6318438..3f1e822 100644
@@ -33,6 +33,8 @@
 #include "ppsmc.h"
 #include "amd_acpi.h"
 #include "pp_psm.h"
+#include "atombios.h"
+#include "pptable.h"
 
 extern const struct pp_smumgr_func ci_smu_funcs;
 extern const struct pp_smumgr_func smu8_smu_funcs;
@@ -87,6 +89,7 @@ int hwmgr_early_init(struct pp_hwmgr *hwmgr)
 	hwmgr->fan_ctrl_is_in_default_mode = true;
 	hwmgr->reload_fw = 1;
 	hwmgr_init_workload_prority(hwmgr);
+	hwmgr->default_thermal_ctrl_type = ATOM_PP_THERMALCONTROLLER_NONE;
 
 	switch (hwmgr->chip_family) {
 	case AMDGPU_FAMILY_CI:
@@ -139,6 +142,7 @@ int hwmgr_early_init(struct pp_hwmgr *hwmgr)
 	case AMDGPU_FAMILY_AI:
 		switch (hwmgr->chip_id) {
 		case CHIP_VEGA10:
+			hwmgr->default_thermal_ctrl_type = ATOM_PP_THERMALCONTROLLER_VEGA10;
 			hwmgr->smumgr_funcs = &vega10_smu_funcs;
 			vega10_hwmgr_init(hwmgr);
 			break;
@@ -418,6 +422,7 @@ int polaris_set_asic_special_caps(struct pp_hwmgr *hwmgr)
 		phm_cap_set(hwmgr->platform_descriptor.platformCaps,
 							PHM_PlatformCaps_TCPRamping);
 	}
+	hwmgr->default_thermal_ctrl_type = ATOM_PP_THERMALCONTROLLER_POLARIS10;
 	return 0;
 }
 
@@ -433,6 +438,7 @@ int fiji_set_asic_special_caps(struct pp_hwmgr *hwmgr)
 			PHM_PlatformCaps_TDRamping);
 	phm_cap_unset(hwmgr->platform_descriptor.platformCaps,
 			PHM_PlatformCaps_TCPRamping);
+	hwmgr->default_thermal_ctrl_type = ATOM_PP_THERMALCONTROLLER_FIJI;
 	return 0;
 }
 
@@ -453,6 +459,7 @@ int tonga_set_asic_special_caps(struct pp_hwmgr *hwmgr)
 		      PHM_PlatformCaps_UVDPowerGating);
 	phm_cap_unset(hwmgr->platform_descriptor.platformCaps,
 		      PHM_PlatformCaps_VCEPowerGating);
+	hwmgr->default_thermal_ctrl_type = ATOM_PP_THERMALCONTROLLER_TONGA;
 	return 0;
 }
 
@@ -468,6 +475,7 @@ int topaz_set_asic_special_caps(struct pp_hwmgr *hwmgr)
 			PHM_PlatformCaps_TDRamping);
 	phm_cap_unset(hwmgr->platform_descriptor.platformCaps,
 			PHM_PlatformCaps_TCPRamping);
+	hwmgr->default_thermal_ctrl_type = ATOM_PP_THERMALCONTROLLER_ICELAND;
 	return 0;
 }
 
@@ -485,5 +493,6 @@ int ci_set_asic_special_caps(struct pp_hwmgr *hwmgr)
 			PHM_PlatformCaps_MemorySpreadSpectrumSupport);
 	phm_cap_set(hwmgr->platform_descriptor.platformCaps,
 			PHM_PlatformCaps_EngineSpreadSpectrumSupport);
+	hwmgr->default_thermal_ctrl_type = ATOM_PP_THERMALCONTROLLER_CISLANDS;
 	return 0;
 }
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1 -1
index 7bb9dd9..f177183 100644
@@ -4830,7 +4830,7 @@ static int vega10_register_irq_handlers(struct pp_hwmgr *hwmgr)
 	source->funcs = &vega10_irq_funcs;
 
 	if (hwmgr->thermal_controller.ucType ==
-			ATOM_VEGA10_PP_THERMALCONTROLLER_VEGA10 ||
+			hwmgr->default_thermal_ctrl_type ||
 		hwmgr->thermal_controller.ucType ==
 			ATOM_VEGA10_PP_THERMALCONTROLLER_EMC2103_WITH_INTERNAL) {
 
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +1 -0
index efdcf31..f32d5db 100644
@@ -720,6 +720,7 @@ struct pp_hwmgr {
 	uint32_t usec_timeout;
 	void *pptable;
 	struct phm_platform_descriptor platform_descriptor;
+	uint8_t default_thermal_ctrl_type;
 	void *backend;
 
 	void *smu_backend;
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1521611488-22447-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org

author
#2 lore raw

PATCH 2/2 drm/amd/pp: Register smu irq for legacy asics

Change-Id I1927175adfecbcfe99908f06959f8c0a507d3278
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 33 ++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +33 -0
index 8a81360..5323f74 100644
@@ -3996,8 +3996,41 @@ static int smu7_set_max_fan_rpm_output(struct pp_hwmgr *hwmgr, uint16_t us_max_f
 			PPSMC_MSG_SetFanRpmMax, us_max_fan_rpm);
 }
 
+static const struct amdgpu_irq_src_funcs smu7_irq_funcs = {
+	.process = phm_irq_process,
+};
+
 static int smu7_register_irq_handlers(struct pp_hwmgr *hwmgr)
 {
+	struct amdgpu_irq_src *source =
+		kzalloc(sizeof(struct amdgpu_irq_src), GFP_KERNEL);
+
+	if (!source)
+		return -ENOMEM;
+
+	source->funcs = &smu7_irq_funcs;
+
+	if (hwmgr->thermal_controller.ucType ==
+			hwmgr->default_thermal_ctrl_type ||
+		hwmgr->thermal_controller.ucType ==
+			ATOM_TONGA_PP_THERMALCONTROLLER_EMC2103_WITH_INTERNAL) {
+
+		amdgpu_irq_add_id((struct amdgpu_device *)(hwmgr->adev),
+				AMDGPU_IH_CLIENTID_LEGACY,
+				230,
+				source);
+		amdgpu_irq_add_id((struct amdgpu_device *)(hwmgr->adev),
+				AMDGPU_IH_CLIENTID_LEGACY,
+				231,
+				source);
+	}
+
+	/* Register CTF(GPIO_19) interrupt */
+	amdgpu_irq_add_id((struct amdgpu_device *)(hwmgr->adev),
+			AMDGPU_IH_CLIENTID_LEGACY,
+			83,
+			source);
+
 	return 0;
 }
 
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1521611488-22447-2-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#4 lore raw

Re: [PATCH 2/2] drm/amd/pp: Register smu irq for legacy asics

Series is:

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Rex Zhu <[email protected]>
Sent: Wednesday, March 21, 2018 1:51:28 AM
To: [email protected]
Cc: Zhu, Rex
Subject: [PATCH 2/2] drm/amd/pp: Register smu irq for legacy asics

Change-Id I1927175adfecbcfe99908f06959f8c0a507d3278
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 33 ++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +33 -0
index 8a81360..5323f74 100644
@@ -3996,8 +3996,41 @@ static int smu7_set_max_fan_rpm_output(struct pp_hwmgr *hwmgr, uint16_t us_max_f
                         PPSMC_MSG_SetFanRpmMax, us_max_fan_rpm);
 }
 
+static const struct amdgpu_irq_src_funcs smu7_irq_funcs = {
+       .process = phm_irq_process,
+};
+
 static int smu7_register_irq_handlers(struct pp_hwmgr *hwmgr)
 {
+       struct amdgpu_irq_src *source =
+               kzalloc(sizeof(struct amdgpu_irq_src), GFP_KERNEL);
+
+       if (!source)
+               return -ENOMEM;
+
+       source->funcs = &smu7_irq_funcs;
+
+       if (hwmgr->thermal_controller.ucType ==
+                       hwmgr->default_thermal_ctrl_type ||
+               hwmgr->thermal_controller.ucType ==
+                       ATOM_TONGA_PP_THERMALCONTROLLER_EMC2103_WITH_INTERNAL) {
+
+               amdgpu_irq_add_id((struct amdgpu_device *)(hwmgr->adev),
+                               AMDGPU_IH_CLIENTID_LEGACY,
+                               230,
+                               source);
+               amdgpu_irq_add_id((struct amdgpu_device *)(hwmgr->adev),
+                               AMDGPU_IH_CLIENTID_LEGACY,
+                               231,
+                               source);
+       }
+
+       /* Register CTF(GPIO_19) interrupt */
+       amdgpu_irq_add_id((struct amdgpu_device *)(hwmgr->adev),
+                       AMDGPU_IH_CLIENTID_LEGACY,
+                       83,
+                       source);
+
         return 0;
 }
 

--
1.9.1

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx