Commit Graph
9 Commits
Author SHA1 Message Date
Alexandre Courbot 1a8f58c5e1 gpu: nova-core: convert FUSE registers to kernel register macro
Convert all FUSE registers to use the kernel's register macro and update
the code accordingly.

Reviewed-by: Eliot Courtney <[email protected]>
Reviewed-by: Gary Guo <[email protected]>
Acked-by: Danilo Krummrich <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Alexandre Courbot <[email protected]>
2026-03-26 15:08:28 +09:00
Alexandre Courbot ffabad08e4 gpu: nova-core: convert GC6 registers to kernel register macro
Convert all GC6 registers to use the kernel's register macro and update
the code accordingly.

Reviewed-by: Eliot Courtney <[email protected]>
Reviewed-by: Gary Guo <[email protected]>
Acked-by: Danilo Krummrich <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Alexandre Courbot <[email protected]>
2026-03-26 15:08:28 +09:00
Alexandre Courbot 7973858907 gpu: nova-core: convert PFB registers to kernel register macro
Convert all PFB registers to use the kernel's register macro and update
the code accordingly.

NV_PGSP_QUEUE_HEAD was somehow caught in the PFB section, so move it to
its own section and convert it as well.

Reviewed-by: Eliot Courtney <[email protected]>
Reviewed-by: Gary Guo <[email protected]>
Acked-by: Danilo Krummrich <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Alexandre Courbot <[email protected]>
2026-03-26 15:08:27 +09:00
Alexandre Courbot 80b3dc0a5a gpu: nova-core: justify remaining uses of as
There are a few remaining cases where we *do* want to use `as`,
because we specifically want to strip the data that does not fit into
the destination type. Comment these uses to clear confusion about the
intent.

Acked-by: Danilo Krummrich <[email protected]>
[[email protected]: fix merge conflicts after rebase.]
Signed-off-by: Alexandre Courbot <[email protected]>
Message-ID: <[email protected]>
2025-11-08 08:22:51 +09:00
John Hubbard 173c99b85a gpu: nova-core: apply the one "use" item per line policy
As per [1], we need one "use" item per line, in order to reduce merge
conflicts. Furthermore, we need a trailing ", //" in order to tell
rustfmt(1) to leave it alone.

This does that for the entire nova-core driver.

[1] https://docs.kernel.org/rust/coding-guidelines.html#imports

Acked-by: Danilo Krummrich <[email protected]>
Signed-off-by: John Hubbard <[email protected]>
[[email protected]: remove imports already in prelude as pointed out
by Danilo.]
[[email protected]: remove a few unneeded trailing `//`.]
Signed-off-by: Alexandre Courbot <[email protected]>
Message-ID: <[email protected]>
2025-11-07 23:10:44 +09:00
Alexandre Courbot 6553a8f168 gpu: nova-core: use try_from instead of as for u32 conversions
There are a few situations in the driver where we convert a `usize` into
a `u32` using `as`. Even though most of these are obviously correct, use
`try_from` and let the compiler optimize wherever it is safe to do so.

Acked-by: Danilo Krummrich <[email protected]>
Signed-off-by: Alexandre Courbot <[email protected]>
Message-ID: <[email protected]>
2025-11-04 13:26:54 +09:00
Danilo Krummrich 43ad65eca2 gpu: nova-core: consider clippy::cast_lossless
Fix all warnings caused by `clippy::cast_lossless`, which is going to be
enabled by [1].

Cc: Alexandre Courbot <[email protected]>
Cc: Miguel Ojeda <[email protected]>
Link: https://lore.kernel.org/r/[email protected] [1]
Reviewed-by: Alexandre Courbot <[email protected]>
Tested-by: Alexandre Courbot <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Danilo Krummrich <[email protected]>
2025-06-25 01:17:22 +02:00
Alexandre Courbot 80213934d0 gpu: nova-core: compute layout of the FRTS region
FWSEC-FRTS is run with the desired address of the FRTS region as
parameter, which we need to compute depending on some hardware
parameters.

Do this in a `FbLayout` structure, that will be later extended to
describe more memory regions used to boot the GSP.

Reviewed-by: Lyude Paul <[email protected]>
Signed-off-by: Alexandre Courbot <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ In doc-comment of FbLayout s/bootup process/boot process/ - Danilo ]
Signed-off-by: Danilo Krummrich <[email protected]>
2025-06-23 21:56:35 +02:00
Alexandre Courbot 6554ad65b5 gpu: nova-core: register sysmem flush page
Reserve a page of system memory so sysmembar can perform a read on it if
a system write occurred since the last flush. Do this early as it can be
required to e.g. reset the GPU falcons.

Chipsets capabilities differ in that respect, so this commit also
introduces the FB HAL.

Signed-off-by: Alexandre Courbot <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ * Use kernel::page::PAGE_SIZE instead of kernel::bindings::PAGE_SIZE.
  * Get rid of the Option for SysmemFlush.
  * Slightly reword SysmemFlush doc-comments.

  - Danilo ]
Signed-off-by: Danilo Krummrich <[email protected]>
2025-06-23 19:55:53 +02:00