summaryrefslogtreecommitdiff
path: root/drivers/gpu/nova-core/irq/hal/gh100.rs
blob: 6e307c8d120b1f0c7e3db6ffc9a752350c147138 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-License-Identifier: GPL-2.0
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.

use crate::driver::Bar0;

use super::{
    cycle_top_enables,
    CpuInterruptHal,
    LeafCount,
    MsiType,
    Subtree,
    SubtreeSet, //
};

/// The CPU interrupt tree properties of Hopper and Blackwell.
struct Gh100;

impl CpuInterruptHal for Gh100 {
    fn leaf_count(&self) -> LeafCount {
        LeafCount::Sixteen
    }

    fn rearm_pci_irq(
        &self,
        bar: Bar0<'_>,
        msi_type: MsiType,
        serviced: SubtreeSet,
        subtree: Subtree,
    ) {
        let subtrees = match msi_type {
            MsiType::Msi => serviced,
            MsiType::MsiX => subtree.into(),
        };

        cycle_top_enables(bar, subtrees);
    }
}

const GH100: Gh100 = Gh100;
pub(super) const GH100_HAL: &dyn CpuInterruptHal = &GH100;