From: Joel Fernandes Date: Fri, 14 Nov 2025 19:55:49 +0000 (-0500) Subject: gpu: nova-core: sequencer: Implement basic core operations X-Git-Tag: v6.19-rc1~157^2~8^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9641f052230041cdf853357c07e77632b729113f;p=thirdparty%2Fkernel%2Flinux.git gpu: nova-core: sequencer: Implement basic core operations These opcodes implement various falcon-related boot operations: reset, start, wait-for-halt. Signed-off-by: Joel Fernandes Reviewed-by: Lyude Paul Signed-off-by: Alexandre Courbot Message-ID: <20251114195552.739371-11-joelagnelf@nvidia.com> --- diff --git a/drivers/gpu/nova-core/gsp/sequencer.rs b/drivers/gpu/nova-core/gsp/sequencer.rs index 970c252f1a03b..081d1903e8f8f 100644 --- a/drivers/gpu/nova-core/gsp/sequencer.rs +++ b/drivers/gpu/nova-core/gsp/sequencer.rs @@ -76,6 +76,9 @@ pub(crate) enum GspSeqCmd { RegPoll(fw::RegPollPayload), DelayUs(fw::DelayUsPayload), RegStore(fw::RegStorePayload), + CoreReset, + CoreStart, + CoreWaitForHalt, } impl GspSeqCmd { @@ -110,6 +113,9 @@ impl GspSeqCmd { let size = opcode_size + size_of_val(&payload); (GspSeqCmd::RegStore(payload), size) } + fw::SeqBufOpcode::CoreReset => (GspSeqCmd::CoreReset, opcode_size), + fw::SeqBufOpcode::CoreStart => (GspSeqCmd::CoreStart, opcode_size), + fw::SeqBufOpcode::CoreWaitForHalt => (GspSeqCmd::CoreWaitForHalt, opcode_size), _ => return Err(EINVAL), }; @@ -214,6 +220,19 @@ impl GspSeqCmdRunner for GspSeqCmd { GspSeqCmd::RegPoll(cmd) => cmd.run(seq), GspSeqCmd::DelayUs(cmd) => cmd.run(seq), GspSeqCmd::RegStore(cmd) => cmd.run(seq), + GspSeqCmd::CoreReset => { + seq.gsp_falcon.reset(seq.bar)?; + seq.gsp_falcon.dma_reset(seq.bar); + Ok(()) + } + GspSeqCmd::CoreStart => { + seq.gsp_falcon.start(seq.bar)?; + Ok(()) + } + GspSeqCmd::CoreWaitForHalt => { + seq.gsp_falcon.wait_till_halted(seq.bar)?; + Ok(()) + } } } }