[PATCH v3 25/33] gpu: nova-core: gsp: let the GSP HAL load the generic bootloader
From: John Hubbard
Date: Thu Sep 17 2026 - 21:24:38 EST
Turing and GA100 boot the GSP through the generic falcon bootloader. On
those chipsets the r000 GSP-RM raises a load-and-execute event that
requests a bootloader run, and the handler for that event runs the
bootloader that the boot sequence supplies. Whether a chipset boots
through the bootloader is a property of the TU102 HAL: a field of its
two instances, set for Turing and GA100 and clear for the other Ampere
chipsets and for Ada.
Only the TU102 HAL tested that field, to choose how to load FWSEC. The
boot sequence had no way to obtain the bootloader for the handler
without a second list of the chipsets.
Add a HAL method that loads the generic bootloader. The TU102 HAL loads
it when its field is set, and every other HAL returns no bootloader. The
method has no caller until the switch to r000.
Assisted-by: LLM
Signed-off-by: John Hubbard <jhubbard@xxxxxxxxxx>
---
drivers/gpu/nova-core/gsp/hal.rs | 28 ++++++++++++++++++++++++--
drivers/gpu/nova-core/gsp/hal/tu102.rs | 14 +++++++++++++
2 files changed, 40 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/nova-core/gsp/hal.rs b/drivers/gpu/nova-core/gsp/hal.rs
index d8329f6fcc65..8c2a8abcb187 100644
--- a/drivers/gpu/nova-core/gsp/hal.rs
+++ b/drivers/gpu/nova-core/gsp/hal.rs
@@ -5,10 +5,16 @@
mod gh100;
mod tu102;
-use kernel::prelude::*;
+use kernel::{
+ device,
+ prelude::*, //
+};
use crate::{
- firmware::gsp::GspFirmware,
+ firmware::{
+ gen_bootloader::GenericBootloader,
+ gsp::GspFirmware, //
+ },
gpu::{
Architecture,
Chipset, //
@@ -42,6 +48,24 @@ fn boot<'gpu>(
gsp_fw: &GspFirmware<'gpu>,
) -> Result<Option<super::UnloadBundle<'gpu>>>;
+ /// Loads the generic falcon bootloader for the chipsets whose GSP boots through it.
+ ///
+ /// The bootloader runs from the last blocks of an IMEM of `imem_size` bytes. On every other
+ /// chipset this returns `None`.
+ ///
+ /// # Errors
+ ///
+ /// Errors from loading the bootloader image are propagated as-is.
+ #[expect(dead_code)]
+ fn generic_bootloader(
+ &self,
+ _dev: &device::Device<device::Bound>,
+ _chipset: Chipset,
+ _imem_size: usize,
+ ) -> Result<Option<GenericBootloader>> {
+ Ok(None)
+ }
+
/// Performs HAL-specific post-GSP boot tasks.
///
/// This method is called by the GSP boot code after the GSP is confirmed to be running, and
diff --git a/drivers/gpu/nova-core/gsp/hal/tu102.rs b/drivers/gpu/nova-core/gsp/hal/tu102.rs
index 1b17ece53bd6..32931fd0b7cf 100644
--- a/drivers/gpu/nova-core/gsp/hal/tu102.rs
+++ b/drivers/gpu/nova-core/gsp/hal/tu102.rs
@@ -31,6 +31,7 @@
FwsecCommand,
FwsecFirmware, //
},
+ gen_bootloader::GenericBootloader,
gsp::GspFirmware, //
},
gpu::Chipset,
@@ -316,6 +317,19 @@ fn boot<'gpu>(
Ok(unload_guard.dismiss())
}
+ fn generic_bootloader(
+ &self,
+ dev: &device::Device<device::Bound>,
+ chipset: Chipset,
+ imem_size: usize,
+ ) -> Result<Option<GenericBootloader>> {
+ if !self.needs_fwsec_bootloader {
+ return Ok(None);
+ }
+
+ GenericBootloader::new(dev, chipset, imem_size).map(Some)
+ }
+
fn post_boot(
&self,
gsp: &Gsp<'_>,
--
2.55.0