Linux driver-core infrastructure
 help / color / mirror / Atom feed
From: Timur Tabi <ttabi@nvidia.com>
To: Luis Chamberlain <mcgrof@kernel.org>,
	Russ Weight <russ.weight@linux.dev>,
	Danilo Krummrich <dakr@kernel.org>,
	Miguel Ojeda <ojeda@kernel.org>, <driver-core@lists.linux.dev>,
	<rust-for-linux@vger.kernel.org>, <nova-gpu@lists.linux.dev>,
	Gary Guo <gary@garyguo.net>,
	Alexandre Courbot <acourbot@nvidia.com>,
	Eliot Courtney <ecourtney@nvidia.com>,
	John Hubbard <jhubbard@nvidia.com>, Zhi Wang <zhiw@nvidia.com>
Subject: [PATCH v4 0/7] Transition Nova Core to TLV firmare images
Date: Thu, 9 Jul 2026 16:39:08 -0500	[thread overview]
Message-ID: <20260709213915.520109-1-ttabi@nvidia.com> (raw)

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.

[1] https://lore.kernel.org/rust-for-linux/20260629183022.2709524-1-ttabi@nvidia.com/

v4:
1) get_bytes returns error if value is empty
2) used to_result! macro.
3) Improved some documentation again.
4) Added Tlv::get_signature()
5) Changed tags from &[u8;4] to just [u8;4], removing lifetimes.
6) Added an INVARIANT comment to Tlv::new()
7) Several other Rust-ism changes.

As before, if I've overlooked a specific review comment, I apologize.

Timur Tabi (7):
  rust: firmware: add request_into_buf()
  gpu: nova-core: add TLV parser for firmware files
  gpu: nova-core: transition booter_load 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           | 182 ++++++++++
 drivers/gpu/nova-core/firmware.rs             | 302 +---------------
 drivers/gpu/nova-core/firmware/booter.rs      | 329 +++---------------
 drivers/gpu/nova-core/firmware/fsp.rs         |  88 +++--
 .../nova-core/firmware/fwsec/bootloader.rs    |  74 +---
 drivers/gpu/nova-core/firmware/gsp.rs         |  59 +---
 drivers/gpu/nova-core/firmware/riscv.rs       |  76 +---
 drivers/gpu/nova-core/firmware/tlv.rs         | 263 ++++++++++++++
 drivers/gpu/nova-core/fsp.rs                  |  11 +-
 drivers/gpu/nova-core/gsp/boot.rs             |   7 +-
 drivers/gpu/nova-core/gsp/hal/tu102.rs        |  13 +-
 rust/kernel/firmware.rs                       |  47 ++-
 12 files changed, 663 insertions(+), 788 deletions(-)
 create mode 100644 Documentation/gpu/nova/core/tlv.rst
 create mode 100644 drivers/gpu/nova-core/firmware/tlv.rs


base-commit: d85845b64c0020b2812243a22fa79d57cc1c1e38
prerequisite-patch-id: 92c2d027299f0bc35d20918668f6874712d12f28
-- 
2.54.0


             reply	other threads:[~2026-07-09 21:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09 21:39 Timur Tabi [this message]
2026-07-09 21:39 ` [PATCH v4 1/7] rust: firmware: add request_into_buf() Timur Tabi
2026-07-09 22:46   ` Timur Tabi
2026-07-09 23:02     ` Danilo Krummrich
2026-07-09 21:39 ` [PATCH v4 2/7] gpu: nova-core: add TLV parser for firmware files Timur Tabi
2026-07-09 21:39 ` [PATCH v4 3/7] gpu: nova-core: transition booter_load to TLV images Timur Tabi
2026-07-09 21:39 ` [PATCH v4 4/7] gpu: nova-core: transition gsp " Timur Tabi
2026-07-09 23:21   ` Danilo Krummrich
2026-07-09 21:39 ` [PATCH v4 5/7] gpu: nova-core: transition gen_bootloader " Timur Tabi
2026-07-09 21:39 ` [PATCH v4 6/7] gpu: nova-core: transition fsp " Timur Tabi
2026-07-09 21:39 ` [PATCH v4 7/7] gpu: nova-core: update firmware module info for " Timur Tabi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260709213915.520109-1-ttabi@nvidia.com \
    --to=ttabi@nvidia.com \
    --cc=acourbot@nvidia.com \
    --cc=dakr@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=ecourtney@nvidia.com \
    --cc=gary@garyguo.net \
    --cc=jhubbard@nvidia.com \
    --cc=mcgrof@kernel.org \
    --cc=nova-gpu@lists.linux.dev \
    --cc=ojeda@kernel.org \
    --cc=russ.weight@linux.dev \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=zhiw@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox