]> Gentwo Git Trees - linux/.git/commitdiff
gpu: nova-core: falcon: Add support to check if RISC-V is active
authorJoel Fernandes <joelagnelf@nvidia.com>
Mon, 10 Nov 2025 13:34:21 +0000 (22:34 +0900)
committerAlexandre Courbot <acourbot@nvidia.com>
Fri, 14 Nov 2025 11:25:57 +0000 (20:25 +0900)
Add definition for RISCV_CPUCTL register and use it in a new falcon API
to check if the RISC-V core of a Falcon is active. It is required by
the sequencer to know if the GSP's RISCV processor is active.

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: <20251110-gsp_boot-v9-13-8ae4058e3c0e@nvidia.com>

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

index fe5b3256d97254ef1a441fa0d38eada416196691..4c1f36073533a6888fd449e93e1da5caffc079ac 100644 (file)
@@ -612,4 +612,13 @@ pub(crate) fn signature_reg_fuse_version(
         self.hal
             .signature_reg_fuse_version(self, bar, engine_id_mask, ucode_id)
     }
+
+    /// Check if the RISC-V core is active.
+    ///
+    /// Returns `true` if the RISC-V core is active, `false` otherwise.
+    #[expect(unused)]
+    pub(crate) fn is_riscv_active(&self, bar: &Bar0) -> bool {
+        let cpuctl = regs::NV_PRISCV_RISCV_CPUCTL::read(bar, &E::ID);
+        cpuctl.active_stat()
+    }
 }
index 41fdda8a07481e2aac157c35b0d163edbb692a0f..5d5ba766cd61085ceb6d137ad13e7539fc8e7574 100644 (file)
@@ -339,7 +339,12 @@ pub(crate) fn mem_scrubbing_done(self) -> bool {
 
 // PRISCV
 
-register!(NV_PRISCV_RISCV_BCR_CTRL @ PFalconBase[0x00001668] {
+register!(NV_PRISCV_RISCV_CPUCTL @ PFalcon2Base[0x00000388] {
+    0:0     halted as bool;
+    7:7     active_stat as bool;
+});
+
+register!(NV_PRISCV_RISCV_BCR_CTRL @ PFalcon2Base[0x00000668] {
     0:0     valid as bool;
     4:4     core_select as bool => PeregrineCoreSelect;
     8:8     br_fetch as bool;