Skip to contentSkip to conversation

drm/amdgpu: switch to macro for psp bootloader command

PATCH In review Hawking Zhang 3 participants 7 messages Jul 10, 2019 – Jul 11, 2019 4 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amdgpu: switch to macro for psp bootloader command

Change-Id Ief4c1e5ca01df0a028a784c0faf37544939733a3
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 9 +++++++++
 drivers/gpu/drm/amd/amdgpu/psp_v11_0.c  | 4 ++--
 drivers/gpu/drm/amd/amdgpu/psp_v3_1.c   | 4 ++--
 3 files changed, 13 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +9 -0
index e28cf5e..8ddcec1 100644
@@ -42,6 +42,15 @@ struct psp_context;
 struct psp_xgmi_node_info;
 struct psp_xgmi_topology_info;
 
+enum psp_bootloader_cmd {
+	PSP_BL__LOAD_SYSDRV		= 0x10000,
+	PSP_BL__LOAD_SOSDRV		= 0x20000,
+	PSP_BL__NO_ECC			= 0x40000,
+	PSP_BL__PARTIAL_ECC		= 0x50000,
+	PSP_BL__FULL_ECC		= 0x60000,
+	PSP_BL__LOAD_KEY_DATABASE	= 0x80000,
+};
+
 enum psp_ring_type
 {
 	PSP_RING_TYPE__INVALID = 0,
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +2 -2
index 1b6c20c..e784091 100644
@@ -212,7 +212,7 @@ static int psp_v11_0_bootloader_load_sysdrv(struct psp_context *psp)
 	/* Provide the sys driver to bootloader */
 	WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
 	       (uint32_t)(psp->fw_pri_mc_addr >> 20));
-	psp_gfxdrv_command_reg = 1 << 16;
+	psp_gfxdrv_command_reg = PSP_BL__LOAD_SYSDRV;
 	WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
 	       psp_gfxdrv_command_reg);
 
@@ -253,7 +253,7 @@ static int psp_v11_0_bootloader_load_sos(struct psp_context *psp)
 	/* Provide the PSP secure OS to bootloader */
 	WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
 	       (uint32_t)(psp->fw_pri_mc_addr >> 20));
-	psp_gfxdrv_command_reg = 2 << 16;
+	psp_gfxdrv_command_reg = PSP_BL__LOAD_SOSDRV;
 	WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
 	       psp_gfxdrv_command_reg);
 
drivers/gpu/drm/amd/amdgpu/psp_v3_1.c +2 -2
index 3f58277..ec3a056 100644
@@ -153,7 +153,7 @@ static int psp_v3_1_bootloader_load_sysdrv(struct psp_context *psp)
 	/* Provide the sys driver to bootloader */
 	WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
 	       (uint32_t)(psp->fw_pri_mc_addr >> 20));
-	psp_gfxdrv_command_reg = 1 << 16;
+	psp_gfxdrv_command_reg = PSP_BL__LOAD_SYSDRV;
 	WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
 	       psp_gfxdrv_command_reg);
 
@@ -216,7 +216,7 @@ static int psp_v3_1_bootloader_load_sos(struct psp_context *psp)
 	/* Provide the PSP secure OS to bootloader */
 	WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
 	       (uint32_t)(psp->fw_pri_mc_addr >> 20));
-	psp_gfxdrv_command_reg = 2 << 16;
+	psp_gfxdrv_command_reg = PSP_BL__LOAD_SOSDRV;
 	WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
 	       psp_gfxdrv_command_reg);
 
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1562774338-4457-1-git-send-email-Hawking.Zhang-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/2 drm/amdgpu: support key database loading for navi10

Starting from navi10, driver should send Key Database Load command to Bootloader before loading sys_drv and sos

Change-Id Ib82d21840fb77da2217dd8b8f013177e61d72990
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c   | 10 +++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h   |  5 ++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c |  6 ++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h |  3 ++
 drivers/gpu/drm/amd/amdgpu/psp_v11_0.c    | 49 ++++++++++++++++++++++++++++++-
 5 files changed, 72 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +10 -0
