Re: [PATCH v4 28/33] gpu: nova-core: refactor SEC2 booter loading into run_booter() helper

Danilo Krummrich
2026-02-17T20:12:24Z

On Tue Feb 10, 2026 at 3:45 AM CET, John Hubbard wrote:
> diff --git a/drivers/gpu/nova-core/gsp/boot.rs b/drivers/gpu/nova-core/gsp/boot.rs
> index 465c18e4c888..6191986fc6b5 100644
> --- a/drivers/gpu/nova-core/gsp/boot.rs
> +++ b/drivers/gpu/nova-core/gsp/boot.rs
> @@ -120,6 +120,40 @@ fn run_fwsec_frts(
> }
> }
>
> + fn run_booter(
> + dev: &device::Device<device::Bound>,
> + bar: &Bar0,
> + chipset: Chipset,
> + sec2_falcon: &Falcon<Sec2>,
> + wpr_meta: &CoherentAllocation<GspFwWprMeta>,
> + ) -> Result {
> + let booter_loader = BooterFirmware::new(
> + dev,
> + BooterKind::Loader,
> + chipset,
> + FIRMWARE_VERSION,
> + sec2_falcon,
> + bar,
> + )?;

Maybe we should just make the part below a method of BooterFirmware, i.e.
BooterFirmware::run()?

> + sec2_falcon.reset(bar)?;
> + sec2_falcon.load(bar, &booter_loader)?;
> + let wpr_handle = wpr_meta.dma_handle();
> + let (mbox0, mbox1) = sec2_falcon.boot(
> + bar,
> + Some(wpr_handle as u32),
> + Some((wpr_handle >> 32) as u32),
> + )?;
> + dev_dbg!(dev, "SEC2 MBOX0: {:#x}, MBOX1: {:#x}\n", mbox0, mbox1);
> +
> + if mbox0 != 0 {
> + dev_err!(dev, "Booter-load failed with error {:#x}\n", mbox0);
> + return Err(ENODEV);
> + }
> +
> + Ok(())
> + }