mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 15:03:52 +08:00
Right now the GSP boot code is very incomplete and limited to running FRTS, so having it in `Gpu::new` is not a big constraint. However, this will change as we add more steps of the GSP boot process, and not all GPU families follow the same procedure, so having these steps in a dedicated method is the logical construct. There is also the fact the GSP will require its own runtime data, and while it won't immediately need to be pinned, we want to be ready for the time where it will - most likely when it starts using mutexes. Thus, add an empty `Gsp` type that is pinned inside `Gpu` and initialized using a pin initializer. This sets the constraint we need to observe from the start, and could spare us some costly refactoring down the road. Then, move the code related to GSP boot to the `gsp::boot` module, as part of the `Gsp` implementation. Doing so allows us to make `Gpu::new` return a fallible `impl PinInit` instead of a `Result.` This is more idiomatic when working with pinned objects, and sets up the pinned initialization pattern we want to preserve as the code grows more complex. Acked-by: Danilo Krummrich <dakr@kernel.org> Link: https://lore.kernel.org/r/20250913-nova_firmware-v6-2-9007079548b0@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
29 lines
527 B
Rust
29 lines
527 B
Rust
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
//! Nova Core GPU Driver
|
|
|
|
mod dma;
|
|
mod driver;
|
|
mod falcon;
|
|
mod fb;
|
|
mod firmware;
|
|
mod gfw;
|
|
mod gpu;
|
|
mod gsp;
|
|
mod regs;
|
|
mod util;
|
|
mod vbios;
|
|
|
|
pub(crate) const MODULE_NAME: &kernel::str::CStr = <LocalModule as kernel::ModuleMetadata>::NAME;
|
|
|
|
kernel::module_pci_driver! {
|
|
type: driver::NovaCore,
|
|
name: "NovaCore",
|
|
authors: ["Danilo Krummrich"],
|
|
description: "Nova Core GPU driver",
|
|
license: "GPL v2",
|
|
firmware: [],
|
|
}
|
|
|
|
kernel::module_firmware!(firmware::ModInfoBuilder);
|