index ed580e8b..3378cb38 100644
@@ -770,6 +770,16 @@ static int psp_hw_start(struct psp_context *psp)
 	int ret;
 
 	if (!amdgpu_sriov_vf(adev) || !adev->in_gpu_reset) {
+
+		if (psp->kdb_start_addr &&
+		    (psp->funcs->bootloader_load_kdb != NULL)) {
+			ret = psp_bootloader_load_kdb(psp);
+			if (ret) {
+				DRM_ERROR("PSP load kdb failed!\n");
+				return ret;
+			}
+		}
+
 		ret = psp_bootloader_load_sysdrv(psp);
 		if (ret) {
 			DRM_ERROR("PSP load sysdrv failed!\n");
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +5 -0
index 8ddcec1..6f1746b 100644
@@ -82,6 +82,7 @@ enum psp_reg_prog_id {
 struct psp_funcs
 {
 	int (*init_microcode)(struct psp_context *psp);
+	int (*bootloader_load_kdb)(struct psp_context *psp);
 	int (*bootloader_load_sysdrv)(struct psp_context *psp);
 	int (*bootloader_load_sos)(struct psp_context *psp);
 	int (*ring_init)(struct psp_context *psp, enum psp_ring_type ring_type);
@@ -165,9 +166,11 @@ struct psp_context
 	uint32_t			sys_bin_size;
 	uint32_t			sos_bin_size;
 	uint32_t			toc_bin_size;
+	uint32_t			kdb_bin_size;
 	uint8_t				*sys_start_addr;
 	uint8_t				*sos_start_addr;
 	uint8_t				*toc_start_addr;
+	uint8_t				*kdb_start_addr;
 
 	/* tmr buffer */
 	struct amdgpu_bo		*tmr_bo;
@@ -229,6 +232,8 @@ struct amdgpu_psp_funcs {
 		(psp)->funcs->compare_sram_data((psp), (ucode), (type))
 #define psp_init_microcode(psp) \
 		((psp)->funcs->init_microcode ? (psp)->funcs->init_microcode((psp)) : 0)
+#define psp_bootloader_load_kdb(psp) \
+		((psp)->funcs->bootloader_load_kdb ? (psp)->funcs->bootloader_load_kdb((psp)) : 0)
 #define psp_bootloader_load_sysdrv(psp) \
 		((psp)->funcs->bootloader_load_sysdrv ? (psp)->funcs->bootloader_load_sysdrv((psp)) : 0)
 #define psp_bootloader_load_sos(psp) \
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +6 -0
index bf7e8ba..2042b60 100644
@@ -262,6 +262,12 @@ void amdgpu_ucode_print_psp_hdr(const struct common_firmware_header *hdr)
 				  le32_to_cpu(psp_hdr_v1_1->toc_offset_bytes));
 			DRM_DEBUG("toc_size_bytes: %u\n",
 				  le32_to_cpu(psp_hdr_v1_1->toc_size_bytes));
+			DRM_DEBUG("kdb_header_version: %u\n",
+				  le32_to_cpu(psp_hdr_v1_1->kdb_header_version));
+			DRM_DEBUG("kdb_offset_bytes: %u\n",
+				  le32_to_cpu(psp_hdr_v1_1->kdb_offset_bytes));
+			DRM_DEBUG("kdb_size_bytes: %u\n",
+				  le32_to_cpu(psp_hdr_v1_1->kdb_size_bytes));
 		}
 	} else {
 		DRM_ERROR("Unknown PSP ucode version: %u.%u\n",
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +3 -0
index f4694445..c1fb6dc 100644
@@ -85,6 +85,9 @@ struct psp_firmware_header_v1_1 {
 	uint32_t toc_header_version;
 	uint32_t toc_offset_bytes;
 	uint32_t toc_size_bytes;
+	uint32_t kdb_header_version;
+	uint32_t kdb_offset_bytes;
+	uint32_t kdb_size_bytes;
 };
 
 /* version_major=1, version_minor=0 */
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +48 -1

73 lines not on this page · raw message

Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1562774338-4457-2-git-send-email-Hawking.Zhang-5C7GfCeVMHo@public.gmane.org

Reviewed-by Xiaojie Yuan
#4 lore raw

Re: [PATCH 2/2] drm/amdgpu: support key database loading for navi10

BR,
Xiaojie

________________________________________
From: amd-gfx <[email protected]> on behalf of Hawking Zhang <[email protected]>
Sent: Wednesday, July 10, 2019 11:58 PM
To: [email protected]; Yuan, Xiaojie; Clements, John; Deucher, Alexander
Cc: Zhang, Hawking
Subject: [PATCH 2/2] drm/amdgpu: support key database loading for navi10

Starting from navi10, driver should send Key Database Load command to Bootloader before loading sys_drv and sos

Change-Id Ib82d21840fb77da2217dd8b8f013177e61d72990
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c   | 10 +++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h   |  5 ++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c |  6 ++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h |  3 ++
 drivers/gpu/drm/amd/amdgpu/psp_v11_0.c    | 49 ++++++++++++++++++++++++++++++-
 5 files changed, 72 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +10 -0
index ed580e8b..3378cb38 100644
@@ -770,6 +770,16 @@ static int psp_hw_start(struct psp_context *psp)
        int ret;
 
        if (!amdgpu_sriov_vf(adev) || !adev->in_gpu_reset) {
+
+               if (psp->kdb_start_addr &&
+                   (psp->funcs->bootloader_load_kdb != NULL)) {
+                       ret = psp_bootloader_load_kdb(psp);
+                       if (ret) {
+                               DRM_ERROR("PSP load kdb failed!\n");
+                               return ret;
+                       }
+               }
+
                ret = psp_bootloader_load_sysdrv(psp);
                if (ret) {
                        DRM_ERROR("PSP load sysdrv failed!\n");
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +5 -0
index 8ddcec1..6f1746b 100644
@@ -82,6 +82,7 @@ enum psp_reg_prog_id {
 struct psp_funcs
 {
        int (*init_microcode)(struct psp_context *psp);
+       int (*bootloader_load_kdb)(struct psp_context *psp);
        int (*bootloader_load_sysdrv)(struct psp_context *psp);
        int (*bootloader_load_sos)(struct psp_context *psp);
        int (*ring_init)(struct psp_context *psp, enum psp_ring_type ring_type);
@@ -165,9 +166,11 @@ struct psp_context
        uint32_t                        sys_bin_size;
        uint32_t                        sos_bin_size;
        uint32_t                        toc_bin_size;
+       uint32_t                        kdb_bin_size;
        uint8_t                         *sys_start_addr;
        uint8_t                         *sos_start_addr;
        uint8_t                         *toc_start_addr;
+       uint8_t                         *kdb_start_addr;
 
        /* tmr buffer */
        struct amdgpu_bo                *tmr_bo;
@@ -229,6 +232,8 @@ struct amdgpu_psp_funcs {
                (psp)->funcs->compare_sram_data((psp), (ucode), (type))
 #define psp_init_microcode(psp) \
                ((psp)->funcs->init_microcode ? (psp)->funcs->init_microcode((psp)) : 0)
+#define psp_bootloader_load_kdb(psp) \
+               ((psp)->funcs->bootloader_load_kdb ? (psp)->funcs->bootloader_load_kdb((psp)) : 0)
 #define psp_bootloader_load_sysdrv(psp) \
                ((psp)->funcs->bootloader_load_sysdrv ? (psp)->funcs->bootloader_load_sysdrv((psp)) : 0)
 #define psp_bootloader_load_sos(psp) \
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +6 -0
index bf7e8ba..2042b60 100644
@@ -262,6 +262,12 @@ void amdgpu_ucode_print_psp_hdr(const struct common_firmware_header *hdr)
                                  le32_to_cpu(psp_hdr_v1_1->toc_offset_bytes));
                        DRM_DEBUG("toc_size_bytes: %u\n",
                                  le32_to_cpu(psp_hdr_v1_1->toc_size_bytes));
+                       DRM_DEBUG("kdb_header_version: %u\n",
+                                 le32_to_cpu(psp_hdr_v1_1->kdb_header_version));
+                       DRM_DEBUG("kdb_offset_bytes: %u\n",
+                                 le32_to_cpu(psp_hdr_v1_1->kdb_offset_bytes));
+                       DRM_DEBUG("kdb_size_bytes: %u\n",
+                                 le32_to_cpu(psp_hdr_v1_1->kdb_size_bytes));
                }
        } else {
                DRM_ERROR("Unknown PSP ucode version: %u.%u\n",
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +3 -0
index f4694445..c1fb6dc 100644
@@ -85,6 +85,9 @@ struct psp_firmware_header_v1_1 {
        uint32_t toc_header_version;
        uint32_t toc_offset_bytes;
        uint32_t toc_size_bytes;
+       uint32_t kdb_header_version;
+       uint32_t kdb_offset_bytes;
+       uint32_t kdb_size_bytes;
 };
 
 /* version_major=1, version_minor=0 */
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +48 -1

73 lines not on this page · raw message

--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by
#5 lore raw
In reply to a message not in the archive
Quoted 1 line · Hawking Zhang

Please add a patch description.

Quoted 15 lines
Change-Id Ief4c1e5ca01df0a028a784c0faf37544939733a3
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 9 +++++++++
 drivers/gpu/drm/amd/amdgpu/psp_v11_0.c  | 4 ++--
 drivers/gpu/drm/amd/amdgpu/psp_v3_1.c   | 4 ++--
 3 files changed, 13 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +0 -0
index e28cf5e..8ddcec1 100644
@@ -42,6 +42,15 @@ struct psp_context;
 struct psp_xgmi_node_info;
 struct psp_xgmi_topology_info;

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h struct psp_context; · line 53

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +9 -0
 
+enum psp_bootloader_cmd {
+       PSP_BL__LOAD_SYSDRV             = 0x10000,
+       PSP_BL__LOAD_SOSDRV             = 0x20000,
+       PSP_BL__NO_ECC                  = 0x40000,
+       PSP_BL__PARTIAL_ECC             = 0x50000,
+       PSP_BL__FULL_ECC                = 0x60000,
+       PSP_BL__LOAD_KEY_DATABASE       = 0x80000,
+};
+

Maybe this would be better in psp_gfx_if.h since it's sort of part of the firmware interface, but I guess it's not really part of the psp ring interface. Either way, with the patch description added, the series is:

Quoted 50 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +0 -0
 enum psp_ring_type
 {
        PSP_RING_TYPE__INVALID = 0,
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +2 -2
index 1b6c20c..e784091 100644
@@ -212,7 +212,7 @@ static int psp_v11_0_bootloader_load_sysdrv(struct psp_context *psp)
        /* Provide the sys driver to bootloader */
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
               (uint32_t)(psp->fw_pri_mc_addr >> 20));
-       psp_gfxdrv_command_reg = 1 << 16;
+       psp_gfxdrv_command_reg = PSP_BL__LOAD_SYSDRV;
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
               psp_gfxdrv_command_reg);
 
@@ -253,7 +253,7 @@ static int psp_v11_0_bootloader_load_sos(struct psp_context *psp)
        /* Provide the PSP secure OS to bootloader */
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
               (uint32_t)(psp->fw_pri_mc_addr >> 20));
-       psp_gfxdrv_command_reg = 2 << 16;
+       psp_gfxdrv_command_reg = PSP_BL__LOAD_SOSDRV;
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
               psp_gfxdrv_command_reg);
 
drivers/gpu/drm/amd/amdgpu/psp_v3_1.c +2 -3
index 3f58277..ec3a056 100644
@@ -153,7 +153,7 @@ static int psp_v3_1_bootloader_load_sysdrv(struct psp_context *psp)
        /* Provide the sys driver to bootloader */
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
               (uint32_t)(psp->fw_pri_mc_addr >> 20));
-       psp_gfxdrv_command_reg = 1 << 16;
+       psp_gfxdrv_command_reg = PSP_BL__LOAD_SYSDRV;
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
               psp_gfxdrv_command_reg);
 
@@ -216,7 +216,7 @@ static int psp_v3_1_bootloader_load_sos(struct psp_context *psp)
        /* Provide the PSP secure OS to bootloader */
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
               (uint32_t)(psp->fw_pri_mc_addr >> 20));
-       psp_gfxdrv_command_reg = 2 << 16;
+       psp_gfxdrv_command_reg = PSP_BL__LOAD_SOSDRV;
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
               psp_gfxdrv_command_reg);
 
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CADnq5_ODqPSB_2DAeS8amdP3dHNJvO=koZMMncRtWEGBDPA7rg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

author Reviewed-by Alex Deucher
#7 lore raw

RE - Maybe this would be better in psp_gfx_if.h since it's sort of part of the firmware interface, but I guess it's not really part of the psp ring interface.

Yes, these cmds are not submitted to the psp ring and actually issued before the psp ring setup. They are not in the internal psp_gfx_if.h files, so I put them in general psp header.

Regards,
Hawking
-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: 2019年7月11日 1:25
To: Zhang, Hawking <[email protected]>
Cc: amd-gfx list <[email protected]>; Yuan, Xiaojie <[email protected]>; Clements, John <[email protected]>; Deucher, Alexander <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: switch to macro for psp bootloader command

Quoted 1 line · Hawking Zhang

Please add a patch description.

Quoted 15 lines
Change-Id Ief4c1e5ca01df0a028a784c0faf37544939733a3
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 9 +++++++++  
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c  | 4 ++--
 drivers/gpu/drm/amd/amdgpu/psp_v3_1.c   | 4 ++--
 3 files changed, 13 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +0 -0
index e28cf5e..8ddcec1 100644
@@ -42,6 +42,15 @@ struct psp_context;  struct psp_xgmi_node_info;  
 struct psp_xgmi_topology_info;

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h struct psp_context; struct psp_xgmi_node_info; · line 52

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +9 -0
 
+enum psp_bootloader_cmd {
+       PSP_BL__LOAD_SYSDRV             = 0x10000,
+       PSP_BL__LOAD_SOSDRV             = 0x20000,
+       PSP_BL__NO_ECC                  = 0x40000,
+       PSP_BL__PARTIAL_ECC             = 0x50000,
+       PSP_BL__FULL_ECC                = 0x60000,
+       PSP_BL__LOAD_KEY_DATABASE       = 0x80000,
+};
+

Maybe this would be better in psp_gfx_if.h since it's sort of part of the firmware interface, but I guess it's not really part of the psp ring interface. Either way, with the patch description added, the series is:

Quoted 52 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +0 -0
 enum psp_ring_type
 {
        PSP_RING_TYPE__INVALID = 0,
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +2 -2
index 1b6c20c..e784091 100644
@@ -212,7 +212,7 @@ static int psp_v11_0_bootloader_load_sysdrv(struct psp_context *psp)
        /* Provide the sys driver to bootloader */
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
               (uint32_t)(psp->fw_pri_mc_addr >> 20));
-       psp_gfxdrv_command_reg = 1 << 16;
+       psp_gfxdrv_command_reg = PSP_BL__LOAD_SYSDRV;
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
               psp_gfxdrv_command_reg);
 
