mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
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 <joelagnelf@nvidia.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Message-ID: <20251114195552.739371-11-joelagnelf@nvidia.com>
This commit is contained in:
parent
e386680e8d
commit
9641f05223
|
|
@ -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 @@ pub(crate) fn new(data: &[u8], dev: &device::Device) -> Result<(Self, usize)> {
|
|||
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 @@ fn run(&self, seq: &GspSequencer<'_>) -> Result {
|
|||
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(())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user