All of lore.kernel.org
 help / color / mirror / Atom feed
* [Dali] Raven 2 detection Patch
@ 2020-02-05 14:58 Tawfik, Aly
  2020-02-05 20:33 ` Alex Deucher
  0 siblings, 1 reply; 4+ messages in thread
From: Tawfik, Aly @ 2020-02-05 14:58 UTC (permalink / raw)
  To: amd-gfx, Chiu, Michael


[-- Attachment #1.1: Type: text/plain, Size: 593 bytes --]

Hi,



Dali is a raven2 based asic that drives at a lower (6W) TDP than other raven 2 chips. Currently the fused internal id is the same on all raven 2 boards, this means that the detection process must be done through PCIE REV ID.

Unfortunately PCIE REV ID is not defined inside the scope of display. I created a patch to alter the fused value for internal rev_id if the chip is detected as dali through PCIE REV ID. So that detection of the chip will be possible inside of Display core.



Can you kindly provide feedback on this workaround.



Best Regards,

Aly Tawfik


[-- Attachment #1.2: Type: text/html, Size: 2628 bytes --]

[-- Attachment #2: 0001-drm-amdgpu-DALI-Dali-Varient-Detection.patch --]
[-- Type: application/octet-stream, Size: 2748 bytes --]

From 6849e7a345345b90e3be586248c4b82581010498 Mon Sep 17 00:00:00 2001
From: Ali-Tawfik <altawfik@amd.com>
Date: Mon, 3 Feb 2020 11:11:02 -0500
Subject: [PATCH] drm\amdgpu: [DALI] Dali Varient Detection

Problem Description:

Currently we are checking internal fused rev id with pci rev id. However, fused internal rev id is the same on all raven2 parts (in which Dali was based on too), thus Dali detection fails

Fix:

To detect this chip we need to use pci rev id but it is not defined in the
scope of DC. To workaround this issue alter the fused
rev id using pcie id for all dali chips before DC init,
then use the internal fused id for chip detection in DC.

Signed-off-by: Ali-Tawfik <altawfik@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/soc15.c                | 9 ++++++++-
 drivers/gpu/drm/amd/display/include/dal_asic_id.h | 4 ++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 317803f6a561..f85c27fbe64c 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -1094,8 +1094,15 @@ static int soc15_common_early_init(void *handle)
 		break;
 	case CHIP_RAVEN:
 		adev->asic_funcs = &soc15_asic_funcs;
-		if (adev->rev_id >= 0x8)
+		if (adev->rev_id >= 0x8) {
+			if ((adev->pdev->device == 0x15d8) &&
+				 ((adev->pdev->revision == 0xCF) ||
+				 (adev->pdev->revision == 0xE3)||
+				 (adev->pdev->revision == 0xE4))) {
+				adev->rev_id = 0x10;
+			}
 			adev->external_rev_id = adev->rev_id + 0x79;
+		}
 		else if (adev->pdev->device == 0x15d8)
 			adev->external_rev_id = adev->rev_id + 0x41;
 		else if (adev->rev_id == 1)
diff --git a/drivers/gpu/drm/amd/display/include/dal_asic_id.h b/drivers/gpu/drm/amd/display/include/dal_asic_id.h
index a2903985b9e8..0329f26bfacd 100644
--- a/drivers/gpu/drm/amd/display/include/dal_asic_id.h
+++ b/drivers/gpu/drm/amd/display/include/dal_asic_id.h
@@ -143,6 +143,7 @@
 #define RAVEN2_15D8_REV_EB 0xEB
 #define RAVEN1_F0 0xF0
 #define RAVEN_UNKNOWN 0xFF
+#define RAVEN2_15D8_B0_LW 0x89
 #ifndef ASICREV_IS_RAVEN
 #define ASICREV_IS_RAVEN(eChipRev) ((eChipRev >= RAVEN_A0) && eChipRev < RAVEN_UNKNOWN)
 #endif
@@ -152,8 +153,7 @@
 #define ASICREV_IS_RAVEN2(eChipRev) ((eChipRev >= RAVEN2_A0) && (eChipRev < RAVEN1_F0))
 #endif
 #define ASICREV_IS_RV1_F0(eChipRev) ((eChipRev >= RAVEN1_F0) && (eChipRev < RAVEN_UNKNOWN))
-#define ASICREV_IS_DALI(eChipRev) ((eChipRev == RAVEN2_15D8_REV_E3) \
-		|| (eChipRev == RAVEN2_15D8_REV_E4))
+#define ASICREV_IS_DALI(eChipRev) ((eChipRev == RAVEN2_15D8_B0_LW))
 #define ASICREV_IS_POLLOCK(eChipRev) (eChipRev == RAVEN2_15D8_REV_94 \
 		|| eChipRev == RAVEN2_15D8_REV_95 \
 			|| eChipRev == RAVEN2_15D8_REV_E9 \
-- 
2.17.1


[-- Attachment #3: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Dali] Raven 2 detection Patch
  2020-02-05 14:58 [Dali] Raven 2 detection Patch Tawfik, Aly
@ 2020-02-05 20:33 ` Alex Deucher
  2020-02-06 18:00   ` Tawfik, Aly
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Deucher @ 2020-02-05 20:33 UTC (permalink / raw)
  To: Tawfik, Aly; +Cc: amd-gfx, Chiu, Michael

just a couple of typos in the patch title:
drm\amdgpu: [DALI] Dali Varient Detection
It should be:
drm/amdgpu: [DALI] Dali Variant Detection
With that fixed, patch is:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

On Wed, Feb 5, 2020 at 9:59 AM Tawfik, Aly <Aly.Tawfik@amd.com> wrote:
>
> Hi,
>
>
>
> Dali is a raven2 based asic that drives at a lower (6W) TDP than other raven 2 chips. Currently the fused internal id is the same on all raven 2 boards, this means that the detection process must be done through PCIE REV ID.
>
> Unfortunately PCIE REV ID is not defined inside the scope of display. I created a patch to alter the fused value for internal rev_id if the chip is detected as dali through PCIE REV ID. So that detection of the chip will be possible inside of Display core.
>
>
>
> Can you kindly provide feedback on this workaround.
>
>
>
> Best Regards,
>
> Aly Tawfik
>
>
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [Dali] Raven 2 detection Patch
  2020-02-05 20:33 ` Alex Deucher