@@ -253,7 +253,7 @@ static int psp_v11_0_bootloader_load_sos(struct psp_context *psp)
        /* Provide the PSP secure OS to bootloader */
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
               (uint32_t)(psp->fw_pri_mc_addr >> 20));
-       psp_gfxdrv_command_reg = 2 << 16;
+       psp_gfxdrv_command_reg = PSP_BL__LOAD_SOSDRV;
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
               psp_gfxdrv_command_reg);
 
drivers/gpu/drm/amd/amdgpu/psp_v3_1.c +2 -3
index 3f58277..ec3a056 100644
@@ -153,7 +153,7 @@ static int psp_v3_1_bootloader_load_sysdrv(struct psp_context *psp)
        /* Provide the sys driver to bootloader */
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
               (uint32_t)(psp->fw_pri_mc_addr >> 20));
-       psp_gfxdrv_command_reg = 1 << 16;
+       psp_gfxdrv_command_reg = PSP_BL__LOAD_SYSDRV;
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
               psp_gfxdrv_command_reg);
 
@@ -216,7 +216,7 @@ static int psp_v3_1_bootloader_load_sos(struct psp_context *psp)
        /* Provide the PSP secure OS to bootloader */
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
               (uint32_t)(psp->fw_pri_mc_addr >> 20));
