amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu/soc15: fix using ip discovery tables on renoir
@ 2020-06-05 15:34 Alex Deucher
  2020-06-05 15:35 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Deucher @ 2020-06-05 15:34 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

The PWR block moved into SMUIO, so the ip discovery table
doesn't have an entry for PWR, but the register has the
same absolute offset, so just patch up the offsets after
updating the offsets from the IP discovery table.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 623745b2d8b3..21f29685f158 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -670,7 +670,7 @@ static uint32_t soc15_get_rev_id(struct amdgpu_device *adev)
 
 int soc15_set_ip_blocks(struct amdgpu_device *adev)
 {
-	int r;
+	int r, i;
 
 	/* Set IP register base before any HW register access */
 	switch (adev->asic_type) {
@@ -686,6 +686,10 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)
 				DRM_WARN("failed to init reg base from ip discovery table, "
 					 "fallback to legacy init method\n");
 				vega10_reg_base_init(adev);
+			} else {
+				/* PWR block was merged into SMUIO on renoir */
+				for (i = 0 ; i < HWIP_MAX_INSTANCE; ++i)
+					adev->reg_offset[PWR_HWIP][i] = adev->reg_offset[SMUIO_HWIP][i];
 			}
 		}
 		break;
-- 
2.25.4

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

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

* Re: [PATCH] drm/amdgpu/soc15: fix using ip discovery tables on renoir
  2020-06-05 15:34 [PATCH] drm/amdgpu/soc15: fix using ip discovery tables on renoir Alex Deucher
@ 2020-06-05 15:35 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2020-06-05 15:35 UTC (permalink / raw)
  To: amd-gfx list; +Cc: Alex Deucher

On Fri, Jun 5, 2020 at 11:34 AM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> The PWR block moved into SMUIO, so the ip discovery table
> doesn't have an entry for PWR, but the register has the
> same absolute offset, so just patch up the offsets after
> updating the offsets from the IP discovery table.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Nevermind.  this won't work.

> ---
>  drivers/gpu/drm/amd/amdgpu/soc15.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
> index 623745b2d8b3..21f29685f158 100644
> --- a/drivers/gpu/drm/amd/amdgpu/soc15.c
> +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
> @@ -670,7 +670,7 @@ static uint32_t soc15_get_rev_id(struct amdgpu_device *adev)
>
>  int soc15_set_ip_blocks(struct amdgpu_device *adev)
>  {
> -       int r;
> +       int r, i;
>
>         /* Set IP register base before any HW register access */
>         switch (adev->asic_type) {
> @@ -686,6 +686,10 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)
>                                 DRM_WARN("failed to init reg base from ip discovery table, "
>                                          "fallback to legacy init method\n");
>                                 vega10_reg_base_init(adev);
> +                       } else {
> +                               /* PWR block was merged into SMUIO on renoir */
> +                               for (i = 0 ; i < HWIP_MAX_INSTANCE; ++i)
> +                                       adev->reg_offset[PWR_HWIP][i] = adev->reg_offset[SMUIO_HWIP][i];
>                         }
>                 }
>                 break;
> --
> 2.25.4
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2020-06-05 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-05 15:34 [PATCH] drm/amdgpu/soc15: fix using ip discovery tables on renoir Alex Deucher
2020-06-05 15:35 ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).