Skip to contentSkip to conversation

drm/amdgpu: Load TA ucode for PSP 15_0_0

PATCH Superseded Pratik Vishwakarma 3 participants 19 messages Feb 4

Subsystems (3)

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/11 drm/amdgpu: Load TA ucode for PSP 15_0_0

TOC and TA both are required

---
 drivers/gpu/drm/amd/amdgpu/psp_v15_0.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/psp_v15_0.c +4 -0
index 3aca293e2f0c..723ddae17644 100644
@@ -45,6 +45,10 @@ static int psp_v15_0_0_init_microcode(struct psp_context *psp)
 	if (err)
 		return err;
 
+	err = psp_init_ta_microcode(psp, ucode_prefix);
+	if (err)
+		return err;
+
 	return 0;
 }
 
Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 2/11 drm/amd/swsmu: Add new param regs for SMU15

Some SMU messages have changed to multi reg read/write Initialize during smu_early_init

---
 drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c +9 -1
index c3f22844ba2f..d58b0bc2bf78 100644
@@ -52,6 +52,12 @@
 #define mmMP1_SMN_C2PMSG_32			0x0060
 #define mmMP1_SMN_C2PMSG_32_BASE_IDX		    1
 
+#define mmMP1_SMN_C2PMSG_33                   0x0061
+#define mmMP1_SMN_C2PMSG_33_BASE_IDX                  1
+
+#define mmMP1_SMN_C2PMSG_34                   0x0062
+#define mmMP1_SMN_C2PMSG_34_BASE_IDX                  1
+
 /* MALLPowerController message arguments (Defines for the Cache mode control) */
 #define SMU_MALL_PMFW_CONTROL 0
 #define SMU_MALL_DRIVER_CONTROL 1
@@ -1347,7 +1353,9 @@ static void smu_v15_0_0_init_msg_ctl(struct smu_context *smu)
 	ctl->config.msg_reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_30);
 	ctl->config.resp_reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_31);
 	ctl->config.arg_regs[0] = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_32);
-	ctl->config.num_arg_regs = 1;
+	ctl->config.arg_regs[1] = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_33);
+	ctl->config.arg_regs[2] = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_34);
+	ctl->config.num_arg_regs = 3;
 	ctl->ops = &smu_msg_v1_ops;
 	ctl->default_timeout = adev->usec_timeout * 20;
 	ctl->message_map = smu_v15_0_0_message_map;
Signature · 1 line
2.43.0
Acked-by on v2 2/11
#2 lore raw

Re: [PATCH v2 02/11] drm/amd/swsmu: Add new param regs for SMU15

Quoted 5 lines · Pratik Vishwakarma

Some SMU messages have changed to multi reg read/write Initialize during smu_early_init

Quoted 35 lines
---
 drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c +9 -2
index c3f22844ba2f..d58b0bc2bf78 100644
@@ -52,6 +52,12 @@
 #define mmMP1_SMN_C2PMSG_32                    0x0060
 #define mmMP1_SMN_C2PMSG_32_BASE_IDX               1
 
+#define mmMP1_SMN_C2PMSG_33                   0x0061
+#define mmMP1_SMN_C2PMSG_33_BASE_IDX                  1
+
+#define mmMP1_SMN_C2PMSG_34                   0x0062
+#define mmMP1_SMN_C2PMSG_34_BASE_IDX                  1
+
 /* MALLPowerController message arguments (Defines for the Cache mode control) */
 #define SMU_MALL_PMFW_CONTROL 0
 #define SMU_MALL_DRIVER_CONTROL 1
@@ -1347,7 +1353,9 @@ static void smu_v15_0_0_init_msg_ctl(struct smu_context *smu)
        ctl->config.msg_reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_30);
        ctl->config.resp_reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_31);
        ctl->config.arg_regs[0] = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_32);
