[PATCH 3/9] gpu: nova-core: falcon: factor out the BROM and BOOTVEC programming

From: John Hubbard

Date: Thu Nov 19 2026 - 23:47:52 EST


The r000 boot protocol requires the driver to program the BROM registers
and the BOOTVEC register of the GSP falcon for a binary that GSP-RM has
placed in the framebuffer, as the PIO and DMA load paths already do for
a firmware image.

In order to make the programming available to a caller that has no
firmware image, factor it out of the two load paths, into a falcon
method that receives the BROM parameters and the boot address.

No functional changes.

Signed-off-by: John Hubbard <jhubbard@xxxxxxxxxx>
---
drivers/gpu/nova-core/falcon.rs | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/nova-core/falcon.rs b/drivers/gpu/nova-core/falcon.rs
index fb4f1cad867e..28c37c82b8a2 100644
--- a/drivers/gpu/nova-core/falcon.rs
+++ b/drivers/gpu/nova-core/falcon.rs
@@ -515,10 +515,7 @@ pub(crate) fn pio_load<F: FalconFirmware<Target = E> + FalconPioLoadable>(
}
self.pio_wr_dmem_slice(fw.dmem_load_params())?;

- self.hal.program_brom(self, &fw.brom_params());
-
- self.pfalcon
- .write_reg(regs::NV_PFALCON_FALCON_BOOTVEC::zeroed().with_value(fw.boot_addr()));
+ self.program_brom_and_bootvec(&fw.brom_params(), fw.boot_addr());

Ok(())
}
@@ -676,15 +673,19 @@ fn dma_load<F: FalconFirmware<Target = E> + FalconDmaLoadable>(&self, fw: &F) ->
fw.dmem_load_params(),
)?;

- self.hal.program_brom(self, &fw.brom_params());
-
- // Set `BootVec` to start of non-secure code.
- self.pfalcon
- .write_reg(regs::NV_PFALCON_FALCON_BOOTVEC::zeroed().with_value(fw.boot_addr()));
+ self.program_brom_and_bootvec(&fw.brom_params(), fw.boot_addr());

Ok(())
}

+ /// Programs the BROM registers with `brom_params` and the `BOOTVEC` register with `boot_addr`.
+ fn program_brom_and_bootvec(&self, brom_params: &FalconBromParams, boot_addr: u32) {
+ self.hal.program_brom(self, brom_params);
+
+ self.pfalcon
+ .write_reg(regs::NV_PFALCON_FALCON_BOOTVEC::zeroed().with_value(boot_addr));
+ }
+
/// Wait until the falcon CPU is halted.
pub(crate) fn wait_till_halted(&self) -> Result<()> {
// TIMEOUT: arbitrarily large value, firmwares should complete in less than 2 seconds.
--
2.56.1