gpu: nova-core: consolidate GSP boot parameters into GspBootContext
Subsystems (4)
PATCH 1/1 gpu: nova-core: consolidate GSP boot parameters into GspBootContext
The GSP boot path threads pdev, bar, chipset, gsp_falcon and sec2_falcon individually through boot() -> run_fwsec_frts() -> sequencer.
Bundle them into a GspBootContext struct to cut down on parameter passing and the associated import boilerplate. It is for easily introducing other boot params like vGPU enable, WRP size in future.
No functional change is intended.
Signed-off-by Zhi Wang <[email protected]>
--- drivers/gpu/nova-core/gpu.rs | 16 ++++- drivers/gpu/nova-core/gsp.rs | 22 ++++++ drivers/gpu/nova-core/gsp/boot.rs | 97 ++++++++++---------------- drivers/gpu/nova-core/gsp/sequencer.rs | 71 ++++++++----------- 4 files changed, 99 insertions(+), 107 deletions(-)
drivers/gpu/nova-core/gpu.rs +14 -2
@@ -18,7 +18,10 @@ }, fb::SysmemFlush, gfw, - gsp::Gsp, + gsp::{ + Gsp, + GspBootContext, // + }, regs, };
@@ -283,7 +286,16 @@ pub(crate) fn new<'a>( gsp <- Gsp::new(pdev), - _: { gsp.boot(pdev, bar, spec.chipset, gsp_falcon, sec2_falcon)? }, + _: { +let ctx =GspBootContext { + pdev, + bar, + chipset: spec.chipset, + gsp_falcon, + sec2_falcon, + }; + gsp.boot (&ctx)? + }, bar: devres_bar, })
drivers/gpu/nova-core/gsp.rs +22 -0
@@ -25,6 +25,13 @@ };use crate ::{ + driver::Bar0 , + falcon::{ + gsp::Gsp as GspFalcon , + sec2::Sec2 as Sec2Falcon , +Falcon ,// + }, + gpu::Chipset , gsp::cmdq::Cmdq , gsp::fw::{GspArgumentsPadded ,
@@ -39,6 +46,21 @@/// Number of GSP pages to use in a RM log buffer. const RM_LOG_BUFFER_NUM_PAGES :usize =0x10 ; +/// Common context for the GSP boot process. +pub (crate )struct GspBootContext <'a> { +pub (crate ) pdev: &'a pci::Device <device::Bound >, +pub (crate ) bar: &'aBar0 , +pub (crate ) chipset:Chipset , +pub (crate ) gsp_falcon: &'aFalcon <GspFalcon >, +pub (crate ) sec2_falcon: &'aFalcon <Sec2Falcon >, +} + +impl GspBootContext <'_> { +pub (crate )fn dev (&self) -> &device::Device <device::Bound > { + self.pdev.as_ref () + } +} +/// Array of page table entries, as understood by the GSP bootloader. #[repr( C )] struct PteArray <const NUM_ENTRIES :usize >([u64 ;NUM_ENTRIES ]);
drivers/gpu/nova-core/gsp/boot.rs +35 -62
205 lines not on this page · raw message
drivers/gpu/nova-core/gsp/sequencer.rs +28 -43
166 lines not on this page · raw message
Signature · 1 line
2.51.0