-       ctl->config.num_arg_regs = 1;
+       ctl->config.arg_regs[1] = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_33);
+       ctl->config.arg_regs[2] = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_34);
+       ctl->config.num_arg_regs = 3;
        ctl->ops = &smu_msg_v1_ops;
        ctl->default_timeout = adev->usec_timeout * 20;
        ctl->message_map = smu_v15_0_0_message_map;
--

2.43.0

#3 lore raw

PATCH v2 3/11 drm/amdgpu: Add support for update_table for SMU15

In reply to Pratik Vishwakarma

Add update_table for SMU 15_0_0

---
 drivers/gpu/drm/amd/pm/swsmu/inc/smu_v15_0.h  |  5 ++
 .../gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c    | 68 +++++++++++++++++++
 2 files changed, 73 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v15_0.h +5 -0
index 14e8d8c7a80a..af87c31ca9a4 100644
@@ -241,5 +241,10 @@ int smu_v15_0_enable_thermal_alert(struct smu_context *smu);
 
 int smu_v15_0_disable_thermal_alert(struct smu_context *smu);
 
+int smu_v15_0_0_update_table(struct smu_context *smu,
+			 enum smu_table_id table_index,
+			 int argument, void *table_data,
+			 bool drv2smu);
+
 #endif
 #endif
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c +68 -0

74 lines not on this page · raw message

Signature · 1 line
2.43.0
#4 lore raw

Re: [PATCH v2 03/11] drm/amdgpu: Add support for update_table for SMU15

Quoted 59 lines · Pratik Vishwakarma

Add update_table for SMU 15_0_0

---
  drivers/gpu/drm/amd/pm/swsmu/inc/smu_v15_0.h  |  5 ++
  .../gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c    | 68 +++++++++++++++++++
  2 files changed, 73 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v15_0.h +5 -0
index 14e8d8c7a80a..af87c31ca9a4 100644
@@ -241,5 +241,10 @@ int smu_v15_0_enable_thermal_alert(struct smu_context *smu);
 
  int smu_v15_0_disable_thermal_alert(struct smu_context *smu);
 
+int smu_v15_0_0_update_table(struct smu_context *smu,
+			 enum smu_table_id table_index,
+			 int argument, void *table_data,
+			 bool drv2smu);
+
  #endif
  #endif
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c +28 -0
index a2854d528bab..d3dc7583ce4d 100644
@@ -1726,6 +1726,74 @@ int smu_v15_0_set_gfx_power_up_by_imu(struct smu_context *smu)
  	return ret;
  }
 