@ 2020-02-06 18:00   ` Tawfik, Aly
  2020-02-06 18:28     ` Alex Deucher
  0 siblings, 1 reply; 4+ messages in thread
From: Tawfik, Aly @ 2020-02-06 18:00 UTC (permalink / raw)
  To: Alex Deucher; +Cc: amd-gfx, Chiu, Michael

[-- Attachment #1: Type: text/plain, Size: 2861 bytes --]


***Reattached patch with corrections***

From b828a2b3df3057461dfceb4d1394fe858ced9d03 Mon Sep 17 00:00:00 2001
From: Ali-Tawfik <altawfik@amd.com>
Date: Thu, 6 Feb 2020 12:53:02 -0500
Subject: [PATCH] drm/amdgpu: [DALI] Dali Variant Detection

Problem Description:

Currently we are checking internal fused rev id with pci rev id. However, fused internal rev id is the same on all raven2 parts (in which Dali was based on too), thus Dali detection fails

Fix:

To detect this chip we need to use pci rev id but it is not defined in the
scope of DC. To workaround this issue alter the fused
rev id using pcie id for all dali chips before DC init,
then use the internal fused id for chip detection in DC.

Signed-off-by: Ali-Tawfik <altawfik@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/soc15.c                | 9 ++++++++-
 drivers/gpu/drm/amd/display/include/dal_asic_id.h | 4 ++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 317803f6a561..f85c27fbe64c 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -1094,8 +1094,15 @@ static int soc15_common_early_init(void *handle)
 		break;
 	case CHIP_RAVEN:
 		adev->asic_funcs = &soc15_asic_funcs;
-		if (adev->rev_id >= 0x8)
+		if (adev->rev_id >= 0x8) {
+			if ((adev->pdev->device == 0x15d8) &&
+				 ((adev->pdev->revision == 0xCF) ||
+				 (adev->pdev->revision == 0xE3)||
+				 (adev->pdev->revision == 0xE4))) {
+				adev->rev_id = 0x10;
+			}
 			adev->external_rev_id = adev->rev_id + 0x79;
+		}
 		else if (adev->pdev->device == 0x15d8)
 			adev->external_rev_id = adev->rev_id + 0x41;
 		else if (adev->rev_id == 1)
diff --git a/drivers/gpu/drm/amd/display/include/dal_asic_id.h b/drivers/gpu/drm/amd/display/include/dal_asic_id.h
index a2903985b9e8..0329f26bfacd 100644
--- a/drivers/gpu/drm/amd/display/include/dal_asic_id.h
+++ b/drivers/gpu/drm/amd/display/include/dal_asic_id.h
@@ -143,6 +143,7 @@
 #define RAVEN2_15D8_REV_EB 0xEB
 #define RAVEN1_F0 0xF0
 #define RAVEN_UNKNOWN 0xFF
+#define RAVEN2_15D8_B0_LW 0x89
 #ifndef ASICREV_IS_RAVEN
 #define ASICREV_IS_RAVEN(eChipRev) ((eChipRev >= RAVEN_A0) && eChipRev < RAVEN_UNKNOWN)
 #endif
@@ -152,8 +153,7 @@
 #define ASICREV_IS_RAVEN2(eChipRev) ((eChipRev >= RAVEN2_A0) && (eChipRev < RAVEN1_F0))
 #endif
 #define ASICREV_IS_RV1_F0(eChipRev) ((eChipRev >= RAVEN1_F0) && (eChipRev < RAVEN_UNKNOWN))
-#define ASICREV_IS_DALI(eChipRev) ((eChipRev == RAVEN2_15D8_REV_E3) \
-		|| (eChipRev == RAVEN2_15D8_REV_E4))
+#define ASICREV_IS_DALI(eChipRev) ((eChipRev == RAVEN2_15D8_B0_LW))
 #define ASICREV_IS_POLLOCK(eChipRev) (eChipRev == RAVEN2_15D8_REV_94 \
 		|| eChipRev == RAVEN2_15D8_REV_95 \
 			|| eChipRev == RAVEN2_15D8_REV_E9 \
