From: Deborah Brouwer Date: Thu, 9 Apr 2026 17:51:29 +0000 (-0700) Subject: drm/tyr: Add DOORBELL_BLOCK registers X-Git-Tag: v7.2-rc1~141^2~3^2~99 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d9a6809478f9815b6455a327aa001737ac7b2c09;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Deborah Brouwer Link: https://patch.msgid.link/20260409-b4-tyr-use-register-macro-v5-v5-6-8abfff8a0204@collabora.com Signed-off-by: Alice Ryhl --- diff --git a/drivers/gpu/drm/tyr/regs.rs b/drivers/gpu/drm/tyr/regs.rs index 8509093f8f019..562023e5df2f3 100644 --- a/drivers/gpu/drm/tyr/regs.rs +++ b/drivers/gpu/drm/tyr/regs.rs @@ -1632,3 +1632,25 @@ pub(crate) mod mmu_control { } } } + +/// 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; + } + } +}