Skip to contentSkip to conversation

dt-bindings: hwlock: st,stm32-hwspinlock: add mailbox cells and interrupt

PATCH New Gerard Marull-Paretas 2 participants 2 messages Nov 25

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: hwlock: st,stm32-hwspinlock: add mailbox cells and interrupt

Besides locking, releasing a hardware semaphore raises the interrupt of each core that enabled it for that semaphore. On multi-core parts without an IPCC, such as the STM32H745/H747/H755/H757 (Cortex-M7 and Cortex-M4), this is how the cores signal each other, each semaphore serving as a doorbell.

Allow '#mbox-cells', its cell being the semaphore, and the interrupt of the semaphores. Each core has an interrupt of its own (HSEM1 for the Cortex-M7, HSEM2 for the Cortex-M4 on STM32H747), so a description gives the one of the CPU it is for.

PebbleOS, whose STM32H747 port uses the semaphores as doorbells between its two cores, describes and uses these.

---
 .../bindings/hwlock/st,stm32-hwspinlock.yaml       | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
Documentation/devicetree/bindings/hwlock/st,stm32-hwspinlock.yaml +14 -0
index 829d1fdf4c67..3b8d872b7c21 100644
@@ -9,16 +9,30 @@ title: STMicroelectronics STM32 Hardware Spinlock
 maintainers:
   - Fabien Dessenne <[email protected]>
 
+description: |
+  Hardware semaphores, which also ring doorbells between the cores of a
+  multi-core part: releasing a semaphore raises the interrupt of each core
+  that enabled it, and the core taking the doorbell clears it in its
+  interrupt status.
+
 properties:
   "#hwlock-cells":
     const: 1
 
+  "#mbox-cells":
+    const: 1
+    description: The semaphore ringing the doorbell.
+
   compatible:
     const: st,stm32-hwspinlock
 
   reg:
     maxItems: 1
 
+  interrupts:
+    maxItems: 1
+    description: The interrupt of the semaphores for the CPU the description is for.
+
   clocks:
     maxItems: 1
 
Signature · 1 line
2.45.2
#1 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] dt-bindings: hwlock: interrupts placed before clocks in properties --

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] dt-bindings: hwlock: interrupts placed before clocks in properties
--

commit 94e93b8064cef375edbe40c9efd2a2628ce5d7ac
Author: Gerard Marull-Paretas <[email protected]>

dt-bindings: hwlock: st,stm32-hwspinlock: add mailbox cells and interrupt

This commit adds the #mbox-cells and interrupts properties to the st,stm32-hwspinlock DT binding schema so hardware semaphores can be described as inter-core doorbells.

Quoted 24 lines
Documentation/devicetree/bindings/hwlock/st,stm32-hwspinlock.yaml +10 -0
index 829d1fdf4c674..3b8d872b7c21d 100644
@@ -9,16 +9,30 @@ title: STMicroelectronics STM32 Hardware Spinlock
 maintainers:
   - Fabien Dessenne <[email protected]>
 
+description: |
+  Hardware semaphores, which also ring doorbells between the cores of a
+  multi-core part: releasing a semaphore raises the interrupt of each core
+  that enabled it, and the core taking the doorbell clears it in its
+  interrupt status.
+
 properties:
   "#hwlock-cells":
     const: 1
 
+  "#mbox-cells":
+    const: 1
+    description: The semaphore ringing the doorbell.
+
   compatible:
     const: st,stm32-hwspinlock

Documentation/devicetree/bindings/hwlock/st,stm32-hwspinlock.yaml title: STMicroelectronics STM32 Hardware Spinlock · line 37

Quoted 10 lines
Documentation/devicetree/bindings/hwlock/st,stm32-hwspinlock.yaml +4 -0
 
   reg:
     maxItems: 1
 
+  interrupts:
+    maxItems: 1
+    description: The interrupt of the semaphores for the CPU the description is for.
+
   clocks:
     maxItems: 1

[Severity: Low]
Should interrupts be placed after clock-names to follow the canonical DT binding property order (compatible, reg, clocks, clock-names, interrupts)?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1