diff options
| author | Alistair Popple <apopple@nvidia.com> | 2025-11-10 22:34:19 +0900 |
|---|---|---|
| committer | Alexandre Courbot <acourbot@nvidia.com> | 2025-11-14 20:25:57 +0900 |
| commit | edcb134264f7db95295a9f0feb7a8b3acde72a08 (patch) | |
| tree | fa72470abe8c3886ffb2e0416e8f70a7206ec8eb /drivers/gpu/nova-core/gsp/commands.rs | |
| parent | 4fd4acd973ec6c734e928d19aaa649d4268303a1 (diff) | |
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: Alistair Popple <apopple@nvidia.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Message-ID: <20251110-gsp_boot-v9-11-8ae4058e3c0e@nvidia.com>
Diffstat (limited to 'drivers/gpu/nova-core/gsp/commands.rs')
| -rw-r--r-- | drivers/gpu/nova-core/gsp/commands.rs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/gpu/nova-core/gsp/commands.rs b/drivers/gpu/nova-core/gsp/commands.rs new file mode 100644 index 000000000000..305045e25693 --- /dev/null +++ b/drivers/gpu/nova-core/gsp/commands.rs @@ -0,0 +1,37 @@ +// 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) + } +} |