This series makes more progress on the GSP boot process for Ampere GPUs. At the end of the previous series [1], we were left with a WPR memory region created by the FRTS firmware, but still far from the GSP running. This series brings us closer to that goal by preparing 2 new firmware packages:
* The Booter firmware, which the driver loads and runs on the SEC2 falcon; * The GSP bootloader, which is loaded by Booter onto the GSP RISC-V core; * The GSP firmware itself, which is verified and loaded by the GSP bootloader. There 3 firmwares are involved in a rather complex dance that is made necessary by limitations related to the level of privilege required to load code onto the GSP (doing so requires a Heavy Secured signed firmware, which is the role fulfilled by Booter). The first 5 patches do some cleanup and preparatory work for the remainder of the series. Notably, the GSP boot is moved to a new method of `Gpu` to get ready for the additional steps that will be added to it. We also simplify chipset name generation a bit and move the code requesting a firmware file into a dedicated function in prevision of the removal of the `Firmware` structure. Patch 6 parses the Booter firmware file, queries the hardware for the right signature to use, and patch it into the firmware blob. This makes Booter ready to load and run. Patches 7 and 8 prepare the GSP firmware and its bootloader, and keep them into a single structure as they are closely related. Patches 9 and 10 switch to the 570.144 firmware and introduce the layout for its bindings. The raw bindings are stored in a private module, and abstracted by the parent module as needed. This allows consumer modules to access a safer/nicer form of the bindings than the raw one, and also makes it easier to switch to a different (and potentially incompatible) firmware version in the future. 570.144 has been picked because it is the latest firmware currently in linux-firmware, but as development progresses the plan is to switch to a newer one that is designed with the constraint of upstream in mind. So support for 570.144 will be dropped in the future. Support for multiple firmware versions is not considered at the moment: there is no immediate need for it as the driver is still unstable, and we can think about this point once we approach stability (and have better visibility about the shape of the firmware at that point). The last patch introduces the first bindings and uses them to compute more framebuffer layout information needed for booting the GSP. A separate patch series will pick up from there to use this information and finally run these firmware blobs. The base of this series is today's drm-rust-next, with a couple more dependencies required: - The Alignment series [2], - The pin-init patch allowing references to previously initialized fields [3], - The following diff to make the aforementioned pin-init patch build: --- a/rust/kernel/devres.rs +++ b/rust/kernel/devres.rs @@ -138,7 +138,6 @@ pub fn new<'a, E>( try_pin_init!(&this in Self { dev: dev.into(), - callback, // INVARIANT: `inner` is properly initialized. inner <- { // SAFETY: `this` is a valid pointer to uninitialized memory. @@ -160,6 +159,7 @@ pub fn new<'a, E>( data <- Revocable::new(data), })) }, + callback, }) } A tree with all these dependencies and the patches of this series is available at [4]. [1] https://lore.kernel.org/rust-for-linux/20250619-nova-frts-v6-0-ecf41ef99...@nvidia.com/ [2] https://lore.kernel.org/rust-for-linux/20250908-num-v5-0-c0f2f681e...@nvidia.com/ [3] https://lore.kernel.org/rust-for-linux/20250905140047.3325945-1-los...@kernel.org/ [4] https://github.com/Gnurou/linux/tree/b4/nova_firmware Signed-off-by: Alexandre Courbot <acour...@nvidia.com> --- Changes in v4: - Rebase on top of latest Alignment series. - Make use of pin-init references to initialized fields. - Remove all uses of `unsafe` except for `FromBytes` and `AsBytes` implementations. - Keep the GSP placeholder inside the `Gpu` struct. - Move GSP firmware bindings under the `gsp` module. - Get the firmware-specific information from the bindings instead of a HAL. - Link to v3: https://lore.kernel.org/r/20250902-nova_firmware-v3-0-56854d9c5...@nvidia.com Changes in v3: - Move the GSP boot process out of the Gpu constructor. - Get rid of the `Firmware` struct and discard loaded firmware blobs after the GSP is booted. - Consolidate the GSP firmware, bootloader and signatures into a single type. - Make firmware bindings completely opaque to the driver. - Improve firmware abstractions related to framebuffer carveout. - Improve comments and naming throughout the series. (thanks John!) - Use alias for bindings module in `nvfw` to avoid repeated version numbers everywhere. (thanks John!) - Fix inconsistency in naming of members of Booter header. (thanks Timur!) - Link to v2: https://lore.kernel.org/r/20250826-nova_firmware-v2-0-93566252f...@nvidia.com Changes in v2: - Add some GSP bindings and use them to compute more FB layout info needed to boot GSP, - Use PinInit in GspFirmware to avoid several heap allocations, - Rename `bootloader` to `gsp_bootloader` in `Firmware` to avoid confusion with the future Turing falcon bootloader, - Link to v1: https://lore.kernel.org/r/20250822-nova_firmware-v1-0-ff5633679...@nvidia.com --- Alexandre Courbot (10): gpu: nova-core: require `Send` on `FalconEngine` and `FalconHal` gpu: nova-core: move GSP boot code to a dedicated method gpu: nova-core: add Chipset::name() method gpu: nova-core: firmware: move firmware request code into a function gpu: nova-core: firmware: add support for common firmware header gpu: nova-core: firmware: process Booter and patch its signature gpu: nova-core: firmware: process and prepare the GSP firmware gpu: nova-core: firmware: process the GSP bootloader gpu: nova-core: firmware: use 570.144 firmware gpu: nova-core: compute layout of more framebuffer regions required for GSP Alistair Popple (1): gpu: nova-core: Add base files for r570.144 firmware bindings Documentation/gpu/nova/core/todo.rst | 17 - drivers/gpu/nova-core/falcon.rs | 6 +- drivers/gpu/nova-core/falcon/hal.rs | 2 +- drivers/gpu/nova-core/fb.rs | 65 +++- drivers/gpu/nova-core/firmware.rs | 107 ++++-- drivers/gpu/nova-core/firmware/booter.rs | 375 ++++++++++++++++++++++ drivers/gpu/nova-core/firmware/gsp.rs | 239 ++++++++++++++ drivers/gpu/nova-core/firmware/riscv.rs | 89 +++++ drivers/gpu/nova-core/gpu.rs | 93 ++++-- drivers/gpu/nova-core/gsp.rs | 11 + drivers/gpu/nova-core/gsp/fw.rs | 101 ++++++ drivers/gpu/nova-core/gsp/fw/r570_144.rs | 28 ++ drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs | 126 ++++++++ drivers/gpu/nova-core/nova_core.rs | 1 + drivers/gpu/nova-core/util.rs | 20 -- 15 files changed, 1184 insertions(+), 96 deletions(-) --- base-commit: e2580413a83680f679904ad2f2c1aa6969876469 change-id: 20250822-nova_firmware-e0ffb492ba35 prerequisite-message-id: <20250905140047.3325945-1-los...@kernel.org> prerequisite-patch-id: 32113c3a3ca8ccf16e2ed272303d9abbc4300ae3 prerequisite-change-id: 20250620-num-9420281c02c7:v5 prerequisite-patch-id: 50077433250cad1cf60eb8f85c78e532ac91852e prerequisite-patch-id: 021a41cd35f09790ec383521ecc9b4c167868732 prerequisite-patch-id: a1ec5698a198d4aad45432b50d42f401e3db6452 prerequisite-patch-id: 8565b054c432bcc9a3a0d0121a934c74ef36d535 prerequisite-patch-id: 19d008deabb88beb441d2398f120ecb426fbdb43 prerequisite-patch-id: 3bc0d2be065a900d224ff8c1bc4450abfe9eb2cc prerequisite-patch-id: 5b4eb0f71fa2ccf662594819fa79fd932f4f164f prerequisite-patch-id: 9058ca08cd149444b5f910e4bb4494a890d1a733 prerequisite-patch-id: 8804806f7cc605feddded0804eec8b8362d7b965 prerequisite-patch-id: f999cabde51824432a1bf60817518d1ce189eb76 prerequisite-patch-id: 49e15538e142f2e7dd4f1ba0cf2fd891bd265d36 prerequisite-patch-id: 2ecf9b1e26b5203065bfac4ccf74301b3bb4fbe6 prerequisite-patch-id: 1af6ec7c2ce8503fe476985f59949dcd150ee6bf prerequisite-patch-id: ac72e72b3affece504bff76b60b88769ff200a2f prerequisite-patch-id: 7dc0a6da8c9727d27250cf730f8aaf6dd8b3d8c7 prerequisite-patch-id: 31a0a2469de9ac965186098072753dcc749b40fe prerequisite-patch-id: 7e6d1fc7cf910decf481d135a19b0add38da2b2a prerequisite-patch-id: c72ab11e9346de71eabfe0e6466636d5ab15a5ba prerequisite-patch-id: 3f236fdea8c4b33620d0f863fea573b46ab0ded6 prerequisite-patch-id: a8ab42d0c9c3c837bb4cacb02cef585ef163a27e prerequisite-patch-id: 930a1f26364ed67e0d6b85c96251028fda43c80a prerequisite-patch-id: f1bc1fd46145a66235ab7475463584e1803882a3 prerequisite-patch-id: 4a2fd7bd8d13dc2feaf68e0dc681546ce2ab3e40 prerequisite-patch-id: 2da333d93c188016ad87c5ae882a4c1f669d3819 prerequisite-patch-id: dd0df8d299dc0615a88cc0019f38bc09cee31ed7 prerequisite-patch-id: 795530b48c8a232f5221846ad96696fe60f24db3 prerequisite-patch-id: 3f1cb6654d6d4281c0fac3310b156a7d3ae9c641 prerequisite-patch-id: a82ca85da78fcd6ecb33de2fbe90a029f6232e50 prerequisite-patch-id: dd4880d4228c175486a7313459a6fba6d8e1f6ed prerequisite-patch-id: a05c9aacdcd29aa789f755f98dc8bd8588f0393a prerequisite-patch-id: b0be3d658a177f73a0a666fc4441829445681b2a prerequisite-patch-id: 0e1b1f9a665317ff569a37df6ff49cd1880b04f8 prerequisite-patch-id: 178b864e6d1b88ee299dcc05d1a7a4c89ec7ed51 prerequisite-patch-id: 8e2eeaa55f11f485bac082243c7d1f3b3d6efe54 prerequisite-patch-id: 62fa6de7d3ae99dc54c092087bd716e6749545fd prerequisite-patch-id: 3d14d56ca93b0831837aa26b802100a250adeac6 prerequisite-patch-id: 7a12f4b0e7588874ce589b41b70671dc261b9468 prerequisite-patch-id: c44763ec35c4e4431e769df088b98424cbddf7df prerequisite-patch-id: a9e008c179b1c2fbe76654a191e5018880383d49 prerequisite-patch-id: 1e9ce500ce25188c575be608cd39e15a59836f83 prerequisite-patch-id: 39ca3a210a6c365434924c07a0c98a074eb73b97 prerequisite-patch-id: a747e05834cdb8b8f727e1f7c8b110c636cadab8 prerequisite-patch-id: 24833689bdecd3fc7a604e13bfe203ccd2fca6f0 prerequisite-patch-id: 107d1766d92729e84241f359d4763adb380fb566 prerequisite-patch-id: ac3060c99744a78b608b865d344ef2ef4d929071 prerequisite-patch-id: 1739e6a78e50414134dafb772ca76b7db40900f1 Best regards, -- Alexandre Courbot <acour...@nvidia.com>