mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
gpu: nova-core: factor .fwsignature* selection into a new find_gsp_sigs_section()
Keep Gsp::new() from getting too cluttered, by factoring out the selection of .fwsignature* items. This will continue to grow as we add GPUs. Signed-off-by: John Hubbard <jhubbard@nvidia.com> Reviewed-by: Gary Guo <gary@garyguo.net> Acked-by: Danilo Krummrich <dakr@kernel.org> Link: https://patch.msgid.link/20260411024953.473149-2-jhubbard@nvidia.com [acourbot: fix minor conflict.] Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
This commit is contained in:
parent
013ff3b4d0
commit
777123bf2b
|
|
@ -63,6 +63,18 @@ pub(crate) struct GspFirmware {
|
|||
}
|
||||
|
||||
impl GspFirmware {
|
||||
fn find_gsp_sigs_section(chipset: Chipset) -> &'static str {
|
||||
match chipset.arch() {
|
||||
Architecture::Turing if matches!(chipset, Chipset::TU116 | Chipset::TU117) => {
|
||||
".fwsignature_tu11x"
|
||||
}
|
||||
Architecture::Turing => ".fwsignature_tu10x",
|
||||
Architecture::Ampere if chipset == Chipset::GA100 => ".fwsignature_ga100",
|
||||
Architecture::Ampere => ".fwsignature_ga10x",
|
||||
Architecture::Ada => ".fwsignature_ad10x",
|
||||
}
|
||||
}
|
||||
|
||||
/// Loads the GSP firmware binaries, map them into `dev`'s address-space, and creates the page
|
||||
/// tables expected by the GSP bootloader to load it.
|
||||
pub(crate) fn new<'a>(
|
||||
|
|
@ -131,17 +143,7 @@ pub(crate) fn new<'a>(
|
|||
},
|
||||
size,
|
||||
signatures: {
|
||||
let sigs_section = match chipset.arch() {
|
||||
Architecture::Turing
|
||||
if matches!(chipset, Chipset::TU116 | Chipset::TU117) =>
|
||||
{
|
||||
".fwsignature_tu11x"
|
||||
}
|
||||
Architecture::Turing => ".fwsignature_tu10x",
|
||||
Architecture::Ampere if chipset == Chipset::GA100 => ".fwsignature_ga100",
|
||||
Architecture::Ampere => ".fwsignature_ga10x",
|
||||
Architecture::Ada => ".fwsignature_ad10x",
|
||||
};
|
||||
let sigs_section = Self::find_gsp_sigs_section(chipset);
|
||||
|
||||
elf::elf64_section(firmware.data(), sigs_section)
|
||||
.ok_or(EINVAL)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user