+int smu_v15_0_0_update_table(struct smu_context *smu,
+			 enum smu_table_id table_index,
+			 int argument,
+			 void *table_data,
+			 bool drv2smu)
+{
+	struct smu_table_context *smu_table = &smu->smu_table;
+	struct amdgpu_device *adev = smu->adev;
+	struct smu_table *table = &smu_table->driver_table;
+	int table_id = smu_cmn_to_asic_specific_index(smu,
+						      CMN2ASIC_MAPPING_TABLE,
+						      table_index);
+	struct smu_table *memory_pool = &smu_table->memory_pool;
+	uint64_t address;
+	uint32_t table_size;
+	int ret = 0;
+	u32 param[SMU_MSG_MAX_ARGS] = {};
+	struct smu_msg_ctl *ctl = &smu->msg_ctl;
+
+	if (!table_data || table_index >= SMU_TABLE_COUNT || table_id < 0)
+		return -EINVAL;
+
+	table_size = smu_table->tables[table_index].size;
+
+	if (drv2smu) {
+		memcpy(table->cpu_addr, table_data, table_size);
+		/*
+		 * Flush hdp cache: to guard the content seen by

drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c int smu_v15_0_set_gfx_power_up_by_imu(struct smu_context *smu) · line 1766

Quoted 10 lines
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c +10 -0
+		 * GPU is consitent with CPU.
+		 */
+		amdgpu_hdp_flush(adev, NULL);
+	}
+
+	if (memory_pool->size == 0 || memory_pool->cpu_addr == NULL)
+		return ret;
+
+	param[0] = table_id;
+	address = memory_pool->mc_address;

This assignment doesn't look correct, could you confirm again? For example for drv2smu, this logic copies the data to table cpu address and what is passed here looks like a different one altogether.

drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c int smu_v15_0_set_gfx_power_up_by_imu(struct smu_context *smu) · line 1769

Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c +3 -0
+	param[1] = (uint32_t)lower_32_bits(address);
+	param[2] = (uint32_t)upper_32_bits(address);
+

Looks like these param assignments are no longer needed.

Thanks,
Lijo

Quoted 30 lines
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c +27 -0
+	struct smu_msg_args args = {
+		.msg = drv2smu ?
+				SMU_MSG_TransferTableDram2Smu :
+				SMU_MSG_TransferTableSmu2Dram,
+		.num_args = 3,
+		.num_out_args = 0,
+		.flags = SMU_MSG_FLAG_ASYNC | SMU_MSG_FLAG_LOCK_HELD,
+		.timeout = 0,
+	};
+
+	args.args[0] = table_id;
+	args.args[1] = (uint32_t)lower_32_bits(address);
+	args.args[2] = (uint32_t)upper_32_bits(address);
+
+	ctl->ops->send_msg(ctl, &args);
+
+	if (ret)
+		return ret;
+
+	if (!drv2smu) {
+		amdgpu_hdp_invalidate(adev, NULL);
+		memcpy(table_data, table->cpu_addr, table_size);
+	}
+
+	return 0;
+}
+
  int smu_v15_0_set_default_dpm_tables(struct smu_context *smu)
  {
  	struct smu_table_context *smu_table = &smu->smu_table;
#5 lore raw

PATCH v2 4/11 drm/admgpu: Update metrics_table for SMU15

In reply to Pratik Vishwakarma

Use multi param based get op for metrics_table

---
 .../drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c  | 34 +++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c +32 -2
index d58b0bc2bf78..2987ff1b13e4 100644
@@ -246,6 +246,36 @@ static int smu_v15_0_0_system_features_control(struct smu_context *smu, bool en)
 	return ret;
 }
 
+static int smu_v15_0_0_get_metrics_table(struct smu_context *smu,
+							void *metrics_table,
+							bool bypass_cache)
+{
+	struct smu_table_context *smu_table = &smu->smu_table;
+	uint32_t table_size =
+			smu_table->tables[SMU_TABLE_SMU_METRICS].size;
+	int ret = 0;
+
+	if (bypass_cache ||
+		!smu_table->metrics_time ||
+		time_after(jiffies, smu_table->metrics_time + msecs_to_jiffies(1))) {
+		ret = smu_v15_0_0_update_table(smu,
+						SMU_TABLE_SMU_METRICS,
+						0,
+						smu_table->metrics_table,
+						false);
+		if (ret) {
+			dev_info(smu->adev->dev, "Failed to export SMU15_0_0 metrics table!\n");
+			return ret;
+		}
+		smu_table->metrics_time = jiffies;
+	}
+
+	if (metrics_table)
+		memcpy(metrics_table, smu_table->metrics_table, table_size);
+
+	return 0;
+}
+
 static int smu_v15_0_0_get_smu_metrics_data(struct smu_context *smu,
 					    MetricsMember_t member,
 					    uint32_t *value)
