All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Courbot <acourbot@nvidia.com>
To: Danilo Krummrich <dakr@kernel.org>,
	Alexandre Courbot <acourbot@nvidia.com>,
	Alice Ryhl <aliceryhl@google.com>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>
Cc: Alistair Popple <apopple@nvidia.com>,
	Joel Fernandes <joelagnelf@nvidia.com>,
	Eliot Courtney <ecourtney@nvidia.com>,
	nouveau@lists.freedesktop.org, rust-for-linux@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH v11 05/12] gpu: nova-core: move brom_params and boot_addr to FalconFirmware
Date: Fri, 06 Mar 2026 13:52:42 +0900	[thread overview]
Message-ID: <20260306-turing_prep-v11-5-8f0042c5d026@nvidia.com> (raw)
In-Reply-To: <20260306-turing_prep-v11-0-8f0042c5d026@nvidia.com>

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>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
 drivers/gpu/nova-core/falcon.rs          | 12 ++++++------
 drivers/gpu/nova-core/firmware/booter.rs |  8 ++++----
 drivers/gpu/nova-core/firmware/fwsec.rs  |  8 ++++----
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/nova-core/falcon.rs b/drivers/gpu/nova-core/falcon.rs
index 450431804e1c..c90664efb0c5 100644
--- a/drivers/gpu/nova-core/falcon.rs
+++ b/drivers/gpu/nova-core/falcon.rs
@@ -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.
diff --git a/drivers/gpu/nova-core/firmware/booter.rs b/drivers/gpu/nova-core/firmware/booter.rs
index c5963f79a08e..2dccbdd1b558 100644
--- a/drivers/gpu/nova-core/firmware/booter.rs
+++ b/drivers/gpu/nova-core/firmware/booter.rs
@@ -414,6 +414,10 @@ fn imem_ns_load_params(&self) -> Option<FalconDmaLoadTarget> {
     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 @@ fn boot_addr(&self) -> u32 {
         }
     }
 }
-
-impl FalconFirmware for BooterFirmware {
-    type Target = Sec2;
-}
diff --git a/drivers/gpu/nova-core/firmware/fwsec.rs b/drivers/gpu/nova-core/firmware/fwsec.rs
index d5bb7d279fa7..87495d1d6cac 100644
--- a/drivers/gpu/nova-core/firmware/fwsec.rs
+++ b/drivers/gpu/nova-core/firmware/fwsec.rs
@@ -196,6 +196,10 @@ fn imem_ns_load_params(&self) -> Option<FalconDmaLoadTarget> {
     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 @@ fn boot_addr(&self) -> u32 {
     }
 }
 
-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()?;

-- 
2.53.0


WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Courbot <acourbot@nvidia.com>
To: Danilo Krummrich <dakr@kernel.org>,
	 Alexandre Courbot <acourbot@nvidia.com>,
	Alice Ryhl <aliceryhl@google.com>,
	 David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>
Cc: John Hubbard <jhubbard@nvidia.com>,
	 Alistair Popple <apopple@nvidia.com>,
	 Joel Fernandes <joelagnelf@nvidia.com>,
	Timur Tabi <ttabi@nvidia.com>,  Edwin Peer <epeer@nvidia.com>,
	Eliot Courtney <ecourtney@nvidia.com>,
	 nouveau@lists.freedesktop.org, rust-for-linux@vger.kernel.org,
	 dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH v11 05/12] gpu: nova-core: move brom_params and boot_addr to FalconFirmware
Date: Fri, 06 Mar 2026 13:52:42 +0900	[thread overview]
Message-ID: <20260306-turing_prep-v11-5-8f0042c5d026@nvidia.com> (raw)
In-Reply-To: <20260306-turing_prep-v11-0-8f0042c5d026@nvidia.com>

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>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
 drivers/gpu/nova-core/falcon.rs          | 12 ++++++------
 drivers/gpu/nova-core/firmware/booter.rs |  8 ++++----
 drivers/gpu/nova-core/firmware/fwsec.rs  |  8 ++++----
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/nova-core/falcon.rs b/drivers/gpu/nova-core/falcon.rs
index 450431804e1c..c90664efb0c5 100644
--- a/drivers/gpu/nova-core/falcon.rs
+++ b/drivers/gpu/nova-core/falcon.rs
@@ -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.
diff --git a/drivers/gpu/nova-core/firmware/booter.rs b/drivers/gpu/nova-core/firmware/booter.rs
index c5963f79a08e..2dccbdd1b558 100644
--- a/drivers/gpu/nova-core/firmware/booter.rs
+++ b/drivers/gpu/nova-core/firmware/booter.rs
@@ -414,6 +414,10 @@ fn imem_ns_load_params(&self) -> Option<FalconDmaLoadTarget> {
     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 @@ fn boot_addr(&self) -> u32 {
         }
     }
 }
-
-impl FalconFirmware for BooterFirmware {
-    type Target = Sec2;
-}
diff --git a/drivers/gpu/nova-core/firmware/fwsec.rs b/drivers/gpu/nova-core/firmware/fwsec.rs
index d5bb7d279fa7..87495d1d6cac 100644
--- a/drivers/gpu/nova-core/firmware/fwsec.rs
+++ b/drivers/gpu/nova-core/firmware/fwsec.rs
@@ -196,6 +196,10 @@ fn imem_ns_load_params(&self) -> Option<FalconDmaLoadTarget> {
     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 @@ fn boot_addr(&self) -> u32 {
     }
 }
 
