Skip to contentSkip to conversation

Add support for SMU v13.0.4

PATCH New Alex Deucher 1 participant 8 messages May 12, 2022

Subsystems (3)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

cover Add support for SMU v13.0.4

Add initial support for SMU (System Management Unit) version 13.0.4. The SMU handles power management and other tasks on the GPU. Patch 1 adds large new header files so I didn't send them to the list.

Alex Deucher (1):
drm/amdgpu/soc21: add mode2 asic reset for SMU IP v13.0.4

Huang Rui (1):
drm/amdgpu/pm: add smu v13.0.4 driver SMU if headers

Tim Huang (5):
drm/amdgpu/pm: add EnableGfxImu message dummy map for SMU IP v13.0.4 drm/amdgpu/pm: add some common ppt functions for SMU IP v13.0.x drm/amdgpu/pm: add swsmu ppt implementation for SMU IP v13.0.4 drm/amdgpu/pm: enable swsmu for SMU IP v13.0.4 drm/amdgpu/pm: add GFXOFF control IP version check for SMU IP v13.0.4

Xiaojian Du (1):
drm/amdgpu/discovery: add SMU v13.0.4 into the IP discovery list

 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c |    1 +
 drivers/gpu/drm/amd/amdgpu/soc21.c            |    7 +
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c     |    4 +
 .../inc/pmfw_if/smu13_driver_if_v13_0_4.h     |  267 +++++
 .../pm/swsmu/inc/pmfw_if/smu_v13_0_4_pmfw.h   |  137 +++
 .../pm/swsmu/inc/pmfw_if/smu_v13_0_4_ppsmc.h  |  138 +++
 drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h  |    3 +-
 drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h  |    9 +-
 drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile   |    3 +-
 .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c    |  107 +-
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c  | 1044 +++++++++++++++++
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.h  |   28 +
 12 files changed, 1731 insertions(+), 17 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_4.h
 create mode 100644 drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_4_pmfw.h
 create mode 100644 drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_4_ppsmc.h
 create mode 100644 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c
 create mode 100644 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.h
Signature · 1 line
2.35.3
author maintainer
#1 lore raw

PATCH 2/8 drm/amdgpu/pm: add EnableGfxImu message dummy map for SMU IP v13.0.4

From: Tim Huang <[email protected]>

The SMU needs this message to trigger IMU initialization.

---
 drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h +2 -1
index 799050ea7515..a1cb8e73e171 100644
@@ -233,7 +233,8 @@
 	__SMU_DUMMY_MAP(Spare0),                  \
 	__SMU_DUMMY_MAP(UnforceGfxVid),           \
 	__SMU_DUMMY_MAP(HeavySBR),			\
-	__SMU_DUMMY_MAP(SetBadHBMPagesRetiredFlagsPerChannel),
+	__SMU_DUMMY_MAP(SetBadHBMPagesRetiredFlagsPerChannel), \
+	__SMU_DUMMY_MAP(EnableGfxImu),
 
 #undef __SMU_DUMMY_MAP
 #define __SMU_DUMMY_MAP(type)	SMU_MSG_##type
Signature · 1 line
2.35.3
author maintainer
#2 lore raw

PATCH 3/8 drm/amdgpu/pm: add some common ppt functions for SMU IP v13.0.x

In reply to Alex Deucher

From: Tim Huang <[email protected]>

Add some common ppt functions that will be used by SMU IP v13.0.x and drop the not used function smu_v13_0_mode2_reset.

---
 drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h  |   9 +-
 .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c    | 106 +++++++++++++++---
 2 files changed, 100 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h +7 -2
index 013be82db1f3..2b44d41a5157 100644
@@ -28,6 +28,7 @@
 #define SMU13_DRIVER_IF_VERSION_INV 0xFFFFFFFF
 #define SMU13_DRIVER_IF_VERSION_YELLOW_CARP 0x04
 #define SMU13_DRIVER_IF_VERSION_ALDE 0x08
