Skip to content

Commit 0133ebf

Browse files
deborahbrouwerDarksonn
authored andcommitted
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>
1 parent aefae41 commit 0133ebf

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

drivers/gpu/drm/tyr/regs.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,3 +1632,25 @@ pub(crate) mod mmu_control {
16321632
}
16331633
}
16341634
}
1635+
1636+
/// This module corresponds to the DOORBELL_BLOCK_n[0-63] register pages.
1637+
pub(crate) mod doorbell_block {
1638+
use kernel::register;
1639+
1640+
/// Number of doorbells available.
1641+
pub(crate) const NUM_DOORBELLS: usize = 64;
1642+
1643+
/// Doorbell block stride (64KiB).
1644+
///
1645+
/// Each block occupies a full page, allowing it to be mapped
1646+
/// separately into a virtual address space.
1647+
const STRIDE: usize = 0x10000;
1648+
1649+
register! {
1650+
/// Doorbell request register. Write-only.
1651+
pub(crate) DOORBELL(u32)[NUM_DOORBELLS, stride = STRIDE] @ 0x80000 {
1652+
/// Doorbell set. Writing 1 triggers the doorbell.
1653+
0:0 ring => bool;
1654+
}
1655+
}
1656+
}

0 commit comments

Comments
 (0)