-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()?;

-- 
2.53.0


  parent reply	other threads:[~2026-03-06  4:53 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06  4:52 [PATCH v11 00/12] gpu: nova-core: add Turing support Alexandre Courbot
2026-03-06  4:52 ` Alexandre Courbot
2026-03-06  4:52 ` [PATCH v11 01/12] gpu: nova-core: create falcon firmware DMA objects lazily Alexandre Courbot
2026-03-06  4:52   ` Alexandre Courbot
2026-03-06  4:52 ` [PATCH v11 02/12] gpu: nova-core: falcon: add constant for memory block alignment Alexandre Courbot
2026-03-06  4:52   ` Alexandre Courbot
2026-03-06  4:52 ` [PATCH v11 03/12] gpu: nova-core: falcon: rename load parameters to reflect DMA dependency Alexandre Courbot
2026-03-06  4:52   ` Alexandre Courbot
2026-03-06  6:23   ` Eliot Courtney
2026-03-06  6:23     ` Eliot Courtney
2026-03-06  4:52 ` [PATCH v11 04/12] gpu: nova-core: falcon: remove FalconFirmware's dependency on FalconDmaLoadable Alexandre Courbot
2026-03-06  4:52   ` Alexandre Courbot
2026-03-06  4:52 ` Alexandre Courbot [this message]
2026-03-06  4:52   ` [PATCH v11 05/12] gpu: nova-core: move brom_params and boot_addr to FalconFirmware Alexandre Courbot
2026-03-06  4:52 ` [PATCH v11 06/12] gpu: nova-core: add PIO support for loading firmware images Alexandre Courbot
2026-03-06  4:52   ` Alexandre Courbot
2026-03-06  4:52 ` [PATCH v11 07/12] gpu: nova-core: falcon: remove unwarranted safety check in dma_load Alexandre Courbot
2026-03-06  4:52   ` Alexandre Courbot
2026-03-06  4:52 ` [PATCH v11 08/12] gpu: nova-core: firmware: add comments to justify v3 header values Alexandre Courbot
2026-03-06  4:52   ` Alexandre Courbot
2026-03-09  4:54   ` Eliot Courtney
2026-03-09  4:54     ` Eliot Courtney
2026-03-06  4:52 ` [PATCH v11 09/12] gpu: nova-core: firmware: fix and explain v2 header offsets computations Alexandre Courbot
2026-03-06  4:52   ` Alexandre Courbot
2026-03-09  4:55   ` Eliot Courtney
2026-03-09  4:55     ` Eliot Courtney
2026-03-09 12:10   ` Gary Guo
2026-03-09 12:10     ` Gary Guo
2026-03-10  1:49     ` Alexandre Courbot
2026-03-10  1:49       ` Alexandre Courbot
2026-03-06  4:52 ` [PATCH v11 10/12] gpu: nova-core: make Chipset::arch() const Alexandre Courbot
2026-03-06  4:52   ` Alexandre Courbot
2026-03-06  4:52 ` [PATCH v11 11/12] gpu: nova-core: add gen_bootloader firmware to ModInfoBuilder Alexandre Courbot
2026-03-06  4:52   ` Alexandre Courbot
2026-03-06  4:52 ` [PATCH v11 12/12] gpu: nova-core: use the Generic Bootloader to boot FWSEC on Turing Alexandre Courbot
2026-03-06  4:52   ` Alexandre Courbot
2026-03-09  5:07   ` Eliot Courtney
2026-03-09  5:07     ` Eliot Courtney
2026-03-09  1:52 ` [PATCH v11 00/12] gpu: nova-core: add Turing support Alexandre Courbot
2026-03-09  1:52   ` Alexandre Courbot
2026-03-09  2:06   ` John Hubbard
2026-03-09  2:06     ` John Hubbard
2026-03-09  2:20     ` Alexandre Courbot
2026-03-09  2:20       ` Alexandre Courbot
2026-03-09 19:48 ` Ewan Chorynski
2026-03-09 19:48   ` Ewan Chorynski
2026-03-09 20:04   ` John Hubbard
2026-03-09 20:04     ` John Hubbard
2026-03-09 20:18     ` Timur Tabi
2026-03-09 20:18       ` Timur Tabi
2026-03-09 20:29       ` John Hubbard
2026-03-09 20:29         ` John Hubbard
2026-03-09 20:39         ` Timur Tabi
2026-03-09 20:39           ` Timur Tabi
2026-03-09 21:00         ` Ewan Chorynski
2026-03-09 21:00           ` Ewan Chorynski
2026-03-09 21:05           ` Timur Tabi
2026-03-09 21:05             ` Timur Tabi
2026-03-09 21:16             ` Ewan Chorynski
2026-03-09 21:16               ` Ewan Chorynski
2026-03-09 21:22               ` Timur Tabi
2026-03-09 21:22                 ` 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=20260306-turing_prep-v11-5-8f0042c5d026@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=apopple@nvidia.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ecourtney@nvidia.com \
    --cc=joelagnelf@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.