Skip to content

Commit 7c2949c

Browse files
Lijo Lazaralexdeucher
authored andcommitted
drm/amdgpu: Add bootloader wait for PSP v13
Implement the wait for bootloader call back for PSP v13.0 ASICs. Only for ASICs with PSP v13.0.6, it needs an additional check for VBIOS mailbox status. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Reviewed-by: Asad Kamal <[email protected]> Tested-by: Asad Kamal <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 0a61156 commit 7c2949c

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

drivers/gpu/drm/amd/amdgpu/psp_v13_0.c

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,35 @@ static bool psp_v13_0_is_sos_alive(struct psp_context *psp)
133133
return sol_reg != 0x0;
134134
}
135135

136+
static int psp_v13_0_wait_for_vmbx_ready(struct psp_context *psp)
137+
{
138+
struct amdgpu_device *adev = psp->adev;
139+
int retry_loop, ret;
140+
141+
for (retry_loop = 0; retry_loop < 70; retry_loop++) {
142+
/* Wait for bootloader to signify that is
143+
ready having bit 31 of C2PMSG_33 set to 1 */
144+
ret = psp_wait_for(
145+
psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_33),
146+
0x80000000, 0xffffffff, false);
147+
148+
if (ret == 0)
149+
break;
150+
}
151+
152+
if (ret)
153+
dev_warn(adev->dev, "Bootloader wait timed out");
154+
155+
return ret;
156+
}
157+
136158
static int psp_v13_0_wait_for_bootloader(struct psp_context *psp)
137159
{
138160
struct amdgpu_device *adev = psp->adev;
161+
int retry_loop, ret;
139162

140-
int ret;
141-
int retry_loop;
163+
if (adev->ip_versions[MP0_HWIP][0] == IP_VERSION(13, 0, 6))
164+
psp_v13_0_wait_for_vmbx_ready(psp);
142165

143166
/* Wait for bootloader to signify that it is ready having bit 31 of
144167
* C2PMSG_35 set to 1. All other bits are expected to be cleared.
@@ -714,6 +737,7 @@ static int psp_v13_0_fatal_error_recovery_quirk(struct psp_context *psp)
714737

715738
static const struct psp_funcs psp_v13_0_funcs = {
716739
.init_microcode = psp_v13_0_init_microcode,
740+
.wait_for_bootloader = psp_v13_0_wait_for_bootloader,
717741
.bootloader_load_kdb = psp_v13_0_bootloader_load_kdb,
718742
.bootloader_load_spl = psp_v13_0_bootloader_load_spl,
719743
.bootloader_load_sysdrv = psp_v13_0_bootloader_load_sysdrv,

0 commit comments

Comments
 (0)