xref: /linux/drivers/gpu/nova-core/fsp/hal.rs (revision 82eaa14e7efcbb3933083b4c27fd5496fbb1a4be)
1 // SPDX-License-Identifier: GPL-2.0
2 // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 
4 use crate::{
5     driver::Bar0,
6     gpu::{
7         Architecture,
8         Chipset, //
9     },
10 };
11 
12 mod gb202;
13 mod gh100;
14 
15 pub(super) trait FspHal {
16     /// Returns the secure boot status from the architecture-specific `NV_THERM_I2CS_SCRATCH` register.
17     fn fsp_boot_status(&self, bar: &Bar0) -> u32;
18 }
19 
20 /// Returns the FSP HAL, or `None` if the architecture doesn't support FSP.
21 pub(super) fn fsp_hal(chipset: Chipset) -> Option<&'static dyn FspHal> {
22     match chipset.arch() {
23         Architecture::Turing | Architecture::Ampere | Architecture::Ada => None,
24         Architecture::Hopper | Architecture::BlackwellGB10x => Some(gh100::GH100_HAL),
25         Architecture::BlackwellGB20x => Some(gb202::GB202_HAL),
26     }
27 }
28