* [PATCH] drm/amdgpu: add checking for sos version
@ 2018-05-23 5:45 Huang Rui
[not found] ` <1527054349-30329-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Huang Rui @ 2018-05-23 5:45 UTC (permalink / raw)
To: Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Junwei Zhang, Huang Rui
Signed-off-by: Huang Rui <ray.huang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/psp_v3_1.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
index 196e75d..efe5c1f 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
@@ -44,6 +44,8 @@ MODULE_FIRMWARE("amdgpu/vega12_asd.bin");
#define smnMP1_FIRMWARE_FLAGS 0x3010028
+static uint32_t sos_old_versions[] = {1517616, 1510592, 1448594, 1446554};
+
static int
psp_v3_1_get_fw_type(struct amdgpu_firmware_info *ucode, enum psp_gfx_fw_type *type)
{
@@ -207,12 +209,31 @@ static int psp_v3_1_bootloader_load_sysdrv(struct psp_context *psp)
return ret;
}
+static bool psp_v3_1_match_version(struct amdgpu_device *adev, uint32_t ver)
+{
+ int i;
+
+ if (ver == adev->psp.sos_fw_version)
+ return true;
+
+ /*
+ * Double check if the latest three legacy versions.
+ * If yes, it is still the right version.
+ */
+ for (i = 0; i < sizeof(sos_old_versions) / sizeof(uint32_t); i++) {
+ if (sos_old_versions[i] == adev->psp.sos_fw_version)
+ return true;
+ }
+
+ return false;
+}
+
static int psp_v3_1_bootloader_load_sos(struct psp_context *psp)
{
int ret;
unsigned int psp_gfxdrv_command_reg = 0;
struct amdgpu_device *adev = psp->adev;
- uint32_t sol_reg;
+ uint32_t sol_reg, ver;
/* Check sOS sign of life register to confirm sys driver and sOS
* are already been loaded.
@@ -245,6 +266,10 @@ static int psp_v3_1_bootloader_load_sos(struct psp_context *psp)
RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81),
0, true);
+ ver = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_58);
+ if (!psp_v3_1_match_version(adev, ver))
+ DRM_WARN("SOS version doesn't match\n");
+
return ret;
}
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <1527054349-30329-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>]
* Re: [PATCH] drm/amdgpu: add checking for sos version [not found] ` <1527054349-30329-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org> @ 2018-05-23 6:08 ` Zhang, Jerry (Junwei) 2018-05-23 7:34 ` Christian König 1 sibling, 0 replies; 3+ messages in thread From: Zhang, Jerry (Junwei) @ 2018-05-23 6:08 UTC (permalink / raw) To: Huang Rui, Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW On 05/23/2018 01:45 PM, Huang Rui wrote: > Signed-off-by: Huang Rui <ray.huang@amd.com> > Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com> > --- > drivers/gpu/drm/amd/amdgpu/psp_v3_1.c | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c > index 196e75d..efe5c1f 100644 > --- a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c > +++ b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c > @@ -44,6 +44,8 @@ MODULE_FIRMWARE("amdgpu/vega12_asd.bin"); > > #define smnMP1_FIRMWARE_FLAGS 0x3010028 > > +static uint32_t sos_old_versions[] = {1517616, 1510592, 1448594, 1446554}; > + > static int > psp_v3_1_get_fw_type(struct amdgpu_firmware_info *ucode, enum psp_gfx_fw_type *type) > { > @@ -207,12 +209,31 @@ static int psp_v3_1_bootloader_load_sysdrv(struct psp_context *psp) > return ret; > } > > +static bool psp_v3_1_match_version(struct amdgpu_device *adev, uint32_t ver) > +{ > + int i; > + > + if (ver == adev->psp.sos_fw_version) > + return true; > + > + /* > + * Double check if the latest three legacy versions. > + * If yes, it is still the right version. > + */ > + for (i = 0; i < sizeof(sos_old_versions) / sizeof(uint32_t); i++) { > + if (sos_old_versions[i] == adev->psp.sos_fw_version) > + return true; > + } > + > + return false; > +} > + > static int psp_v3_1_bootloader_load_sos(struct psp_context *psp) > { > int ret; > unsigned int psp_gfxdrv_command_reg = 0; > struct amdgpu_device *adev = psp->adev; > - uint32_t sol_reg; > + uint32_t sol_reg, ver; > > /* Check sOS sign of life register to confirm sys driver and sOS > * are already been loaded. > @@ -245,6 +266,10 @@ static int psp_v3_1_bootloader_load_sos(struct psp_context *psp) > RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81), > 0, true); > > + ver = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_58); > + if (!psp_v3_1_match_version(adev, ver)) > + DRM_WARN("SOS version doesn't match\n"); > + > return ret; > } > > _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amdgpu: add checking for sos version [not found] ` <1527054349-30329-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org> 2018-05-23 6:08 ` Zhang, Jerry (Junwei) @ 2018-05-23 7:34 ` Christian König 1 sibling, 0 replies; 3+ messages in thread From: Christian König @ 2018-05-23 7:34 UTC (permalink / raw) To: Huang Rui, Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW Cc: Junwei Zhang Please add a commit message. We recently got pinged by Linus that this is missing on to many of our patches. Christian. Am 23.05.2018 um 07:45 schrieb Huang Rui: > Signed-off-by: Huang Rui <ray.huang@amd.com> > Acked-by: Alex Deucher <alexander.deucher@amd.com> > --- > drivers/gpu/drm/amd/amdgpu/psp_v3_1.c | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c > index 196e75d..efe5c1f 100644 > --- a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c > +++ b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c > @@ -44,6 +44,8 @@ MODULE_FIRMWARE("amdgpu/vega12_asd.bin"); > > #define smnMP1_FIRMWARE_FLAGS 0x3010028 > > +static uint32_t sos_old_versions[] = {1517616, 1510592, 1448594, 1446554}; > + > static int > psp_v3_1_get_fw_type(struct amdgpu_firmware_info *ucode, enum psp_gfx_fw_type *type) > { > @@ -207,12 +209,31 @@ static int psp_v3_1_bootloader_load_sysdrv(struct psp_context *psp) > return ret; > } > > +static bool psp_v3_1_match_version(struct amdgpu_device *adev, uint32_t ver) > +{ > + int i; > + > + if (ver == adev->psp.sos_fw_version) > + return true; > + > + /* > + * Double check if the latest three legacy versions. > + * If yes, it is still the right version. > + */ > + for (i = 0; i < sizeof(sos_old_versions) / sizeof(uint32_t); i++) { > + if (sos_old_versions[i] == adev->psp.sos_fw_version) > + return true; > + } > + > + return false; > +} > + > static int psp_v3_1_bootloader_load_sos(struct psp_context *psp) > { > int ret; > unsigned int psp_gfxdrv_command_reg = 0; > struct amdgpu_device *adev = psp->adev; > - uint32_t sol_reg; > + uint32_t sol_reg, ver; > > /* Check sOS sign of life register to confirm sys driver and sOS > * are already been loaded. > @@ -245,6 +266,10 @@ static int psp_v3_1_bootloader_load_sos(struct psp_context *psp) > RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81), > 0, true); > > + ver = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_58); > + if (!psp_v3_1_match_version(adev, ver)) > + DRM_WARN("SOS version doesn't match\n"); > + > return ret; > } > _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-05-23 7:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-23 5:45 [PATCH] drm/amdgpu: add checking for sos version Huang Rui
[not found] ` <1527054349-30329-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
2018-05-23 6:08 ` Zhang, Jerry (Junwei)
2018-05-23 7:34 ` Christian König
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.