Skip to content

Transition Nova Core to TLV firmware images

Timur Tabi driver-core nova-gpu rust-for-linux sashiko-reviews 7 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest8 patches 9 repliesApplied
  2. v68 patches 2 repliesSuperseded
  3. v58 patches 12 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v47 patches3 repliesSuperseded
v37 patches32 repliesSuperseded
v27 patches5 repliesSuperseded
v18 patches42 repliesSuperseded

Changes in v7 from the cover letter

1) Removed errant os_code_offset change in booter
2) Removed stray assert! in gsp.rs
3) Fixed tlv.rst (three -> four)

Patches in v7 Applied

#Subject and filesSizeRepliesApplied
1/8rust: alloc: add Vec::zeroed methodrust/kernel/alloc/kvec.rs+27 -01 reply
2/8rust: firmware: add request_into_buf()rust/kernel/firmware.rs+46 -21 reply
3/8gpu: nova-core: add TLV parser for firmware filesDocumentation/gpu/nova/core/tlv.rst Documentation/gpu/nova/index.rst drivers/gpu/nova-core/firmware.rs +1 more+453 -05 replies
4/8gpu: nova-core: transition booter to TLV imagesdrivers/gpu/nova-core/firmware.rs drivers/gpu/nova-core/firmware/booter.rs drivers/gpu/nova-core/firmware/tlv.rs +1 more+62 -2970 replies
5/8gpu: nova-core: transition gsp to TLV imagesdrivers/gpu/nova-core/firmware.rs drivers/gpu/nova-core/firmware/gsp.rs drivers/gpu/nova-core/firmware/riscv.rs +1 more+38 -1260 replies
6/8gpu: nova-core: transition gen_bootloader to TLV imagesdrivers/gpu/nova-core/firmware.rs drivers/gpu/nova-core/firmware/fwsec/bootloader.rs+20 -790 replies
7/8gpu: nova-core: transition fsp to TLV imagesdrivers/gpu/nova-core/firmware.rs drivers/gpu/nova-core/firmware/fsp.rs drivers/gpu/nova-core/fsp.rs+46 -2750 replies
8/8gpu: nova-core: update firmware module info for TLV imagesdrivers/gpu/nova-core/firmware.rs drivers/gpu/nova-core/gsp/hal.rs+8 -120 replies

Reviews trailers per patch

2 of 8 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAlexandre Courbot
SeriesR-b T-b
1/8R-b
2/8R-b
3/8
4/8
5/8
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v7 thread

Cover letter [PATCH v7 0/8] Transition Nova Core to TLV firmware images

This patch set transitions nova-core to use the new "TLV" firmware image files, instead of the ones that Nouveau uses.

A prerequisite patch "rust: error: add remaining error codes" is required to compile. [1]

The current r570.144 images are a mix of binary headers and ELF files that are cumbersome to parse in Rust. There's a significant amount of code that just reads in a struct, extracts some offset, and uses it to find another struct, only to have nova-core use just a few fields.

The new format uses a sequence of tag/length/value fields that can be iterated over. The script that generates the TLV files, extract-firmware-nova.py, does the extra work to find the specific metadata needed by Nova and packages each one separately.

The TLV versions of r570.144 can be found here:

https://github.com/ttabi/linux-firmware-nova

along with instructions on how to install them. We are not planning on submitting these images to linux-firmware. Rather, if this patchset is accepted upstream, I expect the small handful of people who are actually working on Nova to grab and install these images, which needs to be done only once.

There are still opportunities for improvement. For example, I would like to get rid of more GPU-specific code, especially the GA100 quirks.

Note that there are plans to relocate these images into a different /lib/firmware subdirectory, to further isolate them from the images that Nouveau uses.

[1] https://lore.kernel.org/rust-for-linux/[email protected]/

v7:
1) Removed errant os_code_offset change in booter
2) Removed stray assert! in gsp.rs
3) Fixed tlv.rst (three -> four)

Timur Tabi (8):
rust: alloc: add Vec::zeroed method
rust: firmware: add request_into_buf()
gpu: nova-core: add TLV parser for firmware files
gpu: nova-core: transition booter to TLV images
gpu: nova-core: transition gsp to TLV images
gpu: nova-core: transition gen_bootloader to TLV images
gpu: nova-core: transition fsp to TLV images
gpu: nova-core: update firmware module info for TLV images

 Documentation/gpu/nova/core/tlv.rst           | 184 ++++++++++
 Documentation/gpu/nova/index.rst              |   1 +
 drivers/gpu/nova-core/firmware.rs             | 295 +---------------
 drivers/gpu/nova-core/firmware/booter.rs      | 329 +++---------------
 drivers/gpu/nova-core/firmware/fsp.rs         |  88 +++--
 .../nova-core/firmware/fwsec/bootloader.rs    |  75 +---
 drivers/gpu/nova-core/firmware/gsp.rs         |  59 +---
 drivers/gpu/nova-core/firmware/riscv.rs       |  75 +---
 drivers/gpu/nova-core/firmware/tlv.rs         | 265 ++++++++++++++
 drivers/gpu/nova-core/fsp.rs                  |  11 +-
 drivers/gpu/nova-core/gsp/boot.rs             |   7 +-
 drivers/gpu/nova-core/gsp/hal.rs              |   8 +-
 drivers/gpu/nova-core/gsp/hal/tu102.rs        |  13 +-
 rust/kernel/alloc/kvec.rs                     |  27 ++
 rust/kernel/firmware.rs                       |  48 ++-
 15 files changed, 697 insertions(+), 788 deletions(-)
 create mode 100644 Documentation/gpu/nova/core/tlv.rst
 create mode 100644 drivers/gpu/nova-core/firmware/tlv.rs

base-commit: 44e7e7f7cffb10a93bb88e7cb59b7b8b3e2deb1c
prerequisite-patch-id: 92c2d027299f0bc35d20918668f6874712d12f28

Signature · 1 line
2.54.0