-       psp_gfxdrv_command_reg = 2 << 16;
+       psp_gfxdrv_command_reg = PSP_BL__LOAD_SOSDRV;
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
               psp_gfxdrv_command_reg);
 
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): DM5PR12MB141867D8A862369F2B63C312FCF30-2J9CzHegvk81aAVlcVN8UQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

author Reviewed-by Alex Deucher
#9 lore raw

I get the confirmation from PSP team that below command are deprecated. I will drop them when push the patch

+       PSP_BL__NO_ECC                  = 0x40000,
+       PSP_BL__PARTIAL_ECC             = 0x50000,
+       PSP_BL__FULL_ECC                = 0x60000,

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Zhang, Hawking
Sent: 2019年7月11日 12:13
To: Alex Deucher <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Clements, John <[email protected]>; amd-gfx list <[email protected]>; Yuan, Xiaojie <[email protected]>
Subject: RE: [PATCH 1/2] drm/amdgpu: switch to macro for psp bootloader command

RE - Maybe this would be better in psp_gfx_if.h since it's sort of part of the firmware interface, but I guess it's not really part of the psp ring interface.

Yes, these cmds are not submitted to the psp ring and actually issued before the psp ring setup. They are not in the internal psp_gfx_if.h files, so I put them in general psp header.