+#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_4 0x04
 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_5 0x04
 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_0 0x27
 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_7 0x28
@@ -224,8 +225,6 @@ int smu_v13_0_baco_set_state(struct smu_context *smu, enum smu_baco_state state)
 int smu_v13_0_baco_enter(struct smu_context *smu);
 int smu_v13_0_baco_exit(struct smu_context *smu);
 
-int smu_v13_0_mode2_reset(struct smu_context *smu);
-
 int smu_v13_0_get_dpm_ultimate_freq(struct smu_context *smu, enum smu_clk_type clk_type,
 				    uint32_t *min, uint32_t *max);
 
@@ -293,5 +292,11 @@ int smu_v13_0_baco_enter(struct smu_context *smu);
 
 int smu_v13_0_baco_exit(struct smu_context *smu);
 
+int smu_v13_0_od_edit_dpm_table(struct smu_context *smu,
+				enum PP_OD_DPM_TABLE_COMMAND type,
+				long input[],
+				uint32_t size);
+
+int smu_v13_0_set_default_dpm_tables(struct smu_context *smu);
 #endif
 #endif
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +93 -13

121 lines not on this page · raw message

Signature · 1 line
2.35.3
author maintainer
#3 lore raw

PATCH 4/8 drm/amdgpu/pm: add swsmu ppt implementation for SMU IP v13.0.4

In reply to Alex Deucher

From: Tim Huang <[email protected]>

Add swsmu ppt files for SMU IP v13.0.4.

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile   |    3 +-
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c  | 1044 +++++++++++++++++
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.h  |   28 +
 3 files changed, 1074 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c
 create mode 100644 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.h
drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile +2 -1
index 4711fb53dd19..9043f6ef1aee 100644
@@ -23,7 +23,8 @@
 # Makefile for the 'smu manager' sub-component of powerplay.
 # It provides the smu management services for the driver.
 
-SMU13_MGR = smu_v13_0.o aldebaran_ppt.o yellow_carp_ppt.o smu_v13_0_0_ppt.o smu_v13_0_5_ppt.o smu_v13_0_7_ppt.o
+SMU13_MGR = smu_v13_0.o aldebaran_ppt.o yellow_carp_ppt.o smu_v13_0_0_ppt.o smu_v13_0_4_ppt.o \
+	    smu_v13_0_5_ppt.o smu_v13_0_7_ppt.o
 
 AMD_SWSMU_SMU13MGR = $(addprefix $(AMD_SWSMU_PATH)/smu13/,$(SMU13_MGR))
 
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c new file +1044 -0

1,044 lines not on this page · raw message

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.h new file +28 -0
new file mode 100644
index 000000000000..f0bd5d3ac4b6
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2022 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_V13_0_4_PPT_H__
+#define __SMU_V13_0_4_PPT_H__
+
+extern void smu_v13_0_4_set_ppt_funcs(struct smu_context *smu);
+
+#endif
Signature · 1 line
2.35.3
author maintainer
#4 lore raw

PATCH 5/8 drm/amdgpu/pm: enable swsmu for SMU IP v13.0.4

In reply to Alex Deucher

From: Tim Huang <[email protected]>

Add the entry to set the ppt functions for SMU IP v13.0.4.

---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +4 -0
index 956062496202..ab32277f9108 100644
@@ -38,6 +38,7 @@
 #include "yellow_carp_ppt.h"
 #include "cyan_skillfish_ppt.h"
 #include "smu_v13_0_0_ppt.h"
+#include "smu_v13_0_4_ppt.h"
 #include "smu_v13_0_5_ppt.h"
 #include "smu_v13_0_7_ppt.h"
 #include "amd_pcie.h"
@@ -550,6 +551,9 @@ static int smu_set_funcs(struct amdgpu_device *adev)
 	case IP_VERSION(13, 0, 8):
 		yellow_carp_set_ppt_funcs(smu);
 		break;
