Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joel Fernandes and committed by
Alexandre Courbot
c5c0cfa6 2d981773

+16 -10
+16 -10
drivers/gpu/nova-core/falcon.rs
··· 564 564 Ok(()) 565 565 } 566 566 567 - /// Runs the loaded firmware and waits for its completion. 567 + /// Start the falcon CPU. 568 + pub(crate) fn start(&self, bar: &Bar0) -> Result<()> { 569 + match regs::NV_PFALCON_FALCON_CPUCTL::read(bar, &E::ID).alias_en() { 570 + true => regs::NV_PFALCON_FALCON_CPUCTL_ALIAS::default() 571 + .set_startcpu(true) 572 + .write(bar, &E::ID), 573 + false => regs::NV_PFALCON_FALCON_CPUCTL::default() 574 + .set_startcpu(true) 575 + .write(bar, &E::ID), 576 + } 577 + 578 + Ok(()) 579 + } 580 + 581 + /// Start running the loaded firmware. 568 582 /// 569 583 /// `mbox0` and `mbox1` are optional parameters to write into the `MBOX0` and `MBOX1` registers 570 584 /// prior to running. ··· 603 589 .write(bar, &E::ID); 604 590 } 605 591 606 - match regs::NV_PFALCON_FALCON_CPUCTL::read(bar, &E::ID).alias_en() { 607 - true => regs::NV_PFALCON_FALCON_CPUCTL_ALIAS::default() 608 - .set_startcpu(true) 609 - .write(bar, &E::ID), 610 - false => regs::NV_PFALCON_FALCON_CPUCTL::default() 611 - .set_startcpu(true) 612 - .write(bar, &E::ID), 613 - } 614 - 592 + self.start(bar)?; 615 593 self.wait_till_halted(bar)?; 616 594 617 595 let (mbox0, mbox1) = (