diff options
| author | Alistair Popple <apopple@nvidia.com> | 2025-11-10 22:34:18 +0900 |
|---|---|---|
| committer | Alexandre Courbot <acourbot@nvidia.com> | 2025-11-14 20:25:57 +0900 |
| commit | 4fd4acd973ec6c734e928d19aaa649d4268303a1 (patch) | |
| tree | e0568b91a7564d4ad64cb0cc15331a29986d3ea3 /drivers/gpu/nova-core/gsp.rs | |
| parent | 75f6b1de8133ea337b72901464989dc811d3305d (diff) | |
gpu: nova-core: gsp: Create rmargs
Initialise the GSP resource manager arguments (rmargs) which provides
initialisation parameters to the GSP firmware during boot. The rmargs
structure contains arguments to configure the GSP message/command queue
location.
These are mapped for coherent DMA and added to the libos data structure
for access when booting GSP.
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-10-8ae4058e3c0e@nvidia.com>
Diffstat (limited to 'drivers/gpu/nova-core/gsp.rs')
| -rw-r--r-- | drivers/gpu/nova-core/gsp.rs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/gpu/nova-core/gsp.rs b/drivers/gpu/nova-core/gsp.rs index f9819a04bb40..609f8e5f2dcc 100644 --- a/drivers/gpu/nova-core/gsp.rs +++ b/drivers/gpu/nova-core/gsp.rs @@ -24,8 +24,11 @@ pub(crate) use fw::{ use crate::{ gsp::cmdq::Cmdq, - gsp::fw::LibosMemoryRegionInitArgument, - num, // + gsp::fw::{ + GspArgumentsCached, + LibosMemoryRegionInitArgument, // + }, + num, }; pub(crate) const GSP_PAGE_SHIFT: usize = 12; @@ -108,6 +111,8 @@ pub(crate) struct Gsp { logrm: LogBuffer, /// Command queue. pub(crate) cmdq: Cmdq, + /// RM arguments. + rmargs: CoherentAllocation<GspArgumentsCached>, } impl Gsp { @@ -134,11 +139,20 @@ impl Gsp { let cmdq = Cmdq::new(dev)?; + let rmargs = CoherentAllocation::<GspArgumentsCached>::alloc_coherent( + dev, + 1, + GFP_KERNEL | __GFP_ZERO, + )?; + dma_write!(rmargs[0] = fw::GspArgumentsCached::new(&cmdq))?; + dma_write!(libos[3] = LibosMemoryRegionInitArgument::new("RMARGS", &rmargs))?; + Ok(try_pin_init!(Self { libos, loginit, logintr, logrm, + rmargs, cmdq, })) } |