Re: [PATCH v11 18/22] gpu: nova-core: Hopper/Blackwell: add FspCotVersion type

From: Alexandre Courbot

Date: Mon Jun 01 2026 - 10:19:50 EST


On Sat May 30, 2026 at 12:09 PM JST, John Hubbard wrote:
> The FSP Chain of Trust handshake is versioned, and the version the
> driver must advertise depends on the GPU: Hopper speaks version 1 and
> Blackwell speaks version 2. Represent that version explicitly and select
> it per architecture so the boot message carries the value FSP expects.
>
> Signed-off-by: John Hubbard <jhubbard@xxxxxxxxxx>
> ---
> drivers/gpu/nova-core/fsp.rs | 19 +++++++++++++++++++
> drivers/gpu/nova-core/gpu.rs | 16 ++++++++++++++++
> 2 files changed, 35 insertions(+)
>
> diff --git a/drivers/gpu/nova-core/fsp.rs b/drivers/gpu/nova-core/fsp.rs
> index cc2ebc3f6e78..5aae8282f2f0 100644
> --- a/drivers/gpu/nova-core/fsp.rs
> +++ b/drivers/gpu/nova-core/fsp.rs
> @@ -36,6 +36,25 @@
>
> mod hal;
>
> +/// FSP Chain of Trust protocol version.
> +///
> +/// Hopper (GH100) uses version 1, Blackwell uses version 2.
> +#[derive(Debug, Clone, Copy)]
> +pub(crate) struct FspCotVersion(u16);
> +
> +impl FspCotVersion {
> + /// Creates a new FSP CoT version.
> + pub(crate) const fn new(version: u16) -> Self {
> + Self(version)
> + }
> +
> + /// Returns the raw protocol version number for the wire format.
> + #[expect(dead_code)]
> + pub(crate) const fn raw(self) -> u16 {
> + self.0
> + }
> +}

This type seems to just wrap a `u16`, and return its raw value without
any limitation for its range, or other functionality. It is just created
in `Chipset::fsp_cot_version`, to be immediately unpacked by
`Fsp::boot_fmc`. Why not just use a `u16` directly?

> +
> /// FSP message timeout in milliseconds.
> const FSP_MSG_TIMEOUT_MS: i64 = 2000;
>
> diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs
> index 7dd736e5b190..6cdface3c618 100644
> --- a/drivers/gpu/nova-core/gpu.rs
> +++ b/drivers/gpu/nova-core/gpu.rs
> @@ -21,6 +21,7 @@
> Falcon, //
> },
> fb::SysmemFlush,
> + fsp::FspCotVersion,
> gsp::{
> self,
> Gsp, //
> @@ -141,6 +142,21 @@ pub(crate) const fn needs_fwsec_bootloader(self) -> bool {
> pub(crate) fn pci_config_mirror_range(self) -> Range<u32> {
> hal::gpu_hal(self).pci_config_mirror_range()
> }
> +
> + /// Returns the FSP Chain of Trust (CoT) protocol version for this chipset.
> + ///
> + /// Hopper (GH100) uses version 1, Blackwell uses version 2.
> + /// Returns `None` for architectures that do not use FSP.
> + #[expect(dead_code)]
> + pub(crate) const fn fsp_cot_version(self) -> Option<FspCotVersion> {
> + match self.arch() {
> + Architecture::Hopper => Some(FspCotVersion::new(1)),
> + Architecture::BlackwellGB10x | Architecture::BlackwellGB20x => {
> + Some(FspCotVersion::new(2))
> + }
> + _ => None,
> + }
> + }

This is only used in the `fsp` module - can we turn this into a FSP HAL
method? That way it also won't need to return an `Option` since
`fsp_hal` will already have filtered architectures that don't support
FSP.