Skip to content

Commit 0f2c8e2

Browse files
Joel FernandesGnurou
authored andcommitted
gpu: nova-core: falcon: Move dma_reset functionality into helper
Move dma_reset so we can use it for the upcoming sequencer functionality. Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Message-ID: <20251114195552.739371-5-joelagnelf@nvidia.com>
1 parent 4f7656f commit 0f2c8e2

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

drivers/gpu/nova-core/falcon.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,12 @@ impl<E: FalconEngine + 'static> Falcon<E> {
382382
})
383383
}
384384

385+
/// Resets DMA-related registers.
386+
pub(crate) fn dma_reset(&self, bar: &Bar0) {
387+
regs::NV_PFALCON_FBIF_CTL::update(bar, &E::ID, |v| v.set_allow_phys_no_ctx(true));
388+
regs::NV_PFALCON_FALCON_DMACTL::default().write(bar, &E::ID);
389+
}
390+
385391
/// Wait for memory scrubbing to complete.
386392
fn reset_wait_mem_scrubbing(&self, bar: &Bar0) -> Result {
387393
// TIMEOUT: memory scrubbing should complete in less than 20ms.
@@ -531,8 +537,7 @@ impl<E: FalconEngine + 'static> Falcon<E> {
531537

532538
/// Perform a DMA load into `IMEM` and `DMEM` of `fw`, and prepare the falcon to run it.
533539
pub(crate) fn dma_load<F: FalconFirmware<Target = E>>(&self, bar: &Bar0, fw: &F) -> Result {
534-
regs::NV_PFALCON_FBIF_CTL::update(bar, &E::ID, |v| v.set_allow_phys_no_ctx(true));
535-
regs::NV_PFALCON_FALCON_DMACTL::default().write(bar, &E::ID);
540+
self.dma_reset(bar);
536541
regs::NV_PFALCON_FBIF_TRANSCFG::update(bar, &E::ID, 0, |v| {
537542
v.set_target(FalconFbifTarget::CoherentSysmem)
538543
.set_mem_type(FalconFbifMemType::Physical)

0 commit comments

Comments
 (0)