-- 
2.17.1


[-- Attachment #2: 0001-drm-amdgpu-DALI-Dali-Variant-Detection.patch --]
[-- Type: application/octet-stream, Size: 2748 bytes --]

From b828a2b3df3057461dfceb4d1394fe858ced9d03 Mon Sep 17 00:00:00 2001
From: Ali-Tawfik <altawfik@amd.com>
Date: Thu, 6 Feb 2020 12:53:02 -0500
Subject: [PATCH] drm/amdgpu: [DALI] Dali Variant Detection

Problem Description:

Currently we are checking internal fused rev id with pci rev id. However, fused internal rev id is the same on all raven2 parts (in which Dali was based on too), thus Dali detection fails

Fix:

To detect this chip we need to use pci rev id but it is not defined in the
scope of DC. To workaround this issue alter the fused
rev id using pcie id for all dali chips before DC init,
then use the internal fused id for chip detection in DC.

Signed-off-by: Ali-Tawfik <altawfik@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/soc15.c                | 9 ++++++++-
 drivers/gpu/drm/amd/display/include/dal_asic_id.h | 4 ++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 317803f6a561..f85c27fbe64c 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -1094,8 +1094,15 @@ static int soc15_common_early_init(void *handle)
 		break;
 	case CHIP_RAVEN:
 		adev->asic_funcs = &soc15_asic_funcs;
-		if (adev->rev_id >= 0x8)
+		if (adev->rev_id >= 0x8) {
+			if ((adev->pdev->device == 0x15d8) &&
+				 ((adev->pdev->revision == 0xCF) ||
+				 (adev->pdev->revision == 0xE3)||
+				 (adev->pdev->revision == 0xE4))) {
+				adev->rev_id = 0x10;
+			}
 			adev->external_rev_id = adev->rev_id + 0x79;
+		}
 		else if (adev->pdev->device == 0x15d8)
 			adev->external_rev_id = adev->rev_id + 0x41;
 		else if (adev->rev_id == 1)
diff --git a/drivers/gpu/drm/amd/display/include/dal_asic_id.h b/drivers/gpu/drm/amd/display/include/dal_asic_id.h
index a2903985b9e8..0329f26bfacd 100644
--- a/drivers/gpu/drm/amd/display/include/dal_asic_id.h
+++ b/drivers/gpu/drm/amd/display/include/dal_asic_id.h
@@ -143,6 +143,7 @@
 #define RAVEN2_15D8_REV_EB 0xEB
 #define RAVEN1_F0 0xF0
 #define RAVEN_UNKNOWN 0xFF
+#define RAVEN2_15D8_B0_LW 0x89
 #ifndef ASICREV_IS_RAVEN
 #define ASICREV_IS_RAVEN(eChipRev) ((eChipRev >= RAVEN_A0) && eChipRev < RAVEN_UNKNOWN)
 #endif
@@ -152,8 +153,7 @@
 #define ASICREV_IS_RAVEN2(eChipRev) ((eChipRev >= RAVEN2_A0) && (eChipRev < RAVEN1_F0))
 #endif
 #define ASICREV_IS_RV1_F0(eChipRev) ((eChipRev >= RAVEN1_F0) && (eChipRev < RAVEN_UNKNOWN))
-#define ASICREV_IS_DALI(eChipRev) ((eChipRev == RAVEN2_15D8_REV_E3) \
-		|| (eChipRev == RAVEN2_15D8_REV_E4))
+#define ASICREV_IS_DALI(eChipRev) ((eChipRev == RAVEN2_15D8_B0_LW))
 #define ASICREV_IS_POLLOCK(eChipRev) (eChipRev == RAVEN2_15D8_REV_94 \
 		|| eChipRev == RAVEN2_15D8_REV_95 \
 			|| eChipRev == RAVEN2_15D8_REV_E9 \