Regards,
Hawking
-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: 2019年7月11日 1:25
To: Zhang, Hawking <[email protected]>
Cc: amd-gfx list <[email protected]>; Yuan, Xiaojie <[email protected]>; Clements, John <[email protected]>; Deucher, Alexander <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: switch to macro for psp bootloader command

Quoted 1 line · Hawking Zhang

Please add a patch description.

Quoted 15 lines
Change-Id Ief4c1e5ca01df0a028a784c0faf37544939733a3
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 9 +++++++++ 
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c  | 4 ++--
 drivers/gpu/drm/amd/amdgpu/psp_v3_1.c   | 4 ++--
 3 files changed, 13 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +0 -0
index e28cf5e..8ddcec1 100644
@@ -42,6 +42,15 @@ struct psp_context;  struct psp_xgmi_node_info; 
 struct psp_xgmi_topology_info;

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h struct psp_context; struct psp_xgmi_node_info; · line 52

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +9 -0
 
+enum psp_bootloader_cmd {
+       PSP_BL__LOAD_SYSDRV             = 0x10000,
+       PSP_BL__LOAD_SOSDRV             = 0x20000,
+       PSP_BL__NO_ECC                  = 0x40000,
+       PSP_BL__PARTIAL_ECC             = 0x50000,
+       PSP_BL__FULL_ECC                = 0x60000,
+       PSP_BL__LOAD_KEY_DATABASE       = 0x80000,
+};
+

