summaryrefslogtreecommitdiff
path: root/drivers/gpu/nova-core/gsp.rs
diff options
context:
space:
mode:
authorAlistair Popple <apopple@nvidia.com>2025-11-10 22:34:17 +0900
committerAlexandre Courbot <acourbot@nvidia.com>2025-11-14 20:25:57 +0900
commit75f6b1de8133ea337b72901464989dc811d3305d (patch)
treef80a55a19b882998ba08ba977ee715691177c3f7 /drivers/gpu/nova-core/gsp.rs
parent88622323dde3d9d6efd6f2efcfaa0bced5af94c3 (diff)
gpu: nova-core: gsp: Add GSP command queue bindings and handling
This commit introduces core infrastructure for handling GSP command and message queues in the nova-core driver. The command queue system enables bidirectional communication between the host driver and GSP firmware through a remote message passing interface. The interface is based on passing serialised data structures over a ring buffer with separate transmit and receive queues. Commands are sent by writing to the CPU transmit queue and waiting for completion via the receive queue. To ensure safety mutable or immutable (depending on whether it is a send or receive operation) references are taken on the command queue when allocating the message to write/read to. This ensures message memory remains valid and the command queue can't be mutated whilst an operation is in progress. Currently this is only used by the probe() routine and therefore can only used by a single thread of execution. Locking to enable safe access from multiple threads will be introduced in a future series when that becomes necessary. Signed-off-by: Alistair Popple <apopple@nvidia.com> Co-developed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Message-ID: <20251110-gsp_boot-v9-9-8ae4058e3c0e@nvidia.com>
Diffstat (limited to 'drivers/gpu/nova-core/gsp.rs')
-rw-r--r--drivers/gpu/nova-core/gsp.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/nova-core/gsp.rs b/drivers/gpu/nova-core/gsp.rs
index ec053395694b..f9819a04bb40 100644
--- a/drivers/gpu/nova-core/gsp.rs
+++ b/drivers/gpu/nova-core/gsp.rs
@@ -14,6 +14,7 @@ use kernel::{
transmute::AsBytes, //
};
+pub(crate) mod cmdq;
mod fw;
pub(crate) use fw::{
@@ -22,6 +23,7 @@ pub(crate) use fw::{
};
use crate::{
+ gsp::cmdq::Cmdq,
gsp::fw::LibosMemoryRegionInitArgument,
num, //
};
@@ -104,6 +106,8 @@ pub(crate) struct Gsp {
logintr: LogBuffer,
/// RM log buffer.
logrm: LogBuffer,
+ /// Command queue.
+ pub(crate) cmdq: Cmdq,
}
impl Gsp {
@@ -128,11 +132,14 @@ impl Gsp {
let logrm = LogBuffer::new(dev)?;
dma_write!(libos[2] = LibosMemoryRegionInitArgument::new("LOGRM", &logrm.0))?;
+ let cmdq = Cmdq::new(dev)?;
+
Ok(try_pin_init!(Self {
libos,
loginit,
logintr,
logrm,
+ cmdq,
}))
}
}