Commit edcb1342 authored by Alistair Popple's avatar Alistair Popple Committed by Alexandre Courbot
Browse files

gpu: nova-core: gsp: Add SetSystemInfo command



Add support for sending the SetSystemInfo command, which provides
required hardware information to the GSP and is critical to its
initialization.

Signed-off-by: default avatarAlistair Popple <apopple@nvidia.com>
Signed-off-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Message-ID: <20251110-gsp_boot-v9-11-8ae4058e3c0e@nvidia.com>
parent 4fd4acd9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
};

pub(crate) mod cmdq;
pub(crate) mod commands;
mod fw;

pub(crate) use fw::{
+8 −2
Original line number Diff line number Diff line
@@ -29,7 +29,10 @@
        FIRMWARE_VERSION, //
    },
    gpu::Chipset,
    gsp::GspFwWprMeta,
    gsp::{
        commands,
        GspFwWprMeta, //
    },
    regs,
    vbios::Vbios,
};
@@ -119,7 +122,7 @@ fn run_fwsec_frts(
    ///
    /// Upon return, the GSP is up and running, and its runtime object given as return value.
    pub(crate) fn boot(
        self: Pin<&mut Self>,
        mut self: Pin<&mut Self>,
        pdev: &pci::Device<device::Bound>,
        bar: &Bar0,
        chipset: Chipset,
@@ -153,6 +156,9 @@ pub(crate) fn boot(
            CoherentAllocation::<GspFwWprMeta>::alloc_coherent(dev, 1, GFP_KERNEL | __GFP_ZERO)?;
        dma_write!(wpr_meta[0] = GspFwWprMeta::new(&gsp_fw, &fb_layout))?;

        self.cmdq
            .send_command(bar, commands::SetSystemInfo::new(pdev))?;

        Ok(())
    }
}
+0 −1
Original line number Diff line number Diff line
@@ -489,7 +489,6 @@ fn notify_gsp(bar: &Bar0) {
    ///   written to by its [`CommandToGsp::init_variable_payload`] method.
    ///
    /// Error codes returned by the command initializers are propagated as-is.
    #[expect(unused)]
    pub(crate) fn send_command<M>(&mut self, bar: &Bar0, command: M) -> Result
    where
        M: CommandToGsp,
+37 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0

use kernel::{
    device,
    pci,
    prelude::*, //
};

use crate::gsp::{
    cmdq::CommandToGsp,
    fw::{
        commands::GspSetSystemInfo,
        MsgFunction, //
    },
};

/// The `GspSetSystemInfo` command.
pub(crate) struct SetSystemInfo<'a> {
    pdev: &'a pci::Device<device::Bound>,
}

impl<'a> SetSystemInfo<'a> {
    /// Creates a new `GspSetSystemInfo` command using the parameters of `pdev`.
    pub(crate) fn new(pdev: &'a pci::Device<device::Bound>) -> Self {
        Self { pdev }
    }
}

impl<'a> CommandToGsp for SetSystemInfo<'a> {
    const FUNCTION: MsgFunction = MsgFunction::GspSetSystemInfo;
    type Command = GspSetSystemInfo;
    type InitError = Error;

    fn init(&self) -> impl Init<Self::Command, Self::InitError> {
        GspSetSystemInfo::init(self.pdev)
    }
}
+1 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0

pub(crate) mod commands;
mod r570_144;

// Alias to avoid repeating the version number with every use.
Loading