Maybe this would be better in psp_gfx_if.h since it's sort of part of the firmware interface, but I guess it's not really part of the psp ring interface. Either way, with the patch description added, the series is:

Quoted 52 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +0 -0
 enum psp_ring_type
 {
        PSP_RING_TYPE__INVALID = 0,
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +2 -2
index 1b6c20c..e784091 100644
@@ -212,7 +212,7 @@ static int psp_v11_0_bootloader_load_sysdrv(struct psp_context *psp)
        /* Provide the sys driver to bootloader */
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
               (uint32_t)(psp->fw_pri_mc_addr >> 20));
-       psp_gfxdrv_command_reg = 1 << 16;
+       psp_gfxdrv_command_reg = PSP_BL__LOAD_SYSDRV;
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
               psp_gfxdrv_command_reg);
 
@@ -253,7 +253,7 @@ static int psp_v11_0_bootloader_load_sos(struct psp_context *psp)
        /* Provide the PSP secure OS to bootloader */
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
               (uint32_t)(psp->fw_pri_mc_addr >> 20));
-       psp_gfxdrv_command_reg = 2 << 16;
+       psp_gfxdrv_command_reg = PSP_BL__LOAD_SOSDRV;
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
               psp_gfxdrv_command_reg);
 
drivers/gpu/drm/amd/amdgpu/psp_v3_1.c +2 -3
index 3f58277..ec3a056 100644
@@ -153,7 +153,7 @@ static int psp_v3_1_bootloader_load_sysdrv(struct psp_context *psp)
        /* Provide the sys driver to bootloader */
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
               (uint32_t)(psp->fw_pri_mc_addr >> 20));
