Skip to contentSkip to conversation

drm/amdgpu: drop some dead code

PATCH In review Alex Deucher 3 participants 3 messages Mar 25, 2025

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu: drop some dead code

Drop the cgs smu firmware code for SI, it's not used. The smu firmware fetching for SI is done in si_dpm.c.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 61 -------------------------
 1 file changed, 61 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +0 -61
index 525e53c94f4f5..004a6a9d6b9fa 100644
@@ -252,67 +252,6 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
 
 		if (!adev->pm.fw) {
 			switch (adev->asic_type) {
-			case CHIP_TAHITI:
-				strscpy(fw_name, "radeon/tahiti_smc.bin");
-				break;
-			case CHIP_PITCAIRN:
-				if ((adev->pdev->revision == 0x81) &&
-				    ((adev->pdev->device == 0x6810) ||
-				    (adev->pdev->device == 0x6811))) {
-					info->is_kicker = true;
-					strscpy(fw_name, "radeon/pitcairn_k_smc.bin");
-				} else {
-					strscpy(fw_name, "radeon/pitcairn_smc.bin");
-				}
-				break;
-			case CHIP_VERDE:
-				if (((adev->pdev->device == 0x6820) &&
-					((adev->pdev->revision == 0x81) ||
-					(adev->pdev->revision == 0x83))) ||
-				    ((adev->pdev->device == 0x6821) &&
-					((adev->pdev->revision == 0x83) ||
-					(adev->pdev->revision == 0x87))) ||
-				    ((adev->pdev->revision == 0x87) &&
-					((adev->pdev->device == 0x6823) ||
-					(adev->pdev->device == 0x682b)))) {
-					info->is_kicker = true;
-					strscpy(fw_name, "radeon/verde_k_smc.bin");
-				} else {
-					strscpy(fw_name, "radeon/verde_smc.bin");
-				}
-				break;
-			case CHIP_OLAND:
-				if (((adev->pdev->revision == 0x81) &&
-					((adev->pdev->device == 0x6600) ||
-					(adev->pdev->device == 0x6604) ||
-					(adev->pdev->device == 0x6605) ||
-					(adev->pdev->device == 0x6610))) ||
-				    ((adev->pdev->revision == 0x83) &&
-					(adev->pdev->device == 0x6610))) {
-					info->is_kicker = true;
-					strscpy(fw_name, "radeon/oland_k_smc.bin");
-				} else {
-					strscpy(fw_name, "radeon/oland_smc.bin");
-				}
-				break;
-			case CHIP_HAINAN:
-				if (((adev->pdev->revision == 0x81) &&
-					(adev->pdev->device == 0x6660)) ||
-				    ((adev->pdev->revision == 0x83) &&
-					((adev->pdev->device == 0x6660) ||
-					(adev->pdev->device == 0x6663) ||
-					(adev->pdev->device == 0x6665) ||
-					 (adev->pdev->device == 0x6667)))) {
-					info->is_kicker = true;
-					strscpy(fw_name, "radeon/hainan_k_smc.bin");
-				} else if ((adev->pdev->revision == 0xc3) &&
-					 (adev->pdev->device == 0x6665)) {
-					info->is_kicker = true;
-					strscpy(fw_name, "radeon/banks_k_2_smc.bin");
-				} else {
-					strscpy(fw_name, "radeon/hainan_smc.bin");
-				}
-				break;
 			case CHIP_BONAIRE:
 				if ((adev->pdev->revision == 0x80) ||
 					(adev->pdev->revision == 0x81) ||
Signature · 1 line
2.49.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 68 lines · Alex Deucher

Drop the cgs smu firmware code for SI, it's not used. The smu firmware fetching for SI is done in si_dpm.c.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 61 -------------------------
 1 file changed, 61 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +0 -52
index 525e53c94f4f5..004a6a9d6b9fa 100644
@@ -252,67 +252,6 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
 
 		if (!adev->pm.fw) {
 			switch (adev->asic_type) {
-			case CHIP_TAHITI:
-				strscpy(fw_name, "radeon/tahiti_smc.bin");
-				break;
-			case CHIP_PITCAIRN:
-				if ((adev->pdev->revision == 0x81) &&
-				    ((adev->pdev->device == 0x6810) ||
-				    (adev->pdev->device == 0x6811))) {
-					info->is_kicker = true;
-					strscpy(fw_name, "radeon/pitcairn_k_smc.bin");
-				} else {
-					strscpy(fw_name, "radeon/pitcairn_smc.bin");
-				}
-				break;
-			case CHIP_VERDE:
-				if (((adev->pdev->device == 0x6820) &&
-					((adev->pdev->revision == 0x81) ||
-					(adev->pdev->revision == 0x83))) ||
-				    ((adev->pdev->device == 0x6821) &&
-					((adev->pdev->revision == 0x83) ||
-					(adev->pdev->revision == 0x87))) ||
-				    ((adev->pdev->revision == 0x87) &&
-					((adev->pdev->device == 0x6823) ||
-					(adev->pdev->device == 0x682b)))) {
-					info->is_kicker = true;
-					strscpy(fw_name, "radeon/verde_k_smc.bin");
-				} else {
-					strscpy(fw_name, "radeon/verde_smc.bin");
-				}
-				break;
-			case CHIP_OLAND:
-				if (((adev->pdev->revision == 0x81) &&
-					((adev->pdev->device == 0x6600) ||
-					(adev->pdev->device == 0x6604) ||
-					(adev->pdev->device == 0x6605) ||
-					(adev->pdev->device == 0x6610))) ||
-				    ((adev->pdev->revision == 0x83) &&
-					(adev->pdev->device == 0x6610))) {
-					info->is_kicker = true;
-					strscpy(fw_name, "radeon/oland_k_smc.bin");
-				} else {
-					strscpy(fw_name, "radeon/oland_smc.bin");
-				}
-				break;
-			case CHIP_HAINAN:
-				if (((adev->pdev->revision == 0x81) &&
-					(adev->pdev->device == 0x6660)) ||
-				    ((adev->pdev->revision == 0x83) &&
-					((adev->pdev->device == 0x6660) ||
-					(adev->pdev->device == 0x6663) ||
-					(adev->pdev->device == 0x6665) ||
-					 (adev->pdev->device == 0x6667)))) {
-					info->is_kicker = true;

drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device, · line 255

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +0 -9
-					strscpy(fw_name, "radeon/hainan_k_smc.bin");
-				} else if ((adev->pdev->revision == 0xc3) &&
-					 (adev->pdev->device == 0x6665)) {
-					info->is_kicker = true;
-					strscpy(fw_name, "radeon/banks_k_2_smc.bin");
-				} else {
-					strscpy(fw_name, "radeon/hainan_smc.bin");
-				}
-				break;
 			case CHIP_BONAIRE:

Is there any specific reason why the other ASICs in this switch (Bonaire, Hawaii, etc) are not using a similar mechanism like si_dpm.c?

Anyway,

Thanks

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +0 -0
 				if ((adev->pdev->revision == 0x80) ||
 					(adev->pdev->revision == 0x81) ||
Signature · 1 line
2.49.0
Signature · 1 line
Rodrigo Siqueira
#2 lore raw
Quoted 75 lines · Rodrigo Siqueira
Quoted 73 lines · Alex Deucher

Drop the cgs smu firmware code for SI, it's not used. The smu firmware fetching for SI is done in si_dpm.c.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 61 -------------------------
 1 file changed, 61 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +0 -57
index 525e53c94f4f5..004a6a9d6b9fa 100644
@@ -252,67 +252,6 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
 
              if (!adev->pm.fw) {
                      switch (adev->asic_type) {
-                     case CHIP_TAHITI:
-                             strscpy(fw_name, "radeon/tahiti_smc.bin");
-                             break;
-                     case CHIP_PITCAIRN:
-                             if ((adev->pdev->revision == 0x81) &&
-                                 ((adev->pdev->device == 0x6810) ||
-                                 (adev->pdev->device == 0x6811))) {
-                                     info->is_kicker = true;
-                                     strscpy(fw_name, "radeon/pitcairn_k_smc.bin");
-                             } else {
-                                     strscpy(fw_name, "radeon/pitcairn_smc.bin");
-                             }
-                             break;
-                     case CHIP_VERDE:
-                             if (((adev->pdev->device == 0x6820) &&
-                                     ((adev->pdev->revision == 0x81) ||
-                                     (adev->pdev->revision == 0x83))) ||
-                                 ((adev->pdev->device == 0x6821) &&
-                                     ((adev->pdev->revision == 0x83) ||
-                                     (adev->pdev->revision == 0x87))) ||
-                                 ((adev->pdev->revision == 0x87) &&
-                                     ((adev->pdev->device == 0x6823) ||
-                                     (adev->pdev->device == 0x682b)))) {
-                                     info->is_kicker = true;
-                                     strscpy(fw_name, "radeon/verde_k_smc.bin");
-                             } else {
-                                     strscpy(fw_name, "radeon/verde_smc.bin");
-                             }
-                             break;
-                     case CHIP_OLAND:
-                             if (((adev->pdev->revision == 0x81) &&
-                                     ((adev->pdev->device == 0x6600) ||
-                                     (adev->pdev->device == 0x6604) ||
-                                     (adev->pdev->device == 0x6605) ||
-                                     (adev->pdev->device == 0x6610))) ||
-                                 ((adev->pdev->revision == 0x83) &&
-                                     (adev->pdev->device == 0x6610))) {
-                                     info->is_kicker = true;
-                                     strscpy(fw_name, "radeon/oland_k_smc.bin");
-                             } else {
-                                     strscpy(fw_name, "radeon/oland_smc.bin");
-                             }
-                             break;
-                     case CHIP_HAINAN:
-                             if (((adev->pdev->revision == 0x81) &&
-                                     (adev->pdev->device == 0x6660)) ||
-                                 ((adev->pdev->revision == 0x83) &&
-                                     ((adev->pdev->device == 0x6660) ||
-                                     (adev->pdev->device == 0x6663) ||
-                                     (adev->pdev->device == 0x6665) ||
-                                      (adev->pdev->device == 0x6667)))) {
-                                     info->is_kicker = true;
-                                     strscpy(fw_name, "radeon/hainan_k_smc.bin");
-                             } else if ((adev->pdev->revision == 0xc3) &&
-                                      (adev->pdev->device == 0x6665)) {
-                                     info->is_kicker = true;
-                                     strscpy(fw_name, "radeon/banks_k_2_smc.bin");
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device, · line 255

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +0 -4
-                             } else {
-                                     strscpy(fw_name, "radeon/hainan_smc.bin");
-                             }
-                             break;
                      case CHIP_BONAIRE:

Is there any specific reason why the other ASICs in this switch (Bonaire, Hawaii, etc) are not using a similar mechanism like si_dpm.c?

Not really. Someone could move the firmware set up into the relevant SMU code for those chips.

Alex

Quoted 15 lines

Anyway,

Thanks

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +0 -1
                              if ((adev->pdev->revision == 0x80) ||
                                      (adev->pdev->revision == 0x81) ||
--

2.49.0

--
Rodrigo Siqueira