+	case IP_VERSION(13, 0, 4):
+		smu_v13_0_4_set_ppt_funcs(smu);
+		break;
 	case IP_VERSION(13, 0, 5):
 		smu_v13_0_5_set_ppt_funcs(smu);
 		break;
Signature · 1 line
2.35.3
author maintainer
#5 lore raw

PATCH 6/8 drm/amdgpu/pm: add GFXOFF control IP version check for SMU IP v13.0.4

In reply to Alex Deucher

From: Tim Huang <[email protected]>

Enable the SMU IP v13.0.4 GFXOFF control

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +1 -0
index 14a7eef0b15f..ae6321af9d88 100644
@@ -836,6 +836,7 @@ int smu_v13_0_gfx_off_control(struct smu_context *smu, bool enable)
 	case IP_VERSION(13, 0, 0):
 	case IP_VERSION(13, 0, 1):
 	case IP_VERSION(13, 0, 3):
+	case IP_VERSION(13, 0, 4):
 	case IP_VERSION(13, 0, 5):
 	case IP_VERSION(13, 0, 7):
 	case IP_VERSION(13, 0, 8):
Signature · 1 line
2.35.3
author maintainer
#6 lore raw

PATCH 7/8 drm/amdgpu/discovery: add SMU v13.0.4 into the IP discovery list

In reply to Alex Deucher

From: Xiaojian Du <[email protected]>

This patch will add SMU v13.0.4 into the IP discovery list.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1 -0
index d7b0fd1cad62..881570dced41 100644
@@ -1656,6 +1656,7 @@ static int amdgpu_discovery_set_smu_ip_blocks(struct amdgpu_device *adev)
 	case IP_VERSION(13, 0, 1):
 	case IP_VERSION(13, 0, 2):
 	case IP_VERSION(13, 0, 3):
+	case IP_VERSION(13, 0, 4):
 	case IP_VERSION(13, 0, 5):
 	case IP_VERSION(13, 0, 7):
 	case IP_VERSION(13, 0, 8):
Signature · 1 line
2.35.3
author maintainer
#7 lore raw

PATCH 8/8 drm/amdgpu/soc21: add mode2 asic reset for SMU IP v13.0.4

In reply to Alex Deucher

Set the default reset method to mode2 for SMU IP v13.0.4

---
 drivers/gpu/drm/amd/amdgpu/soc21.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/soc21.c +7 -0
index c6a8520053bb..a4e23a7b3d63 100644
@@ -309,6 +309,7 @@ static enum amd_reset_method
 soc21_asic_reset_method(struct amdgpu_device *adev)
 {
 	if (amdgpu_reset_method == AMD_RESET_METHOD_MODE1 ||
+	    amdgpu_reset_method == AMD_RESET_METHOD_MODE2 ||
 	    amdgpu_reset_method == AMD_RESET_METHOD_BACO)
 		return amdgpu_reset_method;
 
@@ -319,6 +320,8 @@ soc21_asic_reset_method(struct amdgpu_device *adev)
 	switch (adev->ip_versions[MP1_HWIP][0]) {
 	case IP_VERSION(13, 0, 0):
 		return AMD_RESET_METHOD_MODE1;
+	case IP_VERSION(13, 0, 4):
+		return AMD_RESET_METHOD_MODE2;
 	default:
 		if (amdgpu_dpm_is_baco_supported(adev))
 			return AMD_RESET_METHOD_BACO;
@@ -340,6 +343,10 @@ static int soc21_asic_reset(struct amdgpu_device *adev)
 		dev_info(adev->dev, "BACO reset\n");
 		ret = amdgpu_dpm_baco_reset(adev);
 		break;
+	case AMD_RESET_METHOD_MODE2:
+		dev_info(adev->dev, "MODE2 reset\n");
+		ret = amdgpu_dpm_mode2_reset(adev);
+		break;
 	default:
 		dev_info(adev->dev, "MODE1 reset\n");
 		ret = amdgpu_device_mode1_reset(adev);
Signature · 1 line
2.35.3