]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gpu: nova-core: move brom_params and boot_addr to FalconFirmware
authorAlexandre Courbot <acourbot@nvidia.com>
Fri, 6 Mar 2026 04:52:42 +0000 (13:52 +0900)
committerAlexandre Courbot <acourbot@nvidia.com>
Mon, 9 Mar 2026 01:35:40 +0000 (10:35 +0900)
These methods are relevant no matter the loading method used, thus move
them to the common `FalconFirmware` trait.

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

index 450431804e1c4c88f354007ab78d3db427fbc923..c90664efb0c5802d493e7da9ea32bf9f63984bb0 100644 (file)
@@ -367,12 +367,6 @@ pub(crate) trait FalconDmaLoadable {
 
     /// Returns the load parameters for `DMEM`.
     fn dmem_load_params(&self) -> FalconDmaLoadTarget;
-
-    /// Returns the parameters to write into the BROM registers.
-    fn brom_params(&self) -> FalconBromParams;
-
-    /// Returns the start address of the firmware.
-    fn boot_addr(&self) -> u32;
 }
 
 /// Trait for a falcon firmware.
@@ -381,6 +375,12 @@ pub(crate) trait FalconDmaLoadable {
 pub(crate) trait FalconFirmware {
     /// Engine on which this firmware is to be loaded.
     type Target: FalconEngine;
+
+    /// Returns the parameters to write into the BROM registers.
+    fn brom_params(&self) -> FalconBromParams;
+
+    /// Returns the start address of the firmware.
+    fn boot_addr(&self) -> u32;
 }
 
 /// Contains the base parameters common to all Falcon instances.
index 97b2776db5a36ead4b6c82e10ca2631d9982e034..de2a4536b5320acd6395c7fc896456b3a74b26bf 100644 (file)
@@ -414,6 +414,10 @@ impl FalconDmaLoadable for BooterFirmware {
     fn dmem_load_params(&self) -> FalconDmaLoadTarget {
         self.dmem_load_target.clone()
     }
+}
+
+impl FalconFirmware for BooterFirmware {
+    type Target = Sec2;
 
     fn brom_params(&self) -> FalconBromParams {
         self.brom_params.clone()
@@ -427,7 +431,3 @@ impl FalconDmaLoadable for BooterFirmware {
         }
     }
 }
-
-impl FalconFirmware for BooterFirmware {
-    type Target = Sec2;
-}
index 7ac5cfeb594d4b619efc44bf21fa810b992d9dbb..ca51d7c5be134e75068c5fc88e2e728da0bb4d7d 100644 (file)
@@ -196,6 +196,10 @@ impl FalconDmaLoadable for FwsecFirmware {
     fn dmem_load_params(&self) -> FalconDmaLoadTarget {
         self.desc.dmem_load_params()
     }
+}
+
+impl FalconFirmware for FwsecFirmware {
+    type Target = Gsp;
 
     fn brom_params(&self) -> FalconBromParams {
         FalconBromParams {
@@ -210,10 +214,6 @@ impl FalconDmaLoadable for FwsecFirmware {
     }
 }
 
-impl FalconFirmware for FwsecFirmware {
-    type Target = Gsp;
-}
-
 impl FirmwareObject<FwsecFirmware, Unsigned> {
     fn new_fwsec(bios: &Vbios, cmd: FwsecCommand) -> Result<Self> {
         let desc = bios.fwsec_image().header()?;