-       psp_gfxdrv_command_reg = 1 << 16;
+       psp_gfxdrv_command_reg = PSP_BL__LOAD_SYSDRV;
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
               psp_gfxdrv_command_reg);
 
@@ -216,7 +216,7 @@ static int psp_v3_1_bootloader_load_sos(struct psp_context *psp)
        /* Provide the PSP secure OS to bootloader */
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
               (uint32_t)(psp->fw_pri_mc_addr >> 20));
-       psp_gfxdrv_command_reg = 2 << 16;
+       psp_gfxdrv_command_reg = PSP_BL__LOAD_SOSDRV;
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
               psp_gfxdrv_command_reg);
 
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by Xiaojie Yuan
#10 lore raw
In reply to a message not in the archive

BR,
Xiaojie

________________________________________
From: amd-gfx <[email protected]> on behalf of Hawking Zhang <[email protected]>
Sent: Wednesday, July 10, 2019 11:58 PM
To: [email protected]; Yuan, Xiaojie; Clements, John; Deucher, Alexander
Cc: Zhang, Hawking
Subject: [PATCH 1/2] drm/amdgpu: switch to macro for psp bootloader command

Change-Id Ief4c1e5ca01df0a028a784c0faf37544939733a3
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 9 +++++++++
 drivers/gpu/drm/amd/amdgpu/psp_v11_0.c  | 4 ++--
 drivers/gpu/drm/amd/amdgpu/psp_v3_1.c   | 4 ++--
 3 files changed, 13 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +9 -0
index e28cf5e..8ddcec1 100644
@@ -42,6 +42,15 @@ struct psp_context;
 struct psp_xgmi_node_info;
 struct psp_xgmi_topology_info;
 
+enum psp_bootloader_cmd {
+       PSP_BL__LOAD_SYSDRV             = 0x10000,
+       PSP_BL__LOAD_SOSDRV             = 0x20000,
+       PSP_BL__NO_ECC                  = 0x40000,
+       PSP_BL__PARTIAL_ECC             = 0x50000,
+       PSP_BL__FULL_ECC                = 0x60000,
+       PSP_BL__LOAD_KEY_DATABASE       = 0x80000,
+};
+
 enum psp_ring_type
 {
        PSP_RING_TYPE__INVALID = 0,
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +2 -2
index 1b6c20c..e784091 100644
@@ -212,7 +212,7 @@ static int psp_v11_0_bootloader_load_sysdrv(struct psp_context *psp)
        /* Provide the sys driver to bootloader */
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
               (uint32_t)(psp->fw_pri_mc_addr >> 20));
-       psp_gfxdrv_command_reg = 1 << 16;
+       psp_gfxdrv_command_reg = PSP_BL__LOAD_SYSDRV;
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
               psp_gfxdrv_command_reg);
 
@@ -253,7 +253,7 @@ static int psp_v11_0_bootloader_load_sos(struct psp_context *psp)
        /* Provide the PSP secure OS to bootloader */
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
               (uint32_t)(psp->fw_pri_mc_addr >> 20));
-       psp_gfxdrv_command_reg = 2 << 16;
+       psp_gfxdrv_command_reg = PSP_BL__LOAD_SOSDRV;
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
               psp_gfxdrv_command_reg);
 
drivers/gpu/drm/amd/amdgpu/psp_v3_1.c +2 -2
index 3f58277..ec3a056 100644
@@ -153,7 +153,7 @@ static int psp_v3_1_bootloader_load_sysdrv(struct psp_context *psp)
        /* Provide the sys driver to bootloader */
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
               (uint32_t)(psp->fw_pri_mc_addr >> 20));
-       psp_gfxdrv_command_reg = 1 << 16;
+       psp_gfxdrv_command_reg = PSP_BL__LOAD_SYSDRV;
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
               psp_gfxdrv_command_reg);
 
@@ -216,7 +216,7 @@ static int psp_v3_1_bootloader_load_sos(struct psp_context *psp)
        /* Provide the PSP secure OS to bootloader */
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
               (uint32_t)(psp->fw_pri_mc_addr >> 20));
-       psp_gfxdrv_command_reg = 2 << 16;
+       psp_gfxdrv_command_reg = PSP_BL__LOAD_SOSDRV;
        WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
               psp_gfxdrv_command_reg);
 

--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx