nova-core: run FWSEC-FRTS to perform first stage of GSP initialization
Status from this message: Applied to alloc-next, thanks!
Get series with b4
b4 am [email protected] change-id 20250417-nova-frts-96ef299abe2cVersions newest first
- v6 Latest24 patches 10 repliesApplied
- v523 patches 34 repliesSuperseded
- v420 patches 88 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 | 19 patches | 31 replies | Applied | |
| v2 | 21 patches | 19 replies | Superseded | |
| v1 | 16 patches | 43 replies | Superseded |
Changes in v6 from the cover letter
- Add dma_handle_with_offset method to CoherentAllocation.
- Move the num module into its own patchset and use ad-hoc code for now.
- Add new items (and remove obsolete ones) to the TODO tag TODO
entries in the code with their corresponding task in the list.
- Add TIMEOUT: comments wherever a timeout is used.
- Fix bug while waiting for falcon mem scrubbing to finish (thanks Ben Skeggs!)
- Pass the firwmare object instead of its DMA handle in dma_wr.
- Fix safety statements in fwsec.rs.
- Move FWSEC boot code to FwsecFirmware and a helper function of
Gpu to simplify Gpu::new.
- Add helper methods to NV_PFB_PRI_MMU_WPR2_ADDR_* to obtain the exact address.
- Fix build errors and warnings with Rust 1.78.
- Link to v5: https://lore.kernel.org/r/[email protected]
Patches in v6 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/24 | rust: dma: fix commentrust/ | +1 | 1 reply | |
| 2/24 | rust: dma: expose the count and size of CoherentAllocationrust/ | +26 | 1 reply | |
| 3/24 | rust: dma: add dma_handle_with_offset method to CoherentAllocationrust/ | +14 | 1 reply | |
| 4/24 | rust: make ETIMEDOUT error availablerust/ | +1 | 1 reply | |
| 5/24 | rust: sizes: add constants up to SZ_2Grust/ | +24 | 1 reply | |
| 6/24 | gpu: nova-core: use absolute paths in register!() macrodrivers/ | +6 | 0 replies | |
| 7/24 | gpu: nova-core: add delimiter for helper rules in register!() macrodrivers/ | +2 | 0 replies | |
| 8/24 | gpu: nova-core: expose the offset of each register as a type constantdrivers/ | +8 | 0 replies | |
| 9/24 | gpu: nova-core: allow register aliasesdrivers/ | +38 | 0 replies | |
| 10/24 | gpu: nova-core: increase BAR0 size to 16MBdrivers/ | +2 | 0 replies | |
| 11/24 | gpu: nova-core: add helper function to wait on conditiondrivers/ | +29 | 0 replies | |
| 12/24 | gpu: nova-core: wait for GFW_BOOT completiondrivers/ drivers/ drivers/ +2 more | +72 | 0 replies | |
| 13/24 | gpu: nova-core: add DMA object structdrivers/ drivers/ | +62 | 0 replies | |
| 14/24 | gpu: nova-core: register sysmem flush pagedrivers/ drivers/ drivers/ +4 more | +218 | 0 replies | |
| 15/24 | gpu: nova-core: add falcon register definitions and base codedrivers/ drivers/ drivers/ +5 more | +916 | 0 replies | |
| 16/24 | gpu: nova-core: firmware: add ucode descriptor used by FWSEC-FRTSdrivers/ | +45 | 0 replies | |
| 17/24 | gpu: nova-core: vbios: Add base support for VBIOS construction and iterationdrivers/ drivers/ drivers/ +1 more | +688 | 0 replies | |
| 18/24 | gpu: nova-core: vbios: Add support to look up PMU table in FWSECdrivers/ | +177 | 0 replies | |
| 19/24 | gpu: nova-core: vbios: Add support for FWSEC ucode extractiondrivers/ drivers/ | +298 | 0 replies | |
| 20/24 | gpu: nova-core: compute layout of the FRTS regiondrivers/ drivers/ drivers/ +4 more | +224 | 0 replies | |
| 21/24 | gpu: nova-core: add types for patching firmware binariesdrivers/ | +64 | 0 replies | |
| 22/24 | gpu: nova-core: extract FWSEC from BIOS and patch it to run FWSEC-FRTSdrivers/ drivers/ drivers/ +2 more | +434 | 0 replies | |
| 23/24 | gpu: nova-core: load and run FWSEC-FRTSdrivers/ drivers/ drivers/ +1 more | +136 | 0 replies | |
| 24/24 | gpu: nova-core: update and annotate TODO listDocumentation/ drivers/ drivers/ +10 more | +84 | 0 replies |
Reviews trailers per patch
11 of 24 patches have a Reviewed-by or Acked-by.
| Patch | Benno Lossin | Boqun Feng | Lyude Paul | Miguel Ojeda |
|---|---|---|---|---|
| 1/24 | ||||
| 2/24 | ||||
| 3/24 | ||||
| 4/24 | R-b | A-b | ||
| 5/24 | R-b | A-b | ||
| 6/24 | R-b | |||
| 7/24 | R-b | |||
| 8/24 | R-b | |||
| 9/24 | ||||
| 10/24 | ||||
| 11/24 | ||||
| 12/24 | ||||
| 13/24 | R-b | |||
| 14/24 | ||||
| 15/24 | R-b | |||
| 16/24 | R-b | |||
| 17/24 | ||||
| 18/24 | ||||
| 19/24 | ||||
| 20/24 | R-b | |||
| 21/24 | R-b | |||
| 22/24 | ||||
| 23/24 | R-b | |||
| 24/24 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH v6 00/24] nova-core: run FWSEC-FRTS to perform first stage of GSP initialization
Hi everyone,
After discussion, and since the num module seems to be taking more time to reach consensus than the rest of this series, I have split it into its own patch series and use ad-hoc code in Nova (only a handful of places thankfully) for now that will be replaced by the num patch series. This will also allow it to maybe get more attention as it was until now buried inside a loosely-related patch series.
This also includes an important fix for a bug discovered by Ben Skeggs in the falcon code: the bit indicating the completion of memory scrubbing was interpreted incorrectly, which created a race condition that could result in a failure to boot the GSP. :O
Other than that, a few more minor refinements took place, but nothing that changes this series considerably. The last patch tries to organize the increasing number of TODO items we have in the code; until they can be addressed, it would be nice to understand which task in todo.rst they correspond to, so I took the freedom to annotate them all to that effect.
Usual disclaimer: this series currently only successfully probes Ampere GPUs, and does not allow the GPU to do anything useful yet. Upon successful probe, the driver will only display the range of the WPR2 region constructed by FWSEC-FRTS with debug priority:
[ 95.436000] NovaCore 0000:01:00.0: WPR2: 0xffc00000-0xffce0000 [ 95.436002] NovaCore 0000:01:00.0: GPU instance built
This series is based on v6.16-rc1 with no other dependencies.
There are bits of documentation still missing, these are addressed by Joel in his own documentation patch series [1]. I'll also double-check and send follow-up patches if anything is still missing after that.
[1] https://lore.kernel.org/rust-for-linux/[email protected]/
---
Changes in v6:
- Add dma_handle_with_offset method to CoherentAllocation.
- Move the num module into its own patchset and use ad-hoc code for now.
- Add new items (and remove obsolete ones) to the TODO tag TODO
entries in the code with their corresponding task in the list.
- Add TIMEOUT: comments wherever a timeout is used.
- Fix bug while waiting for falcon mem scrubbing to finish (thanks Ben Skeggs!)
- Pass the firwmare object instead of its DMA handle in dma_wr.
- Fix safety statements in fwsec.rs.
- Move FWSEC boot code to FwsecFirmware and a helper function of
Gpu to simplify Gpu::new.
- Add helper methods to NV_PFB_PRI_MMU_WPR2_ADDR_* to obtain the exact address.
- Fix build errors and warnings with Rust 1.78.
- Link to v5: https://lore.kernel.org/r/[email protected]
Changes in v5:
- Rebased on top of 6.16-rc1.
- Improve invariants of CoherentAllocation related to the new size method.
- Use SZ_* consts when redefining BAR0 size.
- Split VBIOS patch into 3 patches (Joel)
- Convert all Result<()> into Result.
- Use ::cast<T>() instead of as to convert pointer types.
- Use KBox instead of Arc for falcon HALs.
- Do not use get_ prefix on methods that do not increase reference count.
- Replace arbitrary immediate values with proper constants.
- Use EIO to indicate firmware errors.
- Use inspect_err to be more verbose on which step of the FWSEC setup failed.
- Move sysmem flush page into its own type and add its registration to the FB HAL.
- Turn HAL getters into standalone functions.
- Patch FWSEC command at construction time.
- Force the signing stage (or an explicit non-signing state transition) on the firmware DMA objects.
- Link to v4: https://lore.kernel.org/r/[email protected]
Changes in v4:
- Improve documentation of falcon security modes (thanks Joel!)
- Add the definition of the size of CoherentAllocation as one of its invariants.
- Better document GFW boot progress, registers and use wait_on() helper, and move it to gfw module instead of devinit.
- Add missing TODOs for workarounds waiting to be replaced by in-flight R4L features.
- Register macro: add the offset of the register as a type constant, and allow register aliases for registers which can be interpreted differently depending on context.
- Rework the num module using only macros (to allow use of overflowing ops), and add the PowerOfTwo type.
- Add a proper HAL to the fb module.
- Move HAL builders to impl blocks of Chipset.
- Add proper types and traits for signatures.
- Proactively split FalconFirmware into distinct traits to ease management of v2 vs v3 FWSEC headers that will be needed for Turing support.
- Link to v3:
https://lore.kernel.org/r/[email protected]
Changes in v3:
- Rebased on top of latest nova-next.
- Use the new Devres::access() and remove the now unneeded with_bar!() macro.
- Dropped rust: devres: allow to borrow a reference to the resource's Device as it is not needed anymore.
- Fixed more erroneous uses of ERANGE error.
- Optimized alignment computations of the FB layout a bit.
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Rebased on latest nova-next.
- Fixed all clippy warnings.
- Added count and size methods to CoherentAllocation.
- Added method to obtain a reference to the Device from a Devres (this is super convenient).
- Split DmaObject into its own patch and added Deref implementation.
- Squashed field names from [3] into "extract FWSEC from BIOS".
- Fixed erroneous use of ERANGE error.
- Reworked register!() macro towards a more intuitive syntax, moved
its helper macros into internal rules to avoid polluting the macro namespace.
- Renamed all registers to capital snake case to better match OpenRM.
- Removed declarations for registers that are not used yet.
- Added more documentation for items not covered by Joel's documentation patches.
- Removed timer device and replaced it with a helper function using Ktime. This also made [4] unneeded so it is dropped.
- Unregister the sysmem flush page upon device destruction.
- ... probably more that I forgot. >_<
- Link to v1: https://lore.kernel.org/r/[email protected]
[3] https://lore.kernel.org/all/[email protected]/
[4] https://lore.kernel.org/lkml/[email protected]/
---
Alexandre Courbot (21):
rust: dma: fix comment
rust: dma: expose the count and size of CoherentAllocation
rust: dma: add dma_handle_with_offset method to CoherentAllocation
rust: make ETIMEDOUT error available
rust: sizes: add constants up to SZ_2G
gpu: nova-core: use absolute paths in register!() macro
gpu: nova-core: add delimiter for helper rules in register!() macro
gpu: nova-core: expose the offset of each register as a type constant
gpu: nova-core: allow register aliases
gpu: nova-core: increase BAR0 size to 16MB
gpu: nova-core: add helper function to wait on condition
gpu: nova-core: wait for GFW_BOOT completion
gpu: nova-core: add DMA object struct
gpu: nova-core: register sysmem flush page
gpu: nova-core: add falcon register definitions and base code
gpu: nova-core: firmware: add ucode descriptor used by FWSEC-FRTS
gpu: nova-core: compute layout of the FRTS region
gpu: nova-core: add types for patching firmware binaries
gpu: nova-core: extract FWSEC from BIOS and patch it to run FWSEC-FRTS
gpu: nova-core: load and run FWSEC-FRTS
gpu: nova-core: update and annotate TODO list
Joel Fernandes (3):
gpu: nova-core: vbios: Add base support for VBIOS construction and iteration
gpu: nova-core: vbios: Add support to look up PMU table in FWSEC
gpu: nova-core: vbios: Add support for FWSEC ucode extraction
Documentation/gpu/nova/core/todo.rst | 107 +-- drivers/gpu/nova-core/dma.rs | 58 ++ drivers/gpu/nova-core/driver.rs | 6 +- drivers/gpu/nova-core/falcon.rs | 554 ++++++++++++++ drivers/gpu/nova-core/falcon/gsp.rs | 24 + drivers/gpu/nova-core/falcon/hal.rs | 54 ++ drivers/gpu/nova-core/falcon/hal/ga102.rs | 119 +++ drivers/gpu/nova-core/falcon/sec2.rs | 10 + drivers/gpu/nova-core/fb.rs | 136 ++++ drivers/gpu/nova-core/fb/hal.rs | 39 + drivers/gpu/nova-core/fb/hal/ga100.rs | 57 ++ drivers/gpu/nova-core/fb/hal/ga102.rs | 36 + drivers/gpu/nova-core/fb/hal/tu102.rs | 58 ++ drivers/gpu/nova-core/firmware.rs | 108 +++ drivers/gpu/nova-core/firmware/fwsec.rs | 423 +++++++++++ drivers/gpu/nova-core/gfw.rs | 41 + drivers/gpu/nova-core/gpu.rs | 132 +++- drivers/gpu/nova-core/nova_core.rs | 5 + drivers/gpu/nova-core/regs.rs | 288 +++++++ drivers/gpu/nova-core/regs/macros.rs | 65 +- drivers/gpu/nova-core/util.rs | 28 + drivers/gpu/nova-core/vbios.rs | 1157 +++++++++++++++++++++++++++++ rust/kernel/dma.rs | 48 +- rust/kernel/error.rs | 1 + rust/kernel/sizes.rs | 24 + 25 files changed, 3504 insertions(+), 74 deletions(-)
---
base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
change-id: 20250417-nova-frts-96ef299abe2c
Best regards,
Signature · 1 line
Alexandre Courbot <[email protected]>