xref: /linux/drivers/gpu/nova-core/falcon/gsp.rs (revision 22c55fb9eb92395d999b8404d73e58540d11bdd8)
1 // SPDX-License-Identifier: GPL-2.0
2 
3 use crate::{
4     driver::Bar0,
5     falcon::{Falcon, FalconEngine},
6     regs,
7 };
8 
9 /// Type specifying the `Gsp` falcon engine. Cannot be instantiated.
10 pub(crate) struct Gsp(());
11 
12 impl FalconEngine for Gsp {
13     const BASE: usize = 0x00110000;
14 }
15 
16 impl Falcon<Gsp> {
17     /// Clears the SWGEN0 bit in the Falcon's IRQ status clear register to
18     /// allow GSP to signal CPU for processing new messages in message queue.
19     pub(crate) fn clear_swgen0_intr(&self, bar: &Bar0) {
20         regs::NV_PFALCON_FALCON_IRQSCLR::default()
21             .set_swgen0(true)
22             .write(bar, Gsp::BASE);
23     }
24 }
25