Skip to content

Commit 3e5c968

Browse files
committed
gpu: nova-core: firmware: process Booter and patch its signature
The Booter signed firmware is an essential part of bringing up the GSP on Turing and Ampere. It is loaded on the sec2 falcon core and is responsible for loading and running the RISC-V GSP bootloader into the GSP core. Add support for parsing the Booter firmware loaded from userspace, patch its signatures, and store it into a form that is ready to be loaded and executed on the sec2 falcon. Then, move the Booter instance from the `Firmware` struct to the `start_gsp` method since it doesn't need to be kept after the GSP is booted. We do not run Booter yet, as its own payload (the GSP bootloader and firmware image) still need to be prepared. Acked-by: Danilo Krummrich <dakr@kernel.org> Link: https://lore.kernel.org/r/20250913-nova_firmware-v6-6-9007079548b0@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
1 parent d6cb731 commit 3e5c968

4 files changed

Lines changed: 393 additions & 9 deletions

File tree

drivers/gpu/nova-core/falcon.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ pub(crate) trait FalconEngine:
293293
}
294294

295295
/// Represents a portion of the firmware to be loaded into a particular memory (e.g. IMEM or DMEM).
296-
#[derive(Debug)]
296+
#[derive(Debug, Clone)]
297297
pub(crate) struct FalconLoadTarget {
298298
/// Offset from the start of the source object to copy from.
299299
pub(crate) src_start: u32,
@@ -304,7 +304,7 @@ pub(crate) struct FalconLoadTarget {
304304
}
305305

306306
/// Parameters for the falcon boot ROM.
307-
#[derive(Debug)]
307+
#[derive(Debug, Clone)]
308308
pub(crate) struct FalconBromParams {
309309
/// Offset in `DMEM`` of the firmware's signature.
310310
pub(crate) pkc_data_offset: u32,

drivers/gpu/nova-core/firmware.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use crate::falcon::FalconFirmware;
1717
use crate::gpu;
1818
use crate::gpu::Chipset;
1919

20+
pub(crate) mod booter;
2021
pub(crate) mod fwsec;
2122

2223
pub(crate) const FIRMWARE_VERSION: &str = "535.113.01";
@@ -37,8 +38,6 @@ fn request_firmware(
3738
/// Structure encapsulating the firmware blobs required for the GPU to operate.
3839
#[expect(dead_code)]
3940
pub(crate) struct Firmware {
40-
booter_load: firmware::Firmware,
41-
booter_unload: firmware::Firmware,
4241
bootloader: firmware::Firmware,
4342
gsp: firmware::Firmware,
4443
}
@@ -48,8 +47,6 @@ impl Firmware {
4847
let request = |name| request_firmware(dev, chipset, name, ver);
4948

5049
Ok(Firmware {
51-
booter_load: request("booter_load")?,
52-
booter_unload: request("booter_unload")?,
5350
bootloader: request("bootloader")?,
5451
gsp: request("gsp")?,
5552
})
@@ -185,7 +182,6 @@ struct BinFirmware<'a> {
185182
fw: &'a [u8],
186183
}
187184

188-
#[expect(dead_code)]
189185
impl<'a> BinFirmware<'a> {
190186
/// Interpret `fw` as a firmware image starting with a [`BinHdr`], and returns the
191187
/// corresponding [`BinFirmware`] that can be used to extract its payload.

0 commit comments

Comments
 (0)