Skip to content

Commit a65fc53

Browse files
ttabiGnurou
authored andcommitted
gpu: nova-core: support header parsing on Turing/GA100
The Turing/GA100 version of Booter is slightly different from the GA102+ version. The headers are the same, but different fields of the headers are used to identify the IMEM section. In addition, there is an NMEM section on Turing/GA100. Signed-off-by: Timur Tabi <ttabi@nvidia.com> Reviewed-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/20260122222848.2555890-4-ttabi@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
1 parent b72cb7b commit a65fc53

1 file changed

Lines changed: 24 additions & 4 deletions

File tree

drivers/gpu/nova-core/firmware/booter.rs

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,14 +356,30 @@ impl BooterFirmware {
356356
}
357357
};
358358

359+
// There are two versions of Booter, one for Turing/GA100, and another for
360+
// GA102+. The extraction of the IMEM sections differs between the two
361+
// versions. Unfortunately, the file names are the same, and the headers
362+
// don't indicate the versions. The only way to differentiate is by the Chipset.
363+
let (imem_sec_dst_start, imem_ns_load_target) = if chipset <= Chipset::GA100 {
364+
(
365+
app0.offset,
366+
Some(FalconLoadTarget {
367+
src_start: 0,
368+
dst_start: load_hdr.os_code_offset,
369+
len: load_hdr.os_code_size,
370+
}),
371+
)
372+
} else {
373+
(0, None)
374+
};
375+
359376
Ok(Self {
360377
imem_sec_load_target: FalconLoadTarget {
361378
src_start: app0.offset,
362-
dst_start: 0,
379+
dst_start: imem_sec_dst_start,
363380
len: app0.len,
364381
},
365-
// Exists only in the booter image for Turing and GA100
366-
imem_ns_load_target: None,
382+
imem_ns_load_target,
367383
dmem_load_target: FalconLoadTarget {
368384
src_start: load_hdr.os_data_offset,
369385
dst_start: 0,
@@ -393,7 +409,11 @@ impl FalconLoadParams for BooterFirmware {
393409
}
394410

395411
fn boot_addr(&self) -> u32 {
396-
self.imem_sec_load_target.src_start
412+
if let Some(ns_target) = &self.imem_ns_load_target {
413+
ns_target.dst_start
414+
} else {
415+
self.imem_sec_load_target.src_start
416+
}
397417
}
398418
}
399419

0 commit comments

Comments
 (0)