drm/tyr: Add DOORBELL_BLOCK registers

DOORBELL_BLOCK_n[0-63] is an array of GPU control register pages.
Each block is memory-mappable and contains a single DOORBELL register
used to trigger actions in the GPU.

Add definitions for the DOORBELL_BLOCK registers using the register! macro
so they can be used by future Tyr interfaces.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Link: https://patch.msgid.link/20260409-b4-tyr-use-register-macro-v5-v5-6-8abfff8a0204@collabora.com
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
This commit is contained in:
Deborah Brouwer 2026-04-09 10:51:29 -07:00 committed by Alice Ryhl
parent 4cae5d9b3a
commit d9a6809478

View File

@ -1632,3 +1632,25 @@ fn from(sh: PtwShareability) -> Self {
}
}
}
/// This module corresponds to the DOORBELL_BLOCK_n[0-63] register pages.
pub(crate) mod doorbell_block {
use kernel::register;
/// Number of doorbells available.
pub(crate) const NUM_DOORBELLS: usize = 64;
/// Doorbell block stride (64KiB).
///
/// Each block occupies a full page, allowing it to be mapped
/// separately into a virtual address space.
const STRIDE: usize = 0x10000;
register! {
/// Doorbell request register. Write-only.
pub(crate) DOORBELL(u32)[NUM_DOORBELLS, stride = STRIDE] @ 0x80000 {
/// Doorbell set. Writing 1 triggers the doorbell.
0:0 ring => bool;
}
}
}