diff options
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, })) } |