Add support of STM32 hwspinlock
Subsystems (3)
v3 cover Add support of STM32 hwspinlock
This serie adds the support of the hardware semaphore block for stm32mp1 SoC.
version 3:
- fix clock name in properties description.
- use postcore_initcall() instead of module_platform_driver()
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 | 156 +++++++++++++++++++++ 6 files changed, 202 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 v3 1/4 dt-bindings: hwlock: Document STM32 hwspinlock bindings
Add bindings for STM32 hardware spinlock device
---
version 3 :
- fix clock name in properties description
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 "hsem". +- 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
Rob Herring
maintainerRe: [PATCH v3 1/4] dt-bindings: hwlock: Document STM32 hwspinlock bindings
Quoted 3 lines · Benjamin Gaignard
Add bindings for STM32 hardware spinlock device
Signed-off-by Benjamin Gaignard <[email protected]>
Linaro or ST? Please make the author email match.
Quoted 43 lines
---
version 3 :
- fix clock name in properties description
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 +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 "hsem". +- 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 v3 1/4] dt-bindings: hwlock: Document STM32 hwspinlock bindings
Quoted 7 lines · Rob Herring
Quoted 3 lines · Benjamin Gaignard
Add bindings for STM32 hardware spinlock device
Signed-off-by Benjamin Gaignard <[email protected]>Linaro or ST? Please make the author email match.
Thanks for the review Rob and thanks for spotting this.
@Benjamin, please resend the driver and dt-binding with matching author and sob - or if you wrote this as ST and want to send it upstream as Linaro add your new sob after the ST one.
Regards,
Bjorn
Quoted 43 lines
Quoted 43 lines
---
version 3 :
- fix clock name in properties description
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 +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 "hsem". +- 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 v3 1/4] dt-bindings: hwlock: Document STM32 hwspinlock bindings
In reply to Benjamin GaignardQuoted 10 lines · Benjamin Gaignard
Add bindings for STM32 hardware spinlock device
Signed-off-by Benjamin Gaignard <[email protected]>---
version 3 :
- fix clock name in properties description
version 2 :
- change clock name from hwspinlock to hsem to be align with hardware documentation
Quoted 4 lines
.../bindings/hwlock/st,stm32-hwspinlock.txt | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwlock/st,stm32-hwspinlock.txt
PATCH v3 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 3 :
- use postcore_initcall() instead of module_platform_driver()
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 | 156 ++++++++++++++++++++++++++++++++++ 3 files changed, 166 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 +156 -0
156 lines not on this page · raw message
Signature · 1 line
2.15.0
PATCH v3 3/4 ARM: dts: stm32: Add hwspinlock node for stm32mp157 SoC
In reply to Benjamin GaignardDeclare hwspinlock device for stm32mp157 SoC
--- 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 v3 4/4 ARM: dts: stm32: enable hwspinlock on stm32mp157c-ed1
In reply to Benjamin Gaignard--- 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
Hi Benjamin
Quoted 12 lines · Benjamin Gaignard
This serie adds the support of the hardware semaphore block for stm32mp1 SoC.
version 3:
- fix clock name in properties description.
- usepostcore_initcall()instead ofmodule_platform_driver()version 2:
- fix comments done by Bjorn about clock naming, license terms in header, alphabetic ordering inMakefileandKconfigand remove function
- Do not push test module in this version while waiting for feedbacks about it
Quoted 5 lines
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
DT patches applied on stm32-next.
Regards
Alex
Quoted 11 lines
.../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 | 156 +++++++++++++++++++++ 6 files changed, 202 insertions(+)create mode 100644
Documentation/devicetree/bindings/hwlock/st,stm32-hwspinlock.txtcreate mode 100644drivers/hwspinlock/stm32_hwspinlock.c
Hi Benjamin,
Quoted 25 lines · Benjamin Gaignard
This serie adds the support of the hardware semaphore block for stm32mp1 SoC.
version 3:
- fix clock name in properties description.
- usepostcore_initcall()instead ofmodule_platform_driver()version 2:
- fix comments done by Bjorn about clock naming, license terms in header, alphabetic ordering inMakefileandKconfigand remove function
- Do not push test module in this version while waiting for feedbacks about itBenjamin 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 | 156 +++++++++++++++++++++ 6 files changed, 202 insertions(+)
Quoted 3 lines
create mode 100644
Documentation/devicetree/bindings/hwlock/st,stm32-hwspinlock.txtcreate mode 100644drivers/hwspinlock/stm32_hwspinlock.c
There is a (strong) dependency between pinctrl and hsem.
As our pin controller is enabled by default, it's better to enable also
your hwspinlock device by default. It will avoid pin controller probe defer and a no stable behavior. So, I gonna remove DT patches from stm32-next. Those Dt patches will not be included in my 4.20 pull-request.
regards
Alex