Skip to content

Commit d033ed9

Browse files
committed
Merge tag 'hwspinlock-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/hwspinlock
Pull hwspinlock updates from Ohad Ben-Cohen: - hwspinlock core DT support from Suman Anna - OMAP hwspinlock DT support from Suman Anna - QCOM hwspinlock DT support from Bjorn Andersson - a new CSR atlas7 hwspinlock driver from Wei Chen - CSR atlas7 hwspinlock DT binding document from Wei Chen - a tiny QCOM hwspinlock driver fix from Bjorn Andersson * tag 'hwspinlock-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/hwspinlock: hwspinlock: qcom: Correct msb in regmap_field DT: hwspinlock: add the CSR atlas7 hwspinlock bindings document hwspinlock: add a CSR atlas7 driver hwspinlock: qcom: Add support for Qualcomm HW Mutex block DT: hwspinlock: Add binding documentation for Qualcomm hwmutex hwspinlock/omap: add support for dt nodes Documentation: dt: add the omap hwspinlock bindings document hwspinlock/core: add device tree support Documentation: dt: add common bindings for hwspinlock
2 parents 6361c84 + bd5717a commit d033ed9

15 files changed

Lines changed: 605 additions & 68 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
Generic hwlock bindings
2+
=======================
3+
4+
Generic bindings that are common to all the hwlock platform specific driver
5+
implementations.
6+
7+
Please also look through the individual platform specific hwlock binding
8+
documentations for identifying any additional properties specific to that
9+
platform.
10+
11+
hwlock providers:
12+
=================
13+
14+
Required properties:
15+
- #hwlock-cells: Specifies the number of cells needed to represent a
16+
specific lock.
17+
18+
hwlock users:
19+
=============
20+
21+
Consumers that require specific hwlock(s) should specify them using the
22+
property "hwlocks", and an optional "hwlock-names" property.
23+
24+
Required properties:
25+
- hwlocks: List of phandle to a hwlock provider node and an
26+
associated hwlock args specifier as indicated by
27+
#hwlock-cells. The list can have just a single hwlock
28+
or multiple hwlocks, with each hwlock represented by
29+
a phandle and a corresponding args specifier.
30+
31+
Optional properties:
32+
- hwlock-names: List of hwlock name strings defined in the same order
33+
as the hwlocks, with one name per hwlock. Consumers can
34+
use the hwlock-names to match and get a specific hwlock.
35+
36+
37+
1. Example of a node using a single specific hwlock:
38+
39+
The following example has a node requesting a hwlock in the bank defined by
40+
the node hwlock1. hwlock1 is a hwlock provider with an argument specifier
41+
of length 1.
42+
43+
node {
44+
...
45+
hwlocks = <&hwlock1 2>;
46+
...
47+
};
48+
49+
2. Example of a node using multiple specific hwlocks:
50+
51+
The following example has a node requesting two hwlocks, a hwlock within
52+
the hwlock device node 'hwlock1' with #hwlock-cells value of 1, and another
53+
hwlock within the hwlock device node 'hwlock2' with #hwlock-cells value of 2.
54+
55+
node {
56+
...
57+
hwlocks = <&hwlock1 2>, <&hwlock2 0 3>;
58+
...
59+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
OMAP4+ HwSpinlock Driver
2+
========================
3+
4+
Required properties:
5+
- compatible: Should be "ti,omap4-hwspinlock" for
6+
OMAP44xx, OMAP54xx, AM33xx, AM43xx, DRA7xx SoCs
7+
- reg: Contains the hwspinlock module register address space
8+
(base address and length)
9+
- ti,hwmods: Name of the hwmod associated with the hwspinlock device
10+
- #hwlock-cells: Should be 1. The OMAP hwspinlock users will use a
11+
0-indexed relative hwlock number as the argument
12+
specifier value for requesting a specific hwspinlock
13+
within a hwspinlock bank.
14+
15+
Please look at the generic hwlock binding for usage information for consumers,
16+
"Documentation/devicetree/bindings/hwlock/hwlock.txt"
17+
18+
Example:
19+
20+
/* OMAP4 */
21+
hwspinlock: spinlock@4a0f6000 {
22+
compatible = "ti,omap4-hwspinlock";
23+
reg = <0x4a0f6000 0x1000>;
24+
ti,hwmods = "spinlock";
25+
#hwlock-cells = <1>;
26+
};
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Qualcomm Hardware Mutex Block:
2+
3+
The hardware block provides mutexes utilized between different processors on
4+
the SoC as part of the communication protocol used by these processors.
5+
6+
- compatible:
7+
Usage: required
8+
Value type: <string>
9+
Definition: must be one of:
10+
"qcom,sfpb-mutex",
11+
"qcom,tcsr-mutex"
12+
13+
- syscon:
14+
Usage: required
15+
Value type: <prop-encoded-array>
16+
Definition: one cell containing:
17+
syscon phandle
18+
offset of the hwmutex block within the syscon
19+
stride of the hwmutex registers
20+
21+
- #hwlock-cells:
22+
Usage: required
23+
Value type: <u32>
24+
Definition: must be 1, the specified cell represent the lock id
25+
(hwlock standard property, see hwlock.txt)
26+
27+
Example:
28+
29+
tcsr_mutex_block: syscon@fd484000 {
30+
compatible = "syscon";
31+
reg = <0xfd484000 0x2000>;
32+
};
33+
34+
hwlock@fd484000 {
35+
compatible = "qcom,tcsr-mutex";
36+
syscon = <&tcsr_mutex_block 0 0x80>;
37+
38+
#hwlock-cells = <1>;
39+
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
SIRF Hardware spinlock device Binding
2+
-----------------------------------------------
3+
4+
Required properties :
5+
- compatible : shall contain only one of the following:
6+
"sirf,hwspinlock"
7+
8+
- reg : the register address of hwspinlock
9+
10+
- #hwlock-cells : hwlock users only use the hwlock id to represent a specific
11+
hwlock, so the number of cells should be <1> here.
12+
13+
Please look at the generic hwlock binding for usage information for consumers,
14+
"Documentation/devicetree/bindings/hwlock/hwlock.txt"
15+
16+
Example of hwlock provider:
17+
hwlock {
18+
compatible = "sirf,hwspinlock";
19+
reg = <0x13240000 0x00010000>;
20+
#hwlock-cells = <1>;
21+
};
22+
23+
Example of hwlock users:
24+
node {
25+
...
26+
hwlocks = <&hwlock 2>;
27+
...
28+
};

‎Documentation/hwspinlock.txt‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ independent, drivers.
4848
ids for predefined purposes.
4949
Should be called from a process context (might sleep).
5050

51+
int of_hwspin_lock_get_id(struct device_node *np, int index);
52+
- retrieve the global lock id for an OF phandle-based specific lock.
53+
This function provides a means for DT users of a hwspinlock module
54+
to get the global lock id of a specific hwspinlock, so that it can
55+
be requested using the normal hwspin_lock_request_specific() API.
56+
The function returns a lock id number on success, -EPROBE_DEFER if
57+
the hwspinlock device is not yet registered with the core, or other
58+
error values.
59+
Should be called from a process context (might sleep).
60+
5161
int hwspin_lock_free(struct hwspinlock *hwlock);
5262
- free a previously-assigned hwspinlock; returns 0 on success, or an
5363
appropriate error code on failure (e.g. -EINVAL if the hwspinlock

‎MAINTAINERS‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7364,7 +7364,6 @@ M: Ohad Ben-Cohen <ohad@wizery.com>
73647364
L: linux-omap@vger.kernel.org
73657365
S: Maintained
73667366
F: drivers/hwspinlock/omap_hwspinlock.c
7367-
F: arch/arm/mach-omap2/hwspinlock.c
73687367

73697368
OMAP MMC SUPPORT
73707369
M: Jarkko Lavinen <jarkko.lavinen@nokia.com>

‎arch/arm/mach-omap2/Makefile‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,5 @@ obj-y += $(nand-m) $(nand-y)
274274

275275
smsc911x-$(CONFIG_SMSC911X) := gpmc-smsc911x.o
276276
obj-y += $(smsc911x-m) $(smsc911x-y)
277-
ifneq ($(CONFIG_HWSPINLOCK_OMAP),)
278-
obj-y += hwspinlock.o
279-
endif
280277

281278
obj-y += common-board-devices.o twl-common.o dss-common.o

‎arch/arm/mach-omap2/hwspinlock.c‎

Lines changed: 0 additions & 60 deletions
This file was deleted.

‎drivers/hwspinlock/Kconfig‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,30 @@ config HWSPINLOCK_OMAP
1818

1919
If unsure, say N.
2020

21+
config HWSPINLOCK_QCOM
22+
tristate "Qualcomm Hardware Spinlock device"
23+
depends on ARCH_QCOM
24+
select HWSPINLOCK
25+
select MFD_SYSCON
26+
help
27+
Say y here to support the Qualcomm Hardware Mutex functionality, which
28+
provides a synchronisation mechanism for the various processors on
29+
the SoC.
30+
31+
If unsure, say N.
32+
33+
config HWSPINLOCK_SIRF
34+
tristate "SIRF Hardware Spinlock device"
35+
depends on ARCH_SIRF
36+
select HWSPINLOCK
37+
help
38+
Say y here to support the SIRF Hardware Spinlock device, which
39+
provides a synchronisation mechanism for the various processors
40+
on the SoC.
41+
42+
It's safe to say n here if you're not interested in SIRF hardware
43+
spinlock or just want a bare minimum kernel.
44+
2145
config HSEM_U8500
2246
tristate "STE Hardware Semaphore functionality"
2347
depends on ARCH_U8500

‎drivers/hwspinlock/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44

55
obj-$(CONFIG_HWSPINLOCK) += hwspinlock_core.o
66
obj-$(CONFIG_HWSPINLOCK_OMAP) += omap_hwspinlock.o
7+
obj-$(CONFIG_HWSPINLOCK_QCOM) += qcom_hwspinlock.o
8+
obj-$(CONFIG_HWSPINLOCK_SIRF) += sirf_hwspinlock.o
79
obj-$(CONFIG_HSEM_U8500) += u8500_hsem.o

0 commit comments

Comments
 (0)