@@ -255,7 +285,7 @@ static int smu_v15_0_0_get_smu_metrics_data(struct smu_context *smu,
 	SmuMetrics_t *metrics = (SmuMetrics_t *)smu_table->metrics_table;
 	int ret = 0;
 
-	ret = smu_cmn_get_metrics_table(smu, NULL, false);
+	ret = smu_v15_0_0_get_metrics_table(smu, NULL, false);
 	if (ret)
 		return ret;
 
@@ -530,7 +560,7 @@ static ssize_t smu_v15_0_0_get_gpu_metrics(struct smu_context *smu,
 	SmuMetrics_t metrics;
 	int ret = 0;
 
-	ret = smu_cmn_get_metrics_table(smu, &metrics, true);
+	ret = smu_v15_0_0_get_metrics_table(smu, &metrics, true);
 	if (ret)
 		return ret;
 
Signature · 1 line
2.43.0
#6 lore raw

PATCH v2 5/11 drm/amdgpu: Fix set_default_dpm_tables

In reply to Pratik Vishwakarma

Use smu_v15_0_0_update_table instead of common api

---
 drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c +1 -1
index d3dc7583ce4d..e8dbf3d6009d 100644
@@ -1798,7 +1798,7 @@ int smu_v15_0_set_default_dpm_tables(struct smu_context *smu)
 {
 	struct smu_table_context *smu_table = &smu->smu_table;
 
-	return smu_cmn_update_table(smu, SMU_TABLE_DPMCLOCKS, 0,
+	return smu_v15_0_0_update_table(smu, SMU_TABLE_DPMCLOCKS, 0,
 				    smu_table->clocks_table, false);
 }
 
Signature · 1 line
2.43.0
#7 lore raw

PATCH v2 6/11 drm/amdgpu: Fix is_dpm_running

In reply to Pratik Vishwakarma

Use multi args for get_enabled_mask to fix is_dpm_running

---
 .../drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c  | 35 +++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c +33 -2
index 2987ff1b13e4..f90d274c0f67 100644
@@ -479,12 +479,43 @@ static int smu_v15_0_0_read_sensor(struct smu_context *smu,
 	return ret;
 }
 
+static int smu_v15_0_0_get_enabled_mask(struct smu_context *smu,
+					struct smu_feature_bits *feature_mask)
+{
+	uint32_t *feature_mask_high;
+	uint32_t *feature_mask_low;
+	int ret = 0;
+	struct smu_msg_ctl *ctl = &smu->msg_ctl;
+
+	if (!feature_mask)
+		return -EINVAL;
+
+	feature_mask_low = &((uint32_t *)feature_mask)[0];
+	feature_mask_high = &((uint32_t *)feature_mask)[1];
+
+	struct smu_msg_args args = {
+		.msg = SMU_MSG_GetEnabledSmuFeatures,
+		.num_args = 0,
+		.num_out_args = 2,
+	};
+
+	ret = ctl->ops->send_msg(ctl, &args);
+
+	if (ret)
+		return ret;
+
+	*feature_mask_low = args.out_args[0];
+	*feature_mask_high = args.out_args[1];
+
+	return ret;
+}
+
 static bool smu_v15_0_0_is_dpm_running(struct smu_context *smu)
 {
 	int ret = 0;
 	struct smu_feature_bits feature_enabled;
 
-	ret = smu_cmn_get_enabled_mask(smu, &feature_enabled);
+	ret = smu_v15_0_0_get_enabled_mask(smu, &feature_enabled);
 
 	if (ret)
 		return false;
@@ -1356,7 +1387,7 @@ static const struct pptable_funcs smu_v15_0_0_ppt_funcs = {
 	.is_dpm_running = smu_v15_0_0_is_dpm_running,
 	.set_watermarks_table = smu_v15_0_0_set_watermarks_table,
 	.get_gpu_metrics = smu_v15_0_0_get_gpu_metrics,
-	.get_enabled_mask = smu_cmn_get_enabled_mask,
+	.get_enabled_mask = smu_v15_0_0_get_enabled_mask,
 	.get_pp_feature_mask = smu_cmn_get_pp_feature_mask,
 	.set_driver_table_location = smu_v15_0_set_driver_table_location,
 	.gfx_off_control = smu_v15_0_gfx_off_control,
Signature · 1 line
2.43.0
#8 lore raw

PATCH v2 7/11 drm/amdgpu: Drop unsupported function

In reply to Pratik Vishwakarma

drop set_driver_table_location

---
 drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c +0 -1
index f90d274c0f67..7331c7559454 100644
@@ -1389,7 +1389,6 @@ static const struct pptable_funcs smu_v15_0_0_ppt_funcs = {
 	.get_gpu_metrics = smu_v15_0_0_get_gpu_metrics,
 	.get_enabled_mask = smu_v15_0_0_get_enabled_mask,
 	.get_pp_feature_mask = smu_cmn_get_pp_feature_mask,
-	.set_driver_table_location = smu_v15_0_set_driver_table_location,
 	.gfx_off_control = smu_v15_0_gfx_off_control,
 	.mode2_reset = smu_v15_0_0_mode2_reset,
 	.get_dpm_ultimate_freq = smu_v15_0_common_get_dpm_ultimate_freq,
Signature · 1 line
2.43.0
Acked-by on v2 7/11
#9 lore raw

Re: [PATCH v2 07/11] drm/amdgpu: Drop unsupported function

Quoted 4 lines · Pratik Vishwakarma

drop set_driver_table_location

Quoted 19 lines
---
 drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c +0 -2
index f90d274c0f67..7331c7559454 100644
@@ -1389,7 +1389,6 @@ static const struct pptable_funcs smu_v15_0_0_ppt_funcs = {
        .get_gpu_metrics = smu_v15_0_0_get_gpu_metrics,
        .get_enabled_mask = smu_v15_0_0_get_enabled_mask,
        .get_pp_feature_mask = smu_cmn_get_pp_feature_mask,
-       .set_driver_table_location = smu_v15_0_set_driver_table_location,
        .gfx_off_control = smu_v15_0_gfx_off_control,
        .mode2_reset = smu_v15_0_0_mode2_reset,
        .get_dpm_ultimate_freq = smu_v15_0_common_get_dpm_ultimate_freq,
--

2.43.0

#10 lore raw

PATCH v2 8/11 drm/amd: Drop MALL

In reply to Pratik Vishwakarma

Not supported on SMU 15_0_0

---
 .../gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c    | 13 -------------
 1 file changed, 13 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c +0 -13
index 7331c7559454..140e5b8c0489 100644
@@ -58,19 +58,6 @@
 #define mmMP1_SMN_C2PMSG_34                   0x0062
 #define mmMP1_SMN_C2PMSG_34_BASE_IDX                  1
 
-/* MALLPowerController message arguments (Defines for the Cache mode control) */
-#define SMU_MALL_PMFW_CONTROL 0
-#define SMU_MALL_DRIVER_CONTROL 1
-
-/*
- * MALLPowerState message arguments
- * (Defines for the Allocate/Release Cache mode if in driver mode)
- */
-#define SMU_MALL_EXIT_PG 0
-#define SMU_MALL_ENTER_PG 1
-
-#define SMU_MALL_PG_CONFIG_DEFAULT SMU_MALL_PG_CONFIG_DRIVER_CONTROL_ALWAYS_ON
-
 #define SMU_15_0_UMD_PSTATE_GFXCLK 700
 #define SMU_15_0_UMD_PSTATE_SOCCLK 678
 #define SMU_15_0_UMD_PSTATE_FCLK 1800
Signature · 1 line
2.43.0
Acked-by on v2 8/11
#11 lore raw

Re: [PATCH v2 08/11] drm/amd: Drop MALL

Quoted 4 lines · Pratik Vishwakarma

Not supported on SMU 15_0_0

Quoted 31 lines
---
 .../gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c    | 13 -------------
 1 file changed, 13 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c +0 -14
index 7331c7559454..140e5b8c0489 100644
@@ -58,19 +58,6 @@
 #define mmMP1_SMN_C2PMSG_34                   0x0062
 #define mmMP1_SMN_C2PMSG_34_BASE_IDX                  1
 
-/* MALLPowerController message arguments (Defines for the Cache mode control) */
-#define SMU_MALL_PMFW_CONTROL 0
-#define SMU_MALL_DRIVER_CONTROL 1
-
-/*
- * MALLPowerState message arguments
- * (Defines for the Allocate/Release Cache mode if in driver mode)
- */
-#define SMU_MALL_EXIT_PG 0
-#define SMU_MALL_ENTER_PG 1
-
-#define SMU_MALL_PG_CONFIG_DEFAULT SMU_MALL_PG_CONFIG_DRIVER_CONTROL_ALWAYS_ON
-
 #define SMU_15_0_UMD_PSTATE_GFXCLK 700
 #define SMU_15_0_UMD_PSTATE_SOCCLK 678
 #define SMU_15_0_UMD_PSTATE_FCLK 1800
--

2.43.0

#12 lore raw

PATCH v2 9/11 drm/amdgpu: enable mode2 reset for SMU IP v15.0.0

In reply to Pratik Vishwakarma

Set the default reset method to mode2 for SMU 15.0.0.

---
 drivers/gpu/drm/amd/amdgpu/soc21.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/soc21.c +1 -0
index d9cc649d81ad..79d132fc8ca9 100644
@@ -422,6 +422,7 @@ soc21_asic_reset_method(struct amdgpu_device *adev)
 	case IP_VERSION(14, 0, 1):
 	case IP_VERSION(14, 0, 4):
 	case IP_VERSION(14, 0, 5):
+	case IP_VERSION(15, 0, 0):
 		return AMD_RESET_METHOD_MODE2;
 	default:
 		if (amdgpu_dpm_is_baco_supported(adev))
Signature · 1 line
2.43.0
Acked-by on v2 9/11
#13 lore raw

Re: [PATCH v2 09/11] drm/amdgpu: enable mode2 reset for SMU IP v15.0.0

Quoted 5 lines · Pratik Vishwakarma

Set the default reset method to mode2 for SMU 15.0.0.

Quoted 19 lines
---
 drivers/gpu/drm/amd/amdgpu/soc21.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/soc21.c +1 -1
index d9cc649d81ad..79d132fc8ca9 100644
@@ -422,6 +422,7 @@ soc21_asic_reset_method(struct amdgpu_device *adev)
        case IP_VERSION(14, 0, 1):
        case IP_VERSION(14, 0, 4):
        case IP_VERSION(14, 0, 5):
+       case IP_VERSION(15, 0, 0):
                return AMD_RESET_METHOD_MODE2;
        default:
                if (amdgpu_dpm_is_baco_supported(adev))
--

2.43.0

#14 lore raw

PATCH v2 10/11 drm/amd: Add CG/PG flags for GC 11.5.4

In reply to Pratik Vishwakarma

Enable GFXOff for GC 11.5.4

---
 drivers/gpu/drm/amd/amdgpu/soc21.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc21.c +21 -2
index 79d132fc8ca9..8122a5cacf07 100644
@@ -839,9 +839,28 @@ static int soc21_common_early_init(struct amdgpu_ip_block *ip_block)
 		break;
 	case IP_VERSION(11, 5, 4):
 		adev->cg_flags = AMD_CG_SUPPORT_VCN_MGCG |
-			AMD_CG_SUPPORT_JPEG_MGCG;
+			AMD_CG_SUPPORT_JPEG_MGCG |
+			AMD_CG_SUPPORT_GFX_CGCG |
+			AMD_CG_SUPPORT_GFX_CGLS |
+			AMD_CG_SUPPORT_GFX_MGCG |
+			AMD_CG_SUPPORT_GFX_FGCG |
+			AMD_CG_SUPPORT_REPEATER_FGCG |
+			AMD_CG_SUPPORT_GFX_PERF_CLK |
+			AMD_CG_SUPPORT_GFX_3D_CGCG |
+			AMD_CG_SUPPORT_GFX_3D_CGLS |
+			AMD_CG_SUPPORT_MC_MGCG |
+			AMD_CG_SUPPORT_MC_LS |
+			AMD_CG_SUPPORT_HDP_LS |
+			AMD_CG_SUPPORT_HDP_DS |
+			AMD_CG_SUPPORT_HDP_SD |
+			AMD_CG_SUPPORT_ATHUB_MGCG |
+			AMD_CG_SUPPORT_ATHUB_LS |
+			AMD_CG_SUPPORT_IH_CG |
+			AMD_CG_SUPPORT_BIF_MGCG |
+			AMD_CG_SUPPORT_BIF_LS;
 		adev->pg_flags = AMD_PG_SUPPORT_VCN |
-			AMD_PG_SUPPORT_JPEG;
+			AMD_PG_SUPPORT_JPEG |
+			AMD_PG_SUPPORT_GFX_PG;
 		adev->external_rev_id = adev->rev_id + 0x1;
                break;
 	default:
Signature · 1 line
2.43.0
Acked-by on v2 10/11
#15 lore raw

Re: [PATCH v2 10/11] drm/amd: Add CG/PG flags for GC 11.5.4

Quoted 4 lines · Pratik Vishwakarma

Enable GFXOff for GC 11.5.4

Quoted 42 lines
---
 drivers/gpu/drm/amd/amdgpu/soc21.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc21.c +21 -3
index 79d132fc8ca9..8122a5cacf07 100644
@@ -839,9 +839,28 @@ static int soc21_common_early_init(struct amdgpu_ip_block *ip_block)
                break;
        case IP_VERSION(11, 5, 4):
                adev->cg_flags = AMD_CG_SUPPORT_VCN_MGCG |
-                       AMD_CG_SUPPORT_JPEG_MGCG;
+                       AMD_CG_SUPPORT_JPEG_MGCG |
+                       AMD_CG_SUPPORT_GFX_CGCG |
+                       AMD_CG_SUPPORT_GFX_CGLS |
+                       AMD_CG_SUPPORT_GFX_MGCG |
+                       AMD_CG_SUPPORT_GFX_FGCG |
+                       AMD_CG_SUPPORT_REPEATER_FGCG |
+                       AMD_CG_SUPPORT_GFX_PERF_CLK |
+                       AMD_CG_SUPPORT_GFX_3D_CGCG |
+                       AMD_CG_SUPPORT_GFX_3D_CGLS |
+                       AMD_CG_SUPPORT_MC_MGCG |
+                       AMD_CG_SUPPORT_MC_LS |
+                       AMD_CG_SUPPORT_HDP_LS |
+                       AMD_CG_SUPPORT_HDP_DS |
+                       AMD_CG_SUPPORT_HDP_SD |
+                       AMD_CG_SUPPORT_ATHUB_MGCG |
+                       AMD_CG_SUPPORT_ATHUB_LS |
+                       AMD_CG_SUPPORT_IH_CG |
+                       AMD_CG_SUPPORT_BIF_MGCG |
+                       AMD_CG_SUPPORT_BIF_LS;
                adev->pg_flags = AMD_PG_SUPPORT_VCN |
-                       AMD_PG_SUPPORT_JPEG;
+                       AMD_PG_SUPPORT_JPEG |
+                       AMD_PG_SUPPORT_GFX_PG;
                adev->external_rev_id = adev->rev_id + 0x1;
                break;
        default:
--

2.43.0

#16 lore raw

PATCH v2 11/11 drm/amd/smu: Fix User mode stable P-states SMU15

In reply to Pratik Vishwakarma

SMU 15_0_0 exports only soft limits for CLKs
Use correct messages

---
 .../gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c  | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c +5 -10
index 140e5b8c0489..8e6b7574d159 100644
@@ -1033,26 +1033,21 @@ static int smu_v15_0_0_set_soft_freq_limited_range(struct smu_context *smu,
 	switch (clk_type) {
 	case SMU_GFXCLK:
 	case SMU_SCLK:
-		msg_set_min = SMU_MSG_SetHardMinGfxClk;
+		msg_set_min = SMU_MSG_SetSoftMinGfxclk;
 		msg_set_max = SMU_MSG_SetSoftMaxGfxClk;
 		break;
 	case SMU_FCLK:
-		msg_set_min = SMU_MSG_SetHardMinFclkByFreq;
+		msg_set_min = SMU_MSG_SetSoftMinFclk;
 		msg_set_max = SMU_MSG_SetSoftMaxFclkByFreq;
 		break;
 	case SMU_SOCCLK:
-		msg_set_min = SMU_MSG_SetHardMinSocclkByFreq;
+		msg_set_min = SMU_MSG_SetSoftMinSocclkByFreq;
 		msg_set_max = SMU_MSG_SetSoftMaxSocclkByFreq;
 		break;
 	case SMU_VCLK:
 	case SMU_DCLK:
-		msg_set_min = SMU_MSG_SetHardMinVcn0;
-		msg_set_max = SMU_MSG_SetSoftMaxVcn0;
-		break;
-	case SMU_VCLK1:
-	case SMU_DCLK1:
-		msg_set_min = SMU_MSG_SetHardMinVcn1;
-		msg_set_max = SMU_MSG_SetSoftMaxVcn1;
+		msg_set_min = SMU_MSG_SetSoftMinVcn;
+		msg_set_max = SMU_MSG_SetSoftMaxVcn;
 		break;
 	default:
 		return -EINVAL;
Signature · 1 line
2.43.0
Acked-by on v2 11/11
#17 lore raw

Re: [PATCH v2 11/11] drm/amd/smu: Fix User mode stable P-states SMU15

Quoted 5 lines · Pratik Vishwakarma

SMU 15_0_0 exports only soft limits for CLKs
Use correct messages

Quoted 43 lines
---
 .../gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c  | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c +5 -11
index 140e5b8c0489..8e6b7574d159 100644
@@ -1033,26 +1033,21 @@ static int smu_v15_0_0_set_soft_freq_limited_range(struct smu_context *smu,
        switch (clk_type) {
        case SMU_GFXCLK:
        case SMU_SCLK:
-               msg_set_min = SMU_MSG_SetHardMinGfxClk;
+               msg_set_min = SMU_MSG_SetSoftMinGfxclk;
                msg_set_max = SMU_MSG_SetSoftMaxGfxClk;
                break;
        case SMU_FCLK:
-               msg_set_min = SMU_MSG_SetHardMinFclkByFreq;
+               msg_set_min = SMU_MSG_SetSoftMinFclk;
                msg_set_max = SMU_MSG_SetSoftMaxFclkByFreq;
                break;
        case SMU_SOCCLK:
-               msg_set_min = SMU_MSG_SetHardMinSocclkByFreq;
+               msg_set_min = SMU_MSG_SetSoftMinSocclkByFreq;
                msg_set_max = SMU_MSG_SetSoftMaxSocclkByFreq;
                break;
        case SMU_VCLK:
        case SMU_DCLK:
-               msg_set_min = SMU_MSG_SetHardMinVcn0;
-               msg_set_max = SMU_MSG_SetSoftMaxVcn0;
-               break;
-       case SMU_VCLK1:
-       case SMU_DCLK1:
-               msg_set_min = SMU_MSG_SetHardMinVcn1;
-               msg_set_max = SMU_MSG_SetSoftMaxVcn1;
+               msg_set_min = SMU_MSG_SetSoftMinVcn;
+               msg_set_max = SMU_MSG_SetSoftMaxVcn;
                break;
        default:
                return -EINVAL;
--

2.43.0

Reviewed-by on v2 1/11
#18 lore raw
In reply to Pratik Vishwakarma
Quoted 4 lines · Pratik Vishwakarma

TOC and TA both are required

Quoted 22 lines
---
 drivers/gpu/drm/amd/amdgpu/psp_v15_0.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/psp_v15_0.c +4 -1
index 3aca293e2f0c..723ddae17644 100644
@@ -45,6 +45,10 @@ static int psp_v15_0_0_init_microcode(struct psp_context *psp)
        if (err)
                return err;
 
+       err = psp_init_ta_microcode(psp, ucode_prefix);
+       if (err)
+               return err;
+
        return 0;
 }
 
--

2.43.0