Lines Matching refs:psp
77 static int psp_v13_0_init_microcode(struct psp_context *psp) in psp_v13_0_init_microcode() argument
79 struct amdgpu_device *adev = psp->adev; in psp_v13_0_init_microcode()
87 err = psp_init_sos_microcode(psp, ucode_prefix); in psp_v13_0_init_microcode()
92 err = psp_init_ta_microcode(psp, ucode_prefix); in psp_v13_0_init_microcode()
103 err = psp_init_toc_microcode(psp, ucode_prefix); in psp_v13_0_init_microcode()
106 err = psp_init_ta_microcode(psp, ucode_prefix); in psp_v13_0_init_microcode()
114 err = psp_init_sos_microcode(psp, ucode_prefix); in psp_v13_0_init_microcode()
118 err = psp_init_ta_microcode(psp, ucode_prefix); in psp_v13_0_init_microcode()
129 static bool psp_v13_0_is_sos_alive(struct psp_context *psp) in psp_v13_0_is_sos_alive() argument
131 struct amdgpu_device *adev = psp->adev; in psp_v13_0_is_sos_alive()
139 static int psp_v13_0_wait_for_vmbx_ready(struct psp_context *psp) in psp_v13_0_wait_for_vmbx_ready() argument
141 struct amdgpu_device *adev = psp->adev; in psp_v13_0_wait_for_vmbx_ready()
148 psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_33), in psp_v13_0_wait_for_vmbx_ready()
161 static int psp_v13_0_wait_for_bootloader(struct psp_context *psp) in psp_v13_0_wait_for_bootloader() argument
163 struct amdgpu_device *adev = psp->adev; in psp_v13_0_wait_for_bootloader()
177 psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_35), in psp_v13_0_wait_for_bootloader()
187 static int psp_v13_0_wait_for_bootloader_steady_state(struct psp_context *psp) in psp_v13_0_wait_for_bootloader_steady_state() argument
189 struct amdgpu_device *adev = psp->adev; in psp_v13_0_wait_for_bootloader_steady_state()
192 psp_v13_0_wait_for_vmbx_ready(psp); in psp_v13_0_wait_for_bootloader_steady_state()
194 return psp_v13_0_wait_for_bootloader(psp); in psp_v13_0_wait_for_bootloader_steady_state()
200 static int psp_v13_0_bootloader_load_component(struct psp_context *psp, in psp_v13_0_bootloader_load_component() argument
206 struct amdgpu_device *adev = psp->adev; in psp_v13_0_bootloader_load_component()
211 if (psp_v13_0_is_sos_alive(psp)) in psp_v13_0_bootloader_load_component()
214 ret = psp_v13_0_wait_for_bootloader(psp); in psp_v13_0_bootloader_load_component()
218 memset(psp->fw_pri_buf, 0, PSP_1_MEG); in psp_v13_0_bootloader_load_component()
221 memcpy(psp->fw_pri_buf, bin_desc->start_addr, bin_desc->size_bytes); in psp_v13_0_bootloader_load_component()
225 (uint32_t)(psp->fw_pri_mc_addr >> 20)); in psp_v13_0_bootloader_load_component()
230 ret = psp_v13_0_wait_for_bootloader(psp); in psp_v13_0_bootloader_load_component()
235 static int psp_v13_0_bootloader_load_kdb(struct psp_context *psp) in psp_v13_0_bootloader_load_kdb() argument
237 return psp_v13_0_bootloader_load_component(psp, &psp->kdb, PSP_BL__LOAD_KEY_DATABASE); in psp_v13_0_bootloader_load_kdb()
240 static int psp_v13_0_bootloader_load_spl(struct psp_context *psp) in psp_v13_0_bootloader_load_spl() argument
242 return psp_v13_0_bootloader_load_component(psp, &psp->kdb, PSP_BL__LOAD_TOS_SPL_TABLE); in psp_v13_0_bootloader_load_spl()
245 static int psp_v13_0_bootloader_load_sysdrv(struct psp_context *psp) in psp_v13_0_bootloader_load_sysdrv() argument
247 return psp_v13_0_bootloader_load_component(psp, &psp->sys, PSP_BL__LOAD_SYSDRV); in psp_v13_0_bootloader_load_sysdrv()
250 static int psp_v13_0_bootloader_load_soc_drv(struct psp_context *psp) in psp_v13_0_bootloader_load_soc_drv() argument
252 return psp_v13_0_bootloader_load_component(psp, &psp->soc_drv, PSP_BL__LOAD_SOCDRV); in psp_v13_0_bootloader_load_soc_drv()
255 static int psp_v13_0_bootloader_load_intf_drv(struct psp_context *psp) in psp_v13_0_bootloader_load_intf_drv() argument
257 return psp_v13_0_bootloader_load_component(psp, &psp->intf_drv, PSP_BL__LOAD_INTFDRV); in psp_v13_0_bootloader_load_intf_drv()
260 static int psp_v13_0_bootloader_load_dbg_drv(struct psp_context *psp) in psp_v13_0_bootloader_load_dbg_drv() argument
262 return psp_v13_0_bootloader_load_component(psp, &psp->dbg_drv, PSP_BL__LOAD_DBGDRV); in psp_v13_0_bootloader_load_dbg_drv()
265 static int psp_v13_0_bootloader_load_ras_drv(struct psp_context *psp) in psp_v13_0_bootloader_load_ras_drv() argument
267 return psp_v13_0_bootloader_load_component(psp, &psp->ras_drv, PSP_BL__LOAD_RASDRV); in psp_v13_0_bootloader_load_ras_drv()
271 static int psp_v13_0_bootloader_load_sos(struct psp_context *psp) in psp_v13_0_bootloader_load_sos() argument
275 struct amdgpu_device *adev = psp->adev; in psp_v13_0_bootloader_load_sos()
280 if (psp_v13_0_is_sos_alive(psp)) in psp_v13_0_bootloader_load_sos()
283 ret = psp_v13_0_wait_for_bootloader(psp); in psp_v13_0_bootloader_load_sos()
287 memset(psp->fw_pri_buf, 0, PSP_1_MEG); in psp_v13_0_bootloader_load_sos()
290 memcpy(psp->fw_pri_buf, psp->sos.start_addr, psp->sos.size_bytes); in psp_v13_0_bootloader_load_sos()
294 (uint32_t)(psp->fw_pri_mc_addr >> 20)); in psp_v13_0_bootloader_load_sos()
301 ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_81), in psp_v13_0_bootloader_load_sos()
308 static int psp_v13_0_ring_stop(struct psp_context *psp, in psp_v13_0_ring_stop() argument
312 struct amdgpu_device *adev = psp->adev; in psp_v13_0_ring_stop()
321 ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_101), in psp_v13_0_ring_stop()
330 ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_64), in psp_v13_0_ring_stop()
337 static int psp_v13_0_ring_create(struct psp_context *psp, in psp_v13_0_ring_create() argument
342 struct psp_ring *ring = &psp->km_ring; in psp_v13_0_ring_create()
343 struct amdgpu_device *adev = psp->adev; in psp_v13_0_ring_create()
346 ret = psp_v13_0_ring_stop(psp, ring_type); in psp_v13_0_ring_create()
367 ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_101), in psp_v13_0_ring_create()
372 ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_64), in psp_v13_0_ring_create()
397 ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_64), in psp_v13_0_ring_create()
404 static int psp_v13_0_ring_destroy(struct psp_context *psp, in psp_v13_0_ring_destroy() argument
408 struct psp_ring *ring = &psp->km_ring; in psp_v13_0_ring_destroy()
409 struct amdgpu_device *adev = psp->adev; in psp_v13_0_ring_destroy()
411 ret = psp_v13_0_ring_stop(psp, ring_type); in psp_v13_0_ring_destroy()
422 static uint32_t psp_v13_0_ring_get_wptr(struct psp_context *psp) in psp_v13_0_ring_get_wptr() argument
425 struct amdgpu_device *adev = psp->adev; in psp_v13_0_ring_get_wptr()
435 static void psp_v13_0_ring_set_wptr(struct psp_context *psp, uint32_t value) in psp_v13_0_ring_set_wptr() argument
437 struct amdgpu_device *adev = psp->adev; in psp_v13_0_ring_set_wptr()
447 static int psp_v13_0_memory_training_send_msg(struct psp_context *psp, int msg) in psp_v13_0_memory_training_send_msg() argument
453 struct amdgpu_device *adev = psp->adev; in psp_v13_0_memory_training_send_msg()
455 data_32 = (psp->mem_train_ctx.c2p_train_data_offset >> 20); in psp_v13_0_memory_training_send_msg()
461 ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_35), in psp_v13_0_memory_training_send_msg()
479 static int psp_v13_0_memory_training(struct psp_context *psp, uint32_t ops) in psp_v13_0_memory_training() argument
481 struct psp_memory_training_context *ctx = &psp->mem_train_ctx; in psp_v13_0_memory_training()
483 struct amdgpu_device *adev = psp->adev; in psp_v13_0_memory_training()
497 if (psp_v13_0_is_sos_alive(psp)) { in psp_v13_0_memory_training()
562 ret = psp_v13_0_memory_training_send_msg(psp, PSP_BL__DRAM_LONG_TRAIN); in psp_v13_0_memory_training()
581 …amdgpu_device_vram_access(psp->adev, ctx->p2c_train_data_offset, ctx->sys_cache, ctx->train_data_s… in psp_v13_0_memory_training()
585 …amdgpu_device_vram_access(psp->adev, ctx->c2p_train_data_offset, ctx->sys_cache, ctx->train_data_s… in psp_v13_0_memory_training()
589 ret = psp_v13_0_memory_training_send_msg(psp, (amdgpu_force_long_training > 0) ? in psp_v13_0_memory_training()
600 static int psp_v13_0_load_usbc_pd_fw(struct psp_context *psp, uint64_t fw_pri_mc_addr) in psp_v13_0_load_usbc_pd_fw() argument
602 struct amdgpu_device *adev = psp->adev; in psp_v13_0_load_usbc_pd_fw()
613 ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_35), in psp_v13_0_load_usbc_pd_fw()
643 static int psp_v13_0_read_usbc_pd_fw(struct psp_context *psp, uint32_t *fw_ver) in psp_v13_0_read_usbc_pd_fw() argument
645 struct amdgpu_device *adev = psp->adev; in psp_v13_0_read_usbc_pd_fw()
650 ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_35), in psp_v13_0_read_usbc_pd_fw()
658 static int psp_v13_0_exec_spi_cmd(struct psp_context *psp, int cmd) in psp_v13_0_exec_spi_cmd() argument
661 struct amdgpu_device *adev = psp->adev; in psp_v13_0_exec_spi_cmd()
672 ret = psp_wait_for_spirom_update(psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_115), in psp_v13_0_exec_spi_cmd()
675 ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_115), in psp_v13_0_exec_spi_cmd()
692 static int psp_v13_0_update_spirom(struct psp_context *psp, in psp_v13_0_update_spirom() argument
695 struct amdgpu_device *adev = psp->adev; in psp_v13_0_update_spirom()
699 ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_115), in psp_v13_0_update_spirom()
708 ret = psp_v13_0_exec_spi_cmd(psp, C2PMSG_CMD_SPI_UPDATE_ROM_IMAGE_ADDR_LO); in psp_v13_0_update_spirom()
714 ret = psp_v13_0_exec_spi_cmd(psp, C2PMSG_CMD_SPI_UPDATE_ROM_IMAGE_ADDR_HI); in psp_v13_0_update_spirom()
718 psp->vbflash_done = true; in psp_v13_0_update_spirom()
720 ret = psp_v13_0_exec_spi_cmd(psp, C2PMSG_CMD_SPI_UPDATE_FLASH_IMAGE); in psp_v13_0_update_spirom()
727 static int psp_v13_0_vbflash_status(struct psp_context *psp) in psp_v13_0_vbflash_status() argument
729 struct amdgpu_device *adev = psp->adev; in psp_v13_0_vbflash_status()
734 static int psp_v13_0_fatal_error_recovery_quirk(struct psp_context *psp) in psp_v13_0_fatal_error_recovery_quirk() argument
736 struct amdgpu_device *adev = psp->adev; in psp_v13_0_fatal_error_recovery_quirk()
779 void psp_v13_0_set_psp_funcs(struct psp_context *psp) in psp_v13_0_set_psp_funcs() argument
781 psp->funcs = &psp_v13_0_funcs; in psp_v13_0_set_psp_funcs()