[PATCH v3 0/7] Transition Nova Core to TLV firmare images
Timur Tabi <[email protected]>
| Newsgroups | dev.linux.lists.nova-gpu,dev.linux.lists.driver-core,org.kernel.vger.rust-for-linux |
|---|---|
| Message-ID | <[email protected]> |
This patch set transitions nova-core to use the new "TLV" firmware image files, instead of the ones that Nouveau uses. 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. v3: 1) Added test for empty slices in request_into_buf 2) Added [expect(dead_code)] 3) Documented handling of duplicate TLV tags 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 | 344 ++++-------------- 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 | 227 ++++++++++++ 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, 644 insertions(+), 786 deletions(-) create mode 100644 Documentation/gpu/nova/core/tlv.rst create mode 100644 drivers/gpu/nova-core/firmware/tlv.rs base-commit: 24d2581fd911d34f88153af59d3b0d6bc5f07adf -- 2.54.0