xref: /linux/drivers/gpu/nova-core/falcon/gsp.rs (revision 260f6f4fda93c8485c8037865c941b42b9cba5d2)
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