]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpu: nova-core: add gen_bootloader firmware to ModInfoBuilder
authorAlexandre Courbot <acourbot@nvidia.com>
Fri, 6 Mar 2026 04:52:48 +0000 (13:52 +0900)
committerAlexandre Courbot <acourbot@nvidia.com>
Mon, 9 Mar 2026 01:39:10 +0000 (10:39 +0900)
Turing GPUs need an additional firmware file (the FWSEC generic
bootloader) in order to initialize. Add it to `ModInfoBuilder`.

Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patch.msgid.link/20260306-turing_prep-v11-11-8f0042c5d026@nvidia.com
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
drivers/gpu/nova-core/firmware.rs
drivers/gpu/nova-core/gpu.rs

index 6d874753fe67bc49a163890eaa82324a365aa99e..5eaa63ee3dfc4c726109d0128a930db88c07ad2a 100644 (file)
@@ -417,11 +417,20 @@ impl<const N: usize> ModInfoBuilder<N> {
         )
     }
 
-    const fn make_entry_chipset(self, chipset: &str) -> Self {
-        self.make_entry_file(chipset, "booter_load")
-            .make_entry_file(chipset, "booter_unload")
-            .make_entry_file(chipset, "bootloader")
-            .make_entry_file(chipset, "gsp")
+    const fn make_entry_chipset(self, chipset: gpu::Chipset) -> Self {
+        let name = chipset.name();
+
+        let this = self
+            .make_entry_file(name, "booter_load")
+            .make_entry_file(name, "booter_unload")
+            .make_entry_file(name, "bootloader")
+            .make_entry_file(name, "gsp");
+
+        if chipset.needs_fwsec_bootloader() {
+            this.make_entry_file(name, "gen_bootloader")
+        } else {
+            this
+        }
     }
 
     pub(crate) const fn create(
@@ -431,7 +440,7 @@ impl<const N: usize> ModInfoBuilder<N> {
         let mut i = 0;
 
         while i < gpu::Chipset::ALL.len() {
-            this = this.make_entry_chipset(gpu::Chipset::ALL[i].name());
+            this = this.make_entry_chipset(gpu::Chipset::ALL[i]);
             i += 1;
         }
 
index c14d411c67590200c0ba709e0dc0866fc80a3917..8579d632e717dd0f13de28ce47cf71aed68b9621 100644 (file)
@@ -105,6 +105,13 @@ impl Chipset {
             }
         }
     }
+
+    /// Returns `true` if this chipset requires the PIO-loaded bootloader in order to boot FWSEC.
+    ///
+    /// This includes all chipsets < GA102.
+    pub(crate) const fn needs_fwsec_bootloader(self) -> bool {
+        matches!(self.arch(), Architecture::Turing) || matches!(self, Self::GA100)
+    }
 }
 
 // TODO