[PATCH 2/3] gpu: nova-core: add Architecture::uses_sec2() helper

From: Eliot Courtney

Date: Thu Apr 09 2026 - 10:20:46 EST


This will be used in the following patch as common logic.

Signed-off-by: Eliot Courtney <ecourtney@xxxxxxxxxx>
---
drivers/gpu/nova-core/gpu.rs | 7 +++++++
drivers/gpu/nova-core/gsp/boot.rs | 5 +----
2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs
index 2bcaa7bc5125..674dc286162a 100644
--- a/drivers/gpu/nova-core/gpu.rs
+++ b/drivers/gpu/nova-core/gpu.rs
@@ -180,6 +180,13 @@ pub(crate) enum Architecture with TryFrom<Bounded<u32, 6>> {
}

impl Architecture {
+ /// Returns `true` if this architecture uses SEC2 to boot GSP.
+ ///
+ /// Turing/Ampere/Ada use FWSEC + SEC2 booter firmware. Hopper and later use FSP instead.
+ pub(crate) const fn uses_sec2(&self) -> bool {
+ matches!(self, Self::Turing | Self::Ampere | Self::Ada)
+ }
+
/// Returns the DMA mask supported by this architecture.
pub(crate) const fn dma_mask(&self) -> DmaMask {
match self {
diff --git a/drivers/gpu/nova-core/gsp/boot.rs b/drivers/gpu/nova-core/gsp/boot.rs
index e6d8b848ec46..1aac634c3b67 100644
--- a/drivers/gpu/nova-core/gsp/boot.rs
+++ b/drivers/gpu/nova-core/gsp/boot.rs
@@ -332,10 +332,7 @@ pub(crate) fn boot(
sec2_falcon: &Falcon<Sec2>,
) -> Result {
let dev = pdev.as_ref();
- let uses_sec2 = matches!(
- chipset.arch(),
- Architecture::Turing | Architecture::Ampere | Architecture::Ada
- );
+ let uses_sec2 = chipset.arch().uses_sec2();

let gsp_fw = KBox::pin_init(GspFirmware::new(dev, chipset, FIRMWARE_VERSION), GFP_KERNEL)?;


--
2.53.0