-- 
2.17.1


[-- Attachment #3: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Dali] Raven 2 detection Patch
  2020-02-06 18:00   ` Tawfik, Aly
@ 2020-02-06 18:28     ` Alex Deucher
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2020-02-06 18:28 UTC (permalink / raw)
  To: Tawfik, Aly; +Cc: amd-gfx, Chiu, Michael

On Thu, Feb 6, 2020 at 1:00 PM Tawfik, Aly <Aly.Tawfik@amd.com> wrote:
>
>
> ***Reattached patch with corrections***
>
> From b828a2b3df3057461dfceb4d1394fe858ced9d03 Mon Sep 17 00:00:00 2001
> From: Ali-Tawfik <altawfik@amd.com>
> Date: Thu, 6 Feb 2020 12:53:02 -0500
> Subject: [PATCH] drm/amdgpu: [DALI] Dali Variant Detection
>
> Problem Description:
>
> Currently we are checking internal fused rev id with pci rev id. However, fused internal rev id is the same on all raven2 parts (in which Dali was based on too), thus Dali detection fails
>
> Fix:
>
> To detect this chip we need to use pci rev id but it is not defined in the
> scope of DC. To workaround this issue alter the fused
> rev id using pcie id for all dali chips before DC init,
> then use the internal fused id for chip detection in DC.
>
> Signed-off-by: Ali-Tawfik <altawfik@amd.com>

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

Once it's reviewed, feel free to commit it.

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/soc15.c                | 9 ++++++++-
>  drivers/gpu/drm/amd/display/include/dal_asic_id.h | 4 ++--
>  2 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
> index 317803f6a561..f85c27fbe64c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/soc15.c
> +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
> @@ -1094,8 +1094,15 @@ static int soc15_common_early_init(void *handle)
>                 break;
>         case CHIP_RAVEN:
>                 adev->asic_funcs = &soc15_asic_funcs;
> -               if (adev->rev_id >= 0x8)
> +               if (adev->rev_id >= 0x8) {
> +                       if ((adev->pdev->device == 0x15d8) &&
> +                                ((adev->pdev->revision == 0xCF) ||
> +                                (adev->pdev->revision == 0xE3)||
> +                                (adev->pdev->revision == 0xE4))) {
> +                               adev->rev_id = 0x10;
> +                       }
>                         adev->external_rev_id = adev->rev_id + 0x79;
> +               }
>                 else if (adev->pdev->device == 0x15d8)
>                         adev->external_rev_id = adev->rev_id + 0x41;
>                 else if (adev->rev_id == 1)
> diff --git a/drivers/gpu/drm/amd/display/include/dal_asic_id.h b/drivers/gpu/drm/amd/display/include/dal_asic_id.h
> index a2903985b9e8..0329f26bfacd 100644
> --- a/drivers/gpu/drm/amd/display/include/dal_asic_id.h
> +++ b/drivers/gpu/drm/amd/display/include/dal_asic_id.h
> @@ -143,6 +143,7 @@
>  #define RAVEN2_15D8_REV_EB 0xEB
>  #define RAVEN1_F0 0xF0
>  #define RAVEN_UNKNOWN 0xFF
> +#define RAVEN2_15D8_B0_LW 0x89
>  #ifndef ASICREV_IS_RAVEN
>  #define ASICREV_IS_RAVEN(eChipRev) ((eChipRev >= RAVEN_A0) && eChipRev < RAVEN_UNKNOWN)
>  #endif
> @@ -152,8 +153,7 @@
>  #define ASICREV_IS_RAVEN2(eChipRev) ((eChipRev >= RAVEN2_A0) && (eChipRev < RAVEN1_F0))
>  #endif
>  #define ASICREV_IS_RV1_F0(eChipRev) ((eChipRev >= RAVEN1_F0) && (eChipRev < RAVEN_UNKNOWN))
> -#define ASICREV_IS_DALI(eChipRev) ((eChipRev == RAVEN2_15D8_REV_E3) \
> -               || (eChipRev == RAVEN2_15D8_REV_E4))
> +#define ASICREV_IS_DALI(eChipRev) ((eChipRev == RAVEN2_15D8_B0_LW))
>  #define ASICREV_IS_POLLOCK(eChipRev) (eChipRev == RAVEN2_15D8_REV_94 \
>                 || eChipRev == RAVEN2_15D8_REV_95 \
>                         || eChipRev == RAVEN2_15D8_REV_E9 \
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-06 18:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 14:58 [Dali] Raven 2 detection Patch Tawfik, Aly
2020-02-05 20:33 ` Alex Deucher
2020-02-06 18:00   ` Tawfik, Aly
2020-02-06 18:28     ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.