drivers: hwspinlock: add CSR atlas7 implementation
Subsystems (2)
PATCH v4 1/3 drivers: hwspinlock: add CSR atlas7 implementation
From: Wei Chen <[email protected]>
Add hwspinlock support for the CSR atlas7 SoC.
The Hardware Spinlock device on atlas7 provides hardware assistance for synchronization between the multiple processors in the system (dual Cortex-A7, CAN bus Cortex-M3 and audio DSP).
---
-v4: fix the error handler for iomap;
fix a checkpatch issue;
thanks suman!
drivers/hwspinlock/Kconfig | 12 ++++ drivers/hwspinlock/Makefile | 1 + drivers/hwspinlock/sirf_hwspinlock.c | 136 +++++++++++++++++++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 drivers/hwspinlock/sirf_hwspinlock.c
drivers/hwspinlock/Kconfig +12 -0
@@ -30,6 +30,18 @@ config HWSPINLOCK_QCOM If unsure, say N. +config HWSPINLOCK_SIRF + tristate "SIRF Hardware Spinlock device" + depends on ARCH_SIRF + select HWSPINLOCK + help + Say y here to support the SIRF Hardware Spinlock device, which + provides a synchronisation mechanism for the various processors + on the SoC. + + It's safe to say n here if you're not interested in SIRF hardware + spinlock or just want a bare minimum kernel. + config HSEM_U8500 tristate "STE Hardware Semaphore functionality" depends on ARCH_U8500
drivers/hwspinlock/Makefile +1 -0
@@ -5,4 +5,5 @@ obj-$(CONFIG_HWSPINLOCK) += hwspinlock_core.o obj-$(CONFIG_HWSPINLOCK_OMAP) += omap_hwspinlock.o obj-$(CONFIG_HWSPINLOCK_QCOM) += qcom_hwspinlock.o +obj-$(CONFIG_HWSPINLOCK_SIRF) += sirf_hwspinlock.o obj-$(CONFIG_HSEM_U8500) += u8500_hsem.o
drivers/hwspinlock/sirf_hwspinlock.c new file +136 -0
136 lines not on this page · raw message
Signature · 6 lines
2.3.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1432628911-18555-1-git-send-email-21cnbao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
PATCH v4 2/3 Documentation: dt: add the CSR atlas7 hwspinlock bindings document
From: Wei Chen <[email protected]>
The Hardware Spinlock device on atlas7 provides hardware assistance for synchronization between the multiple processors in the system (dual Cortex-A7, CAN bus Cortex-M3 and audio DSP).
This patch adds the DT bindings information for this hwspinlock module.
---
-v4: add description for "#hwlock-cells"
thanks suman!
.../devicetree/bindings/hwlock/sirf,hwspinlock.txt | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwlock/sirf,hwspinlock.txt
Documentation/devicetree/bindings/hwlock/sirf,hwspinlock.txt new file +28 -0
@@ -0,0 +1,28 @@ +SIRF Hardware spinlock device Binding +----------------------------------------------- + +Required properties : +- compatible : shall contain only one of the following: + "sirf,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. + +Please look at the generic hwlock binding for usage information for consumers, +"Documentation/devicetree/bindings/hwlock/hwlock.txt" + +Example of hwlock provider: + hwlock { + compatible = "sirf,hwspinlock"; + reg = <0x13240000 0x00010000>; + #hwlock-cells = <1>; + }; + +Example of hwlock users: + node { + ... + hwlocks = <&hwlock 2>; + ... + };
Signature · 6 lines
2.3.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1432628911-18555-2-git-send-email-21cnbao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Suman Anna
Reviewed-byRe: [PATCH v4 2/3] Documentation: dt: add the CSR atlas7 hwspinlock bindings document
Quoted 8 lines · Barry Song
From: Wei Chen <[email protected]>
The Hardware Spinlock device on atlas7 provides hardware assistance for synchronization between the multiple processors in the system (dual Cortex-A7, CAN bus Cortex-M3 and audio DSP).
This patch adds the DT bindings information for this hwspinlock module.
Quoted 5 lines
Cc Suman Anna <[email protected]>Cc Bjorn Andersson <bjorn-UYDU3/[email protected]>Signed-off-by Wei Chen <[email protected]>Signed-off-by Barry Song <[email protected]>---
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Bjorn Andersson
Reviewed-byRe: [PATCH v4 2/3] Documentation: dt: add the CSR atlas7 hwspinlock bindings document
In reply to a message not in the archiveOn Tue, May 26, 2015 at 1:28 AM, Barry Song <[email protected]> wrote:
[..]
Quoted 1 line
Documentation/devicetree/bindings/hwlock/sirf,hwspinlock.txt +0
-0
[..]
Documentation/devicetree/bindings/hwlock/sirf,hwspinlock.txt
Quoted 3 lines
+- #hwlock-cells : hwlock users only use the hwlock id to represent a specific
Documentation/devicetree/bindings/hwlock/sirf,hwspinlock.txt +2
-0+ hwlock, so the number of cells should be <1> here. +
Jfyi, you could have gotten away with:
#hwlock-cells: must be 1
Quoted 2 lines
+Please look at the generic hwlock binding for usage information for consumers, +"Documentation/devicetree/bindings/hwlock/hwlock.txt"
Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 3/3 ARM: dts: atlas7: use general dt-binding for hwspinlock
In reply to a message not in the archiveFrom: Wei Chen <[email protected]>
This patch moves to use generic dt-binding for hwspinlock providers and clients.
add #hwlock-cells for the provider and hwlocks for clients.
--- arch/arm/boot/dts/atlas7.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/atlas7.dtsi +3 -3
@@ -84,17 +84,17 @@ #address-cells = <1>; #size-cells = <1>; - hwspinlock { + hwlock: hwspinlock { compatible = "sirf,hwspinlock"; reg = <0x13240000 0x00010000>; - - num-spinlocks = <30>; + #hwlock-cells = <1>; }; ns_m3_rproc@0 { compatible = "sirf,ns2m30-rproc"; reg = <0x13240000 0x00010000>; interrupts = <0 123 0>; + hwlocks = <&hwlock 0>, <&hwlock 1>; }; ns_m3_rproc@1 {
Signature · 6 lines
2.3.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1432628911-18555-3-git-send-email-21cnbao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Re: [PATCH v3 3/3] ARM: dts: atlas7: use general dt-binding for hwspinlock
Barry,
Quoted 19 lines · Barry Song
From: Wei Chen <[email protected]>
This patch moves to use generic dt-binding for hwspinlock providers and clients.
add #hwlock-cells for the provider and hwlocks for clients.Cc Suman Anna <[email protected]>Cc Bjorn Andersson <bjorn-UYDU3/[email protected]>Signed-off-by Wei Chen <[email protected]>Signed-off-by Barry Song <[email protected]>--- arch/arm/boot/dts/atlas7.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)arch/arm/boot/dts/atlas7.dtsi +0
-0
arch/arm/boot/dts/atlas7.dtsi line 89
Quoted 7 lines
arch/arm/boot/dts/atlas7.dtsi +1
-1@@ -84,17 +84,17 @@ #address-cells = <1>; #size-cells = <1>; - hwspinlock { + hwlock: hwspinlock { compatible = "sirf,hwspinlock"; reg = <0x13240000 0x00010000>;
An unrelated question here, why the reg is same for all the child nodes of the parent ipc node? If this is partitioned properly, then the driver can be simplified a bit by using platform_get_resource and devm_ioremap_resource?
arch/arm/boot/dts/atlas7.dtsi line 97
Quoted 10 lines
arch/arm/boot/dts/atlas7.dtsi +2
-2- - num-spinlocks = <30>; + #hwlock-cells = <1>; }; ns_m3_rproc@0 { compatible = "sirf,ns2m30-rproc"; reg = <0x13240000 0x00010000>; interrupts = <0 123 0>; + hwlocks = <&hwlock 0>, <&hwlock 1>;
Does this need to be added for the other nodes like ns_m3_rproc@1 as well?
regards
Suman
arch/arm/boot/dts/atlas7.dtsi line 100
Quoted 4 lines
arch/arm/boot/dts/atlas7.dtsi +0
-0}; ns_m3_rproc@1 {
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH v3 3/3] ARM: dts: atlas7: use general dt-binding for hwspinlock
On Thu, May 28, 2015 at 2:30 PM, Suman Anna <[email protected]> wrote:
[..]
Quoted 7 lines
Quoted 1 line
reg = <0x13240000 0x00010000>;An unrelated question here, why the reg is same for all the child nodes of the parent ipc node? If this is partitioned properly, then the driver can be simplified a bit by using
platform_get_resourceanddevm_ioremap_resource?
Good catch Suman, I missed that.
Barry, if these blocks represents various functionalities of the same hw block then you should consider moving them to be part of a simple-mfd.
Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CAJAp7OjjzMCGQSRx8c3f5D7uCnWUesZ5Sx8X8=BEjAuAxBqOYw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH v3 3/3] ARM: dts: atlas7: use general dt-binding for hwspinlock
2015-05-29 23:50 GMT+08:00 Bjorn Andersson <bjorn-UYDU3/[email protected]>:
Quoted 10 lines · Suman Anna
[..]
Quoted 7 lines
Quoted 1 line
reg = <0x13240000 0x00010000>;An unrelated question here, why the reg is same for all the child nodes of the parent ipc node? If this is partitioned properly, then the driver can be simplified a bit by using
platform_get_resourceanddevm_ioremap_resource?
Quoted 5 lines
Good catch Suman, I missed that.
Barry, if these blocks represents various functionalities of the same hw block then you should consider moving them to be part of a simple-mfd.
the hwspinlock and the IPC, which works for kicking interrupts between multiple cores in the SoC, are in one bus node but there is no overlapping register.
hwspinlock:
begin from 0x13240000 + 0x400
IPC:
begin from 0x13240000, and end at begin from 0x13240000 + 0x400 - 0x4 ?
so i guess we can refine the dts memory region to avoid MFD?
Quoted 3 lines
Regards,
Bjorn
-barry
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CAGsJ_4xGHQ4aqrejr7WwQKbn_7Mgfxv7ntxqYVxPzQGNW+KBPw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH v3 3/3] ARM: dts: atlas7: use general dt-binding for hwspinlock
Quoted 25 lines · Barry Song
2015-05-29 23:50 GMT+08:00 Bjorn Andersson <bjorn-UYDU3/[email protected]>:
Quoted 10 lines · Suman Anna
[..]
Quoted 7 lines
Quoted 1 line
reg = <0x13240000 0x00010000>;An unrelated question here, why the reg is same for all the child nodes of the parent ipc node? If this is partitioned properly, then the driver can be simplified a bit by using
platform_get_resourceanddevm_ioremap_resource?Quoted 5 lines
Good catch Suman, I missed that.
Barry, if these blocks represents various functionalities of the same hw block then you should consider moving them to be part of a simple-mfd.
the hwspinlock and the IPC, which works for kicking interrupts between multiple cores in the SoC, are in one bus node but there is no overlapping register.
hwspinlock:
begin from0x13240000+0x400
IPC:
begin from0x13240000, and end at begin from0x13240000+0x400-0x4?
Quoted 1 line
so i guess we can refine the dts memory region to avoid MFD?
Yeah, that should be fine from the hwspinlock perspective, all its registers are self-contained.
regards
Suman
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 3/3] ARM: dts: atlas7: use general dt-binding for hwspinlock
In reply to a message not in the archive2015-05-29 5:30 GMT+08:00 Suman Anna <[email protected]>:
Quoted 40 lines
Barry,
Quoted 19 lines · Barry Song
From: Wei Chen <[email protected]>
This patch moves to use generic dt-binding for hwspinlock providers and clients.
add #hwlock-cells for the provider and hwlocks for clients.Cc Suman Anna <[email protected]>Cc Bjorn Andersson <bjorn-UYDU3/[email protected]>Signed-off-by Wei Chen <[email protected]>Signed-off-by Barry Song <[email protected]>--- arch/arm/boot/dts/atlas7.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)arch/arm/boot/dts/atlas7.dtsi +0
-0arch/arm/boot/dts/atlas7.dtsi line 89
Quoted 7 lines
arch/arm/boot/dts/atlas7.dtsi +1
-1@@ -84,17 +84,17 @@ #address-cells = <1>; #size-cells = <1>; - hwspinlock { + hwlock: hwspinlock { compatible = "sirf,hwspinlock"; reg = <0x13240000 0x00010000>;An unrelated question here, why the reg is same for all the child nodes of the parent ipc node? If this is partitioned properly, then the driver can be simplified a bit by using
platform_get_resourceanddevm_ioremap_resource?Quoted 5 lines
arch/arm/boot/dts/atlas7.dtsi +1
-2- - num-spinlocks = <30>; + #hwlock-cells = <1>; };
Quoted 7 lines
arch/arm/boot/dts/atlas7.dtsi line 97
Quoted 5 lines
arch/arm/boot/dts/atlas7.dtsi +1
-0ns_m3_rproc@0 { compatible = "sirf,ns2m30-rproc"; reg = <0x13240000 0x00010000>; interrupts = <0 123 0>; + hwlocks = <&hwlock 0>, <&hwlock 1>;Does this need to be added for the other nodes like ns_m3_rproc@1 as well?
now the hwlock-cells are only added for the nodes who are really using it. other users have not used it.
Quoted 9 lines
regards
SumanQuoted 4 lines
arch/arm/boot/dts/atlas7.dtsi +0
-0}; ns_m3_rproc@1 {
-barry
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CAGsJ_4y3YwXfzveWQSHQ9ZuoJbWdJTh3PJjgs0HM6t2w5S1y_w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH v3 3/3] ARM: dts: atlas7: use general dt-binding for hwspinlock
Quoted 47 lines · Barry Song
2015-05-29 5:30 GMT+08:00 Suman Anna <[email protected]>:
Quoted 46 lines
Barry,
Quoted 19 lines · Barry Song
From: Wei Chen <[email protected]>
This patch moves to use generic dt-binding for hwspinlock providers and clients.
add #hwlock-cells for the provider and hwlocks for clients.Cc Suman Anna <[email protected]>Cc Bjorn Andersson <bjorn-UYDU3/[email protected]>Signed-off-by Wei Chen <[email protected]>Signed-off-by Barry Song <[email protected]>--- arch/arm/boot/dts/atlas7.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)arch/arm/boot/dts/atlas7.dtsi +0
-0arch/arm/boot/dts/atlas7.dtsi line 89
Quoted 7 lines
arch/arm/boot/dts/atlas7.dtsi +1
-1@@ -84,17 +84,17 @@ #address-cells = <1>; #size-cells = <1>; - hwspinlock { + hwlock: hwspinlock { compatible = "sirf,hwspinlock"; reg = <0x13240000 0x00010000>;An unrelated question here, why the reg is same for all the child nodes of the parent ipc node? If this is partitioned properly, then the driver can be simplified a bit by using
platform_get_resourceanddevm_ioremap_resource?Quoted 10 lines
arch/arm/boot/dts/atlas7.dtsi +2
-2- - num-spinlocks = <30>; + #hwlock-cells = <1>; }; ns_m3_rproc@0 { compatible = "sirf,ns2m30-rproc"; reg = <0x13240000 0x00010000>; interrupts = <0 123 0>; + hwlocks = <&hwlock 0>, <&hwlock 1>;
Quoted 4 lines
Quoted 1 line
Does this need to be added for the other nodes like ns_m3_rproc@1 as well?
now the hwlock-cells are only added for the nodes who are really using it. other users have not used it.
OK, may be split it out then and add these in a subsequent patch with proper usage description.
regards
Suman
Quoted 5 lines
Quoted 5 lines
regards
Suman
Quoted 8 lines
Quoted 5 lines
arch/arm/boot/dts/atlas7.dtsi line 100
Quoted 4 lines
arch/arm/boot/dts/atlas7.dtsi +0
-0}; ns_m3_rproc@1 {-barry
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Suman Anna
Reviewed-byQuoted 4 lines · Barry Song
From: Wei Chen <[email protected]>
Add hwspinlock support for the CSR atlas7 SoC.
Quoted 8 lines
The Hardware Spinlock device on atlas7 provides hardware assistance for synchronization between the multiple processors in the system (dual Cortex-A7, CAN bus Cortex-M3 and audio DSP).
Cc Suman Anna <[email protected]>Cc Bjorn Andersson <bjorn-UYDU3/[email protected]>Signed-off-by Wei Chen <[email protected]>Signed-off-by Barry Song <[email protected]>
regards
Suman
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Bjorn Andersson
Reviewed-byQuoted 10 lines · Barry Song
From: Wei Chen <[email protected]>
Add hwspinlock support for the CSR atlas7 SoC.
The Hardware Spinlock device on atlas7 provides hardware assistance for synchronization between the multiple processors in the system (dual Cortex-A7, CAN bus Cortex-M3 and audio DSP).
Cc Suman Anna <[email protected]>Cc Bjorn Andersson <bjorn-UYDU3/[email protected]>
Quoted 3 lines
Signed-off-by Wei Chen <[email protected]>Signed-off-by Barry Song <[email protected]>---
Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CAJAp7Og0GDmh7EcsDedNkRi0StoQZOE+ShP_m2GXAhq9M4UG+Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 5 lines · Barry Song
Quoted 4 lines
From: Wei Chen <[email protected]>
Add hwspinlock support for the CSR atlas7 SoC.
Quoted 8 lines
Quoted 6 lines
The Hardware Spinlock device on atlas7 provides hardware assistance for synchronization between the multiple processors in the system (dual Cortex-A7, CAN bus Cortex-M3 and audio DSP).
Cc Suman Anna <[email protected]>Cc Bjorn Andersson <bjorn-UYDU3/[email protected]>
Applied first two patches. Thanks Suman and Bjorn for making the time to review them!
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html