Skip to contentSkip to conversation

drm/amdgpu: add GDDR7 vram name

PATCH New Alex Deucher 1 participant 7 messages Sep 21

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu: add GDDR7 vram name

From: Frank Min <[email protected]>

Add GDDR7 vram name.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2 -1
index d6d84ff110a0f..2a6a5bc01eb40 100644
@@ -1060,7 +1060,8 @@ static const char * const amdgpu_vram_names[] = {
 	"LPDDR4",
 	"LPDDR5",
 	"HBM3E",
-	"HBM4"
+	"HBM4",
+	"GDDR7"
 };
 
 /**
Signature · 1 line
2.55.0
author maintainer
#1 lore raw

PATCH 1/1 drm/amdgpu: fix ip discovery table validation

From: Lin Cao <[email protected]>

Fix ip discovery table_check, get_mall_info, and get_vcn_info to guard on both offset and size being non-zero before parsing.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +7 -5
index 965063696308e..366588c2642d1 100644
@@ -697,7 +697,7 @@ static int amdgpu_discovery_table_check(struct amdgpu_device *adev,
 		break;
 	}
 
-	if (check_table && offset) {
+	if (check_table && offset && table_size) {
 		if (act_val != exp_val) {
 			dev_err(adev->dev, "invalid ip discovery %s signature\n", table_name);
 			return -EINVAL;
@@ -2203,7 +2203,7 @@ static int amdgpu_discovery_get_mall_info(struct amdgpu_device *adev)
 	union mall_info *mall_info;
 	u32 u, mall_size_per_umc, m_s_present, half_use;
 	u64 mall_size;
-	u16 offset;
+	u16 offset, size;
 
 	if (!discovery_bin) {
 		DRM_ERROR("ip discovery uninitialized\n");
@@ -2213,8 +2213,9 @@ static int amdgpu_discovery_get_mall_info(struct amdgpu_device *adev)
 	if (amdgpu_discovery_get_table_info(adev, &info, MALL_INFO))
 		return -EINVAL;
 	offset = le16_to_cpu(info->offset);
+	size = le16_to_cpu(info->size);
 
-	if (!offset)
+	if (!offset || !size)
 		return 0;
 
 	mall_info = (union mall_info *)(discovery_bin + offset);
@@ -2259,7 +2260,7 @@ static int amdgpu_discovery_get_vcn_info(struct amdgpu_device *adev)
 	uint8_t *discovery_bin = adev->discovery.bin;
 	struct table_info *info;
 	union vcn_info *vcn_info;
-	u16 offset;
+	u16 offset, size;
 	int v;
 
 	if (!discovery_bin) {
@@ -2280,8 +2281,9 @@ static int amdgpu_discovery_get_vcn_info(struct amdgpu_device *adev)
 	if (amdgpu_discovery_get_table_info(adev, &info, VCN_INFO))
 		return -EINVAL;
 	offset = le16_to_cpu(info->offset);
+	size = le16_to_cpu(info->size);
 
-	if (!offset)
+	if (!offset || !size)
 		return 0;
 
 	vcn_info = (union vcn_info *)(discovery_bin + offset);
Signature · 1 line
2.55.0
author maintainer
#2 lore raw

PATCH 1/1 drm/amdgpu: fix atomics on DF 5.0.2

In reply to Alex Deucher

From: Eric Huang <[email protected]>

DF 5.0.2 needs to program DF config register as DF 4.15.x, so share the functions, they have the same register layout.

---
 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 9a04e681a0cb4..965063696308e 100644
@@ -3871,6 +3871,7 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
 		break;
 	case IP_VERSION(4, 15, 0):
 	case IP_VERSION(4, 15, 1):
+	case IP_VERSION(5, 0, 2):
 		adev->df.funcs = &df_v4_15_funcs;
 		break;
 	default:
Signature · 1 line
2.55.0
author maintainer
#3 lore raw

PATCH 1/1 drm/amdgpu: Add soc v2_0 ih client id table

In reply to Alex Deucher

From: Hawking Zhang <[email protected]>

To acommandate the specific ih client for soc v2_0

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c       | 35 +++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h       |  1 +
 .../drm/amd/include/soc_v2_0_ih_clientid.h    | 51 +++++++++++++++++++
 3 files changed, 87 insertions(+)
 create mode 100644 drivers/gpu/drm/amd/include/soc_v2_0_ih_clientid.h
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +35 -0
index dcf90a974326d..03219ee894a28 100644
@@ -134,6 +134,41 @@ const char *soc_v1_0_ih_clientid_name[] = {
 	"MP1",
 };
 
+const char *soc_v2_0_ih_clientid_name[] = {
+	"IH",
+	"Reserved",
+	"ATHUB",
+	"BIF",
+	"DCN",
+	"Reserved",
+	"Reserved",
+	"RLC",
+	"Reserved",
+	"Reserved",
+	"GFX",
+	"IMU",
+	"NVE",
+	"Reserved",
+	"Reserved",
+	"THM",
+	"UMSCH_VCN",
+	"Reserved",
+	"VMC",
+	"Reserved",
+	"GRBM_CP",
+	"Reserved",
+	"Reserved",
+	"DF",
+	"VPE",
+	"SMUIO",
+	"Reserved",
+	"GC_UTCL2",
+	"Reserved",
+	"Reserved",
+	"MPASP",
+	"MP1",
+};
+
 const int node_id_to_phys_map[NODEID_MAX] = {
 	[AID0_NODEID] = 0,
 	[XCD0_NODEID] = 0,
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h +1 -0
index c88431471c303..5458ec3af19d2 100644
@@ -27,6 +27,7 @@
 #include <linux/irqdomain.h>
 #include "soc15_ih_clientid.h"
 #include "soc_v1_0_ih_clientid.h"
+#include "soc_v2_0_ih_clientid.h"
 #include "amdgpu_ih.h"
 
 #define AMDGPU_MAX_IRQ_SRC_ID		0x100
drivers/gpu/drm/amd/include/soc_v2_0_ih_clientid.h new file +51 -0

51 lines not on this page · raw message

Signature · 1 line
2.55.0
author maintainer
#4 lore raw

PATCH 1/1 drm/amdgpu: update FIRMWARE ID for soc24

In reply to Alex Deucher

From: Frank Min <[email protected]>

Update firmware ID for SOC24 to support more firmware.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.h | 36 ++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.h +35 -1
index 959d60c90dcd2..2ae2c1d0f702b 100644
@@ -156,7 +156,41 @@ typedef enum _SOC24_FIRMWARE_ID_ {
     SOC24_FIRMWARE_ID_SRIOV_CSA_SDMA              = 40,
     SOC24_FIRMWARE_ID_SRIOV_CSA_CP                = 41,
     SOC24_FIRMWARE_ID_UMF_ZONE_PAD                = 42,
-    SOC24_FIRMWARE_ID_MAX                         = 43
+    SOC24_FIRMWARE_ID_SE_F32_IRAM                 = 43,
+    SOC24_FIRMWARE_ID_SE_XT_IRAM                  = 44,
+    SOC24_FIRMWARE_ID_SE_XT_DRAM                  = 45,
+    SOC24_FIRMWARE_ID_RS64_MEC_P4_STACK           = 46,
+    SOC24_FIRMWARE_ID_RS64_MEC_P5_STACK           = 47,
+    SOC24_FIRMWARE_ID_RS64_MEC_P6_STACK           = 48,
+    SOC24_FIRMWARE_ID_RS64_MEC_P7_STACK           = 49,
+    SOC24_FIRMWARE_ID_CP_F32_PFP_G0_A             = 50,
+    SOC24_FIRMWARE_ID_CP_F32_PFP_G1_A             = 51,
+    SOC24_FIRMWARE_ID_CP_F32_PFP_G2               = 52,
+    SOC24_FIRMWARE_ID_CP_F32_ME_G0_A              = 53,
+    SOC24_FIRMWARE_ID_CP_F32_ME_G1_A              = 54,
+    SOC24_FIRMWARE_ID_CP_F32_ME_G2                = 55,
+    SOC24_FIRMWARE_ID_CP_F32_CE_G0_A              = 56,
+    SOC24_FIRMWARE_ID_CP_F32_CE_G1_A              = 57,
+    SOC24_FIRMWARE_ID_CP_F32_CE_G2                = 58,
+    SOC24_FIRMWARE_ID_CP_F32_MEC2_G0              = 59,
+    SOC24_FIRMWARE_ID_CP_F32_MEC2_G1              = 60,
+    SOC24_FIRMWARE_ID_CP_F32_MEC2_G2              = 61,
+    SOC24_FIRMWARE_ID_GFXOFF_CSA_SDMA0            = 62,
+    SOC24_FIRMWARE_ID_GFXOFF_CSA_SDMA1            = 63,
+    SOC24_FIRMWARE_ID_GFXOFF_CSA_SDMA2            = 64,
+    SOC24_FIRMWARE_ID_GFXOFF_CSA_SDMA3            = 65,
+    SOC24_FIRMWARE_ID_RLX6_SCRATCH_SR             = 66,
+    SOC24_FIRMWARE_ID_RLX6_SCRATCH_SR_CORE1       = 67,
+    SOC24_FIRMWARE_ID_CP_F32_PFP_G0_B             = 68,
+    SOC24_FIRMWARE_ID_CP_F32_PFP_G1_B             = 69,
+    SOC24_FIRMWARE_ID_CP_F32_ME_G0_B              = 70,
+    SOC24_FIRMWARE_ID_CP_F32_ME_G1_B              = 71,
+    SOC24_FIRMWARE_ID_CP_F32_CE_G0_B              = 72,
+    SOC24_FIRMWARE_ID_CP_F32_CE_G1_B              = 73,
+    SOC24_FIRMWARE_ID_CP_F32_MEC2_JT_G0           = 74,
+    SOC24_FIRMWARE_ID_CP_F32_MEC2_JT_G1           = 75,
+    SOC24_FIRMWARE_ID_CP_F32_MEC2_JT_G2           = 76,
+    SOC24_FIRMWARE_ID_MAX                         = 77
 } SOC24_FIRMWARE_ID;
 
 typedef struct _RLC_TABLE_OF_CONTENT {
Signature · 1 line
2.55.0
author maintainer
#5 lore raw

PATCH 1/1 drm/amdgpu: add debug info for psp ip key mgr ucode

In reply to Alex Deucher

From: Frank Min <[email protected]>

Add debug info for psp ip key mgr ucode.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +6 -0
index 4f1c711df5bd7..c07f6d8d36bbd 100644
@@ -500,6 +500,12 @@ void amdgpu_ucode_print_psp_hdr(const struct common_firmware_header *hdr)
 				DRM_DEBUG("psp_ras_drv_size_bytes: %u\n",
 					  le32_to_cpu(desc->size_bytes));
 				break;
+			case PSP_FW_TYPE_PSP_IPKEYMGR_DRV:
+				DRM_DEBUG("psp_ipkeymgr_drv_version: %u\n",
+					  le32_to_cpu(desc->fw_version));
+				DRM_DEBUG("psp_ipkeymgr_drv_size_bytes: %u\n",
+					  le32_to_cpu(desc->size_bytes));
+				break;
 			default:
 				DRM_DEBUG("Unsupported PSP fw type: %d\n", desc->fw_type);
 				break;
Signature · 1 line
2.55.0
author maintainer
#6 lore raw

PATCH 1/1 drm/amdgpu: Add gc_info_v1_4 table support

In reply to Alex Deucher

From: Likun Gao <[email protected]>

Initialize amdgpu_gfx_config using values from
gc_info_v1_4.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 22 ++++++----
 drivers/gpu/drm/amd/include/discovery.h       | 42 +++++++++++++++++++
 2 files changed, 55 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +13 -9
index 1420bb60e015e..9a04e681a0cb4 100644
@@ -2056,6 +2056,7 @@ union gc_info {
 	struct gc_info_v1_1 v1_1;
 	struct gc_info_v1_2 v1_2;
 	struct gc_info_v1_3 v1_3;
+	struct gc_info_v1_4 v1_4;
 	struct gc_info_v1_5 v1_5;
 	struct gc_info_v2_0 v2;
 	struct gc_info_v2_1 v2_1;
@@ -2118,7 +2119,18 @@ static int amdgpu_discovery_get_gfx_info(struct amdgpu_device *adev)
 			adev->gfx.config.gc_gl1c_size_per_instance = le32_to_cpu(gc_info->v1_2.gc_gl1c_size_per_instance);
 			adev->gfx.config.gc_gl2c_per_gpu = le32_to_cpu(gc_info->v1_2.gc_gl2c_per_gpu);
 		}
-		if (le16_to_cpu(gc_info->v1.header.version_minor) >= 3) {
+		if (le16_to_cpu(gc_info->v1.header.version_minor) == 4) {
+			num_wgps_per_sa = le32_to_cpu(gc_info->v1_4.gc_num_rwgp0_per_sa) +
+					  le32_to_cpu(gc_info->v1_4.gc_num_rwgp1_per_sa) +
+					  le32_to_cpu(gc_info->v1_4.gc_num_twgp0_per_sa) +
+					  le32_to_cpu(gc_info->v1_4.gc_num_twgp1_per_sa);
+			num_wgps_per_sa1 = le32_to_cpu(gc_info->v1_4.gc_num_rwgp0_per_sa1) +
+					   le32_to_cpu(gc_info->v1_4.gc_num_rwgp1_per_sa1) +
+					   le32_to_cpu(gc_info->v1_4.gc_num_twgp0_per_sa1) +
+					   le32_to_cpu(gc_info->v1_4.gc_num_twgp1_per_sa1);
+			adev->gfx.config.max_cu_per_sh = 2 * (num_wgps_per_sa >= num_wgps_per_sa1 ?
+							      num_wgps_per_sa : num_wgps_per_sa1);
+		} else if (le16_to_cpu(gc_info->v1.header.version_minor) >= 3) {
 			adev->gfx.config.gc_tcp_size_per_cu = le32_to_cpu(gc_info->v1_3.gc_tcp_size_per_cu);
 			adev->gfx.config.gc_tcp_cache_line_size = le32_to_cpu(gc_info->v1_3.gc_tcp_cache_line_size);
 			adev->gfx.config.gc_instruction_cache_size_per_sqc = le32_to_cpu(gc_info->v1_3.gc_instruction_cache_size_per_sqc);
@@ -2128,14 +2140,6 @@ static int amdgpu_discovery_get_gfx_info(struct amdgpu_device *adev)
 			adev->gfx.config.gc_tcc_size = le32_to_cpu(gc_info->v1_3.gc_tcc_size);
 			adev->gfx.config.gc_tcc_cache_line_size = le32_to_cpu(gc_info->v1_3.gc_tcc_cache_line_size);
 		}
-		if (le16_to_cpu(gc_info->v1.header.version_minor) == 4 ||
-		    le16_to_cpu(gc_info->v1.header.version_minor) > 5) {
-			dev_err(adev->dev,
-				"Unsupported GC info table %d.%d\n",
-				le16_to_cpu(gc_info->v1.header.version_major),
-				le16_to_cpu(gc_info->v1.header.version_minor));
-			return -EINVAL;
-		}
 		if (le16_to_cpu(gc_info->v1.header.version_minor) == 5) {
 			adev->gfx.config.gc_max_num_residency_ways = le32_to_cpu(gc_info->v1_5.gc_max_num_residency_ways);
 			adev->gfx.config.gc_cache_ways_size_in_bytes = le32_to_cpu(gc_info->v1_5.gc_cache_ways_size_in_bytes);
drivers/gpu/drm/amd/include/discovery.h +42 -0

48 lines not on this page · raw message

Signature · 1 line
2.55.0