Skip to content

Commit f77be04

Browse files
Joel FernandesGnurou
authored andcommitted
gpu: nova-core: gsp: Add support for checking if GSP reloaded
During the sequencer process, we need to check if GSP was successfully reloaded. Add functionality to check for the same. Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Message-ID: <20251114195552.739371-6-joelagnelf@nvidia.com>
1 parent 0f2c8e2 commit f77be04

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

drivers/gpu/nova-core/falcon/gsp.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
// SPDX-License-Identifier: GPL-2.0
22

3+
use kernel::{
4+
io::poll::read_poll_timeout,
5+
prelude::*,
6+
time::Delta, //
7+
};
8+
39
use crate::{
410
driver::Bar0,
511
falcon::{
@@ -37,4 +43,16 @@ impl Falcon<Gsp> {
3743
.set_swgen0(true)
3844
.write(bar, &Gsp::ID);
3945
}
46+
47+
/// Checks if GSP reload/resume has completed during the boot process.
48+
#[expect(dead_code)]
49+
pub(crate) fn check_reload_completed(&self, bar: &Bar0, timeout: Delta) -> Result<bool> {
50+
read_poll_timeout(
51+
|| Ok(regs::NV_PGC6_BSI_SECURE_SCRATCH_14::read(bar)),
52+
|val| val.boot_stage_3_handoff(),
53+
Delta::ZERO,
54+
timeout,
55+
)
56+
.map(|_| true)
57+
}
4058
}

drivers/gpu/nova-core/regs.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ impl NV_PFB_PRI_MMU_WPR2_ADDR_HI {
138138
// These scratch registers remain powered on even in a low-power state and have a designated group
139139
// number.
140140

141+
// Boot Sequence Interface (BSI) register used to determine
142+
// if GSP reload/resume has completed during the boot process.
143+
register!(NV_PGC6_BSI_SECURE_SCRATCH_14 @ 0x001180f8 {
144+
26:26 boot_stage_3_handoff as bool;
145+
});
146+
141147
// Privilege level mask register. It dictates whether the host CPU has privilege to access the
142148
// `PGC6_AON_SECURE_SCRATCH_GROUP_05` register (which it needs to read GFW_BOOT).
143149
register!(NV_PGC6_AON_SECURE_SCRATCH_GROUP_05_PRIV_LEVEL_MASK @ 0x00118128,

0 commit comments

Comments
 (0)