xref: /linux/drivers/gpu/nova-core/falcon/sec2.rs (revision 5b193d6a8973655f19de87a7873ce31dee2d5fe6)
1 // SPDX-License-Identifier: GPL-2.0
2 
3 use kernel::io::{
4     io_project,
5     register,
6     Mmio, //
7 };
8 
9 use crate::{
10     driver::{
11         Bar0,
12         NovaRegisters, //
13     },
14     falcon::FalconEngine, //
15 };
16 
17 /// Type specifying the `Sec2` falcon engine. Cannot be instantiated.
18 pub(crate) struct Sec2(());
19 
20 register! {
21     base: NovaRegisters;
22 
23     PFALCON: super::PFalconRegisters @ 0x00840000;
24     PFALCON2: super::PFalcon2Registers @ 0x00841000;
25 }
26 
27 impl FalconEngine for Sec2 {
28     #[inline]
29     fn pfalcon(io: Bar0<'_>) -> Mmio<'_, super::PFalconRegisters> {
30         io_project!(io, build: PFALCON)
31     }
32 
33     #[inline]
34     fn pfalcon2(io: Bar0<'_>) -> Mmio<'_, super::PFalcon2Registers> {
35         io_project!(io, build: PFALCON2)
36     }
37 }
38