Add support of STM32 hwspinlock
Subsystems (3)
v2 cover Add support of STM32 hwspinlock
This serie adds the support of the hardware semaphore block for stm32mp1 SoC.
version 2:
- fix comments done by Bjorn about clock naming, license terms in header, alphabetic ordering in Makefile and Kconfig and remove function
- Do not push test module in this version while waiting for feedbacks about it
Benjamin Gaignard (4):
dt-bindings: hwlock: Document STM32 hwspinlock bindings
hwspinlock: add STM32 hwspinlock device
ARM: dts: stm32: Add hwspinlock node for stm32mp157 SoC
ARM: dts: stm32: enable hwspinlock on stm32mp157c-ed1
.../bindings/hwlock/st,stm32-hwspinlock.txt | 23 ++++ arch/arm/boot/dts/stm32mp157c-ed1.dts | 4 + arch/arm/boot/dts/stm32mp157c.dtsi | 9 ++ drivers/hwspinlock/Kconfig | 9 ++ drivers/hwspinlock/Makefile | 1 + drivers/hwspinlock/stm32_hwspinlock.c | 144 +++++++++++++++++++++ 6 files changed, 190 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwlock/st,stm32-hwspinlock.txt create mode 100644 drivers/hwspinlock/stm32_hwspinlock.c
Signature · 1 line
2.15.0
PATCH v2 1/4 dt-bindings: hwlock: Document STM32 hwspinlock bindings
Add bindings for STM32 hardware spinlock device
---
version 2 :
- change clock name from hwspinlock to hsem to be align with hardware documentation
.../bindings/hwlock/st,stm32-hwspinlock.txt | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwlock/st,stm32-hwspinlock.txt
Documentation/devicetree/bindings/hwlock/st,stm32-hwspinlock.txt new file +23 -0
@@ -0,0 +1,23 @@ +STM32 Hardware Spinlock Device Binding +------------------------------------- + +Required properties : +- compatible : should be "st,stm32-hwspinlock". +- reg : the register address of hwspinlock. +- #hwlock-cells : hwlock users only use the hwlock id to represent a specific + hwlock, so the number of cells should be <1> here. +- clock-names : Must contain "hwspinlock". +- clocks : Must contain a phandle entry for the clock in clock-names, see the + common clock bindings. + +Please look at the generic hwlock binding for usage information for consumers, +"Documentation/devicetree/bindings/hwlock/hwlock.txt" + +Example of hwlock provider: + hwspinlock at 4c000000 { + compatible = "st,stm32-hwspinlock"; + #hwlock-cells = <1>; + reg = <0x4c000000 0x400>; + clocks = <&rcc HSEM>; + clock-names = "hsem"; + };
Signature · 1 line
2.15.0
Re: [PATCH v2 1/4] dt-bindings: hwlock: Document STM32 hwspinlock bindings
Hi Benjamin
Quoted 18 lines · Benjamin Gaignard
Add bindings for STM32 hardware spinlock device
Signed-off-by Benjamin Gaignard <[email protected]>---
version 2 :
- change clock name from hwspinlock to hsem to be align with hardware documentation.../bindings/hwlock/st,stm32-hwspinlock.txt | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+)create mode 100644
Documentation/devicetree/bindings/hwlock/st,stm32-hwspinlock.txtDocumentation/devicetree/bindings/hwlock/st,stm32-hwspinlock.txt new file +0
-0
Documentation/devicetree/bindings/hwlock/st,stm32-hwspinlock.txt line 9
Quoted 9 lines
Documentation/devicetree/bindings/hwlock/st,stm32-hwspinlock.txt new file +9
-0@@ -0,0 +1,23 @@ +STM32 Hardware Spinlock Device Binding +------------------------------------- + +Required properties : +- compatible : should be "st,stm32-hwspinlock". +- reg : the register address of hwspinlock. +- #hwlock-cells : hwlock users only use the hwlock id to represent a specific + hwlock, so the number of cells should be <1> here. +- clock-names : Must contain "hwspinlock".
"hwspinlock" --> "hsem" ?
Quoted 15 lines
Documentation/devicetree/bindings/hwlock/st,stm32-hwspinlock.txt new file +14
-0+- clocks : Must contain a phandle entry for the clock in clock-names, see the + common clock bindings. + +Please look at the generic hwlock binding for usage information for consumers, +"Documentation/devicetree/bindings/hwlock/hwlock.txt" + +Example of hwlock provider: + hwspinlock at 4c000000 { + compatible = "st,stm32-hwspinlock"; + #hwlock-cells = <1>; + reg = <0x4c000000 0x400>; + clocks = <&rcc HSEM>; + clock-names = "hsem"; + };
Rob Herring
maintainerPATCH v2 1/4 dt-bindings: hwlock: Document STM32 hwspinlock bindings
In reply to Benjamin GaignardQuoted 12 lines · Benjamin Gaignard
Add bindings for STM32 hardware spinlock device
Signed-off-by Benjamin Gaignard <[email protected]>---
version 2 :
- change clock name from hwspinlock to hsem to be align with hardware documentation.../bindings/hwlock/st,stm32-hwspinlock.txt | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwlock/st,stm32-hwspinlock.txt
PATCH v2 2/4 hwspinlock: add STM32 hwspinlock device
In reply to Benjamin GaignardThis patch adds support of hardware semaphores for stm32mp1 SoC. The hardware block provides 32 semaphores.
---
version 2 :
- change clock name from hwspinlock to hsem to be align with hardware documentation
- remove useless licence terms from header
- fix alphabetic order issues
- do not abort remove function if hwspin_lock_unregister() failed
drivers/hwspinlock/Kconfig | 9 +++ drivers/hwspinlock/Makefile | 1 + drivers/hwspinlock/stm32_hwspinlock.c | 144 ++++++++++++++++++++++++++++++++++ 3 files changed, 154 insertions(+) create mode 100644 drivers/hwspinlock/stm32_hwspinlock.c
drivers/hwspinlock/Kconfig +9 -0
@@ -49,6 +49,15 @@ config HWSPINLOCK_SPRD If unsure, say N. +config HWSPINLOCK_STM32 + tristate "STM32 Hardware Spinlock device" + depends on MACH_STM32MP157 + depends on HWSPINLOCK + help + Say y here to support the STM32 Hardware Spinlock device. + + If unsure, say N. + config HSEM_U8500 tristate "STE Hardware Semaphore functionality" depends on HWSPINLOCK
drivers/hwspinlock/Makefile +1 -0
@@ -8,4 +8,5 @@ obj-$(CONFIG_HWSPINLOCK_OMAP) += omap_hwspinlock.o obj-$(CONFIG_HWSPINLOCK_QCOM) += qcom_hwspinlock.o obj-$(CONFIG_HWSPINLOCK_SIRF) += sirf_hwspinlock.o obj-$(CONFIG_HWSPINLOCK_SPRD) += sprd_hwspinlock.o +obj-$(CONFIG_HWSPINLOCK_STM32) += stm32_hwspinlock.o obj-$(CONFIG_HSEM_U8500) += u8500_hsem.o
drivers/hwspinlock/stm32_hwspinlock.c new file +144 -0
144 lines not on this page · raw message
Signature · 1 line
2.15.0
PATCH v2 3/4 ARM: dts: stm32: Add hwspinlock node for stm32mp157 SoC
In reply to Benjamin GaignardDeclare hwspinlock device for stm32mp157 SoC
---
version 2 :
- change clock name from hwspinlock to hsem to be align with hardware documentation
arch/arm/boot/dts/stm32mp157c.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm/boot/dts/stm32mp157c.dtsi +9 -0
@@ -803,6 +803,15 @@ status = "disabled"; }; + hsem: hwspinlock at 4c000000 { + compatible = "st,stm32-hwspinlock"; + #hwlock-cells = <1>; + reg = <0x4c000000 0x400>; + clocks = <&rcc HSEM>; + clock-names = "hwsem"; + status = "disabled"; + }; + rcc: rcc at 50000000 { compatible = "st,stm32mp1-rcc", "syscon"; reg = <0x50000000 0x1000>;
Signature · 1 line
2.15.0
PATCH v2 4/4 ARM: dts: stm32: enable hwspinlock on stm32mp157c-ed1
In reply to Benjamin GaignardActivate hwspinlock for stm32mp157c-ed1
--- arch/arm/boot/dts/stm32mp157c-ed1.dts | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/boot/dts/stm32mp157c-ed1.dts +4 -0
@@ -94,3 +94,7 @@ vdda1v1-supply = <®11>; vdda1v8-supply = <®18>; }; + +&hsem { + status = "okay"; +};
Signature · 1 line
2.15.0