Revert "drm/amdgpu:correct smc fw version error"

Submitted by Huang, Ray on Sept. 22, 2016, 8 a.m.

Details

Message ID 1474531232-31493-1-git-send-email-ray.huang@amd.com
State New
Headers show
Series "Revert "drm/amdgpu:correct smc fw version error"" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Huang, Ray Sept. 22, 2016, 8 a.m.
From: Huang Rui <Ray.Huang@amd.com>

This reverts commit bb2a2de6e2ea0e99d0d1a20d06536c4dcd66a196.

SMC firmware version error should be fixed while ucode is generated.
I would do the fix in firmware side.

Signed-off-by: Huang Rui <Ray.Huang@amd.com>
Cc: Monk Liu <Monk.Liu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
index ab2d7fb..7a8bfa3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
@@ -785,13 +785,12 @@  static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
 		info->fw_version = amdgpu_get_firmware_version(cgs_device, type);
 		info->feature_version = (uint16_t)le32_to_cpu(header->ucode_feature_version);
 	} else {
-		uint32_t fw_ver;
 		char fw_name[30] = {0};
 		int err = 0;
 		uint32_t ucode_size;
 		uint32_t ucode_start_address;
 		const uint8_t *src;
-		struct smc_firmware_header_v1_0 *hdr;
+		const struct smc_firmware_header_v1_0 *hdr;
 
 		if (!adev->pm.fw) {
 			switch (adev->asic_type) {
@@ -836,15 +835,12 @@  static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
 			}
 		}
 
-		hdr = (struct smc_firmware_header_v1_0 *)adev->pm.fw->data;
-		/* firmware version is located at 69 dw from begining */
-		fw_ver = *((uint32_t *)adev->pm.fw->data + 69);
-		hdr->header.ucode_version = fw_ver;
+		hdr = (const struct smc_firmware_header_v1_0 *)	adev->pm.fw->data;
 		amdgpu_ucode_print_smc_hdr(&hdr->header);
 		adev->pm.fw_version = le32_to_cpu(hdr->header.ucode_version);
 		ucode_size = le32_to_cpu(hdr->header.ucode_size_bytes);
 		ucode_start_address = le32_to_cpu(hdr->ucode_start_addr);
-		src = (uint8_t *)(adev->pm.fw->data +
+		src = (const uint8_t *)(adev->pm.fw->data +
 		       le32_to_cpu(hdr->header.ucode_array_offset_bytes));
 
 		info->version = adev->pm.fw_version;

Comments

> -----Original Message-----
> From: Huang Rui [mailto:ray.huang@amd.com]
> Sent: Thursday, September 22, 2016 4:01 AM
> To: amd-gfx@lists.freedesktop.org; Deucher, Alexander
> Cc: Huang, Ray; Liu, Monk
> Subject: [PATCH] Revert "drm/amdgpu:correct smc fw version error"
> 
> From: Huang Rui <Ray.Huang@amd.com>
> 
> This reverts commit bb2a2de6e2ea0e99d0d1a20d06536c4dcd66a196.
> 
> SMC firmware version error should be fixed while ucode is generated.
> I would do the fix in firmware side.
> 
> Signed-off-by: Huang Rui <Ray.Huang@amd.com>
> Cc: Monk Liu <Monk.Liu@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> index ab2d7fb..7a8bfa3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> @@ -785,13 +785,12 @@ static int amdgpu_cgs_get_firmware_info(struct
> cgs_device *cgs_device,
>  		info->fw_version =
> amdgpu_get_firmware_version(cgs_device, type);
>  		info->feature_version = (uint16_t)le32_to_cpu(header-
> >ucode_feature_version);
>  	} else {
> -		uint32_t fw_ver;
>  		char fw_name[30] = {0};
>  		int err = 0;
>  		uint32_t ucode_size;
>  		uint32_t ucode_start_address;
>  		const uint8_t *src;
> -		struct smc_firmware_header_v1_0 *hdr;
> +		const struct smc_firmware_header_v1_0 *hdr;
> 
>  		if (!adev->pm.fw) {
>  			switch (adev->asic_type) {
> @@ -836,15 +835,12 @@ static int amdgpu_cgs_get_firmware_info(struct
> cgs_device *cgs_device,
>  			}
>  		}
> 
> -		hdr = (struct smc_firmware_header_v1_0 *)adev->pm.fw-
> >data;
> -		/* firmware version is located at 69 dw from begining */
> -		fw_ver = *((uint32_t *)adev->pm.fw->data + 69);
> -		hdr->header.ucode_version = fw_ver;
> +		hdr = (const struct smc_firmware_header_v1_0 *)	adev-
> >pm.fw->data;
>  		amdgpu_ucode_print_smc_hdr(&hdr->header);
>  		adev->pm.fw_version = le32_to_cpu(hdr-
> >header.ucode_version);
>  		ucode_size = le32_to_cpu(hdr->header.ucode_size_bytes);
>  		ucode_start_address = le32_to_cpu(hdr-
> >ucode_start_addr);
> -		src = (uint8_t *)(adev->pm.fw->data +
> +		src = (const uint8_t *)(adev->pm.fw->data +
>  		       le32_to_cpu(hdr->header.ucode_array_offset_bytes));
> 
>  		info->version = adev->pm.fw_version;
> --
> 2.7.4