summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fernandes <joelagnelf@nvidia.com>2025-11-14 14:55:41 -0500
committerAlexandre Courbot <acourbot@nvidia.com>2025-11-15 17:28:03 +0900
commitc5c0cfa67aa429b171676c6162f123adecb3a5ec (patch)
treee8cec648568fc4c2d6d847d6c2bde481c57aef27
parent2d981773e14c1d7fc8f8e19a19d306d8372db571 (diff)
gpu: nova-core: falcon: Move start functionality into separate helper
Move start functionality into a separate helper so we can use it from the sequencer. 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-3-joelagnelf@nvidia.com>
-rw-r--r--drivers/gpu/nova-core/falcon.rs26
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/gpu/nova-core/falcon.rs b/drivers/gpu/nova-core/falcon.rs
index 1e51b94d9585..30af7fc2814d 100644
--- a/drivers/gpu/nova-core/falcon.rs
+++ b/drivers/gpu/nova-core/falcon.rs
@@ -564,7 +564,21 @@ impl<E: FalconEngine + 'static> Falcon<E> {
Ok(())
}
- /// Runs the loaded firmware and waits for its completion.
+ /// Start the falcon CPU.
+ pub(crate) fn start(&self, bar: &Bar0) -> Result<()> {
+ match regs::NV_PFALCON_FALCON_CPUCTL::read(bar, &E::ID).alias_en() {
+ true => regs::NV_PFALCON_FALCON_CPUCTL_ALIAS::default()
+ .set_startcpu(true)
+ .write(bar, &E::ID),
+ false => regs::NV_PFALCON_FALCON_CPUCTL::default()
+ .set_startcpu(true)
+ .write(bar, &E::ID),
+ }
+
+ Ok(())
+ }
+
+ /// Start running the loaded firmware.
///
/// `mbox0` and `mbox1` are optional parameters to write into the `MBOX0` and `MBOX1` registers
/// prior to running.
@@ -589,15 +603,7 @@ impl<E: FalconEngine + 'static> Falcon<E> {
.write(bar, &E::ID);
}
- match regs::NV_PFALCON_FALCON_CPUCTL::read(bar, &E::ID).alias_en() {
- true => regs::NV_PFALCON_FALCON_CPUCTL_ALIAS::default()
- .set_startcpu(true)
- .write(bar, &E::ID),
- false => regs::NV_PFALCON_FALCON_CPUCTL::default()
- .set_startcpu(true)
- .write(bar, &E::ID),
- }
-
+ self.start(bar)?;
self.wait_till_halted(bar)?;
let (mbox0, mbox1) = (