]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/tyr: Add DOORBELL_BLOCK registers
authorDeborah Brouwer <deborah.brouwer@collabora.com>
Thu, 9 Apr 2026 17:51:29 +0000 (10:51 -0700)
committerAlice Ryhl <aliceryhl@google.com>
Mon, 27 Apr 2026 18:43:05 +0000 (18:43 +0000)
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>
drivers/gpu/drm/tyr/regs.rs

index 8509093f8f019de4220109d25cbc1a96f7028c6b..562023e5df2f36d00c2e2c0bd621cfdae8d0987d 100644 (file)
@@ -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;
+        }
+    }
+}