Skip to contentSkip to conversation

Add hwspinlock driver for StarFive JHB100 SoC

PATCH In review Xingyu Wu 2 participants 4 messages May 15

Subsystems (2)
lore
Share & tools
lore

Xingyu Wu

author
#0 lore raw

v2 cover Add hwspinlock driver for StarFive JHB100 SoC

This patch serises are to add hardware spinlock driver for the StarFive JHB100 SoC. The first patch adds documentation for StarFive Hardware Spinlock. The subsequent patch adds hwspinlock driver and support JHB100 SoC.

The StarFive hwspinlock supports 16 channels for using by secur core and AP core to restrict access and protect the memory area.

Changes since v1:
- Simplified the subject.
- Added 'StarFive JHB100' in documentation title.
- Modified the name of example.
- Added the property of 'clocks'.

v1: https://lore.kernel.org/all/[email protected]/

Xingyu Wu (2):
dt-bindings: hwlock: Add StarFive JHB100 HW lock
hwspinlock: Add StarFive hwspinlock device

 .../hwlock/starfive,jhb100-hwspinlock.yaml    |  43 ++++++
 MAINTAINERS                                   |   6 +
 drivers/hwspinlock/Kconfig                    |   8 ++
 drivers/hwspinlock/Makefile                   |   1 +
 drivers/hwspinlock/starfive_hwspinlock.c      | 130 ++++++++++++++++++
 5 files changed, 188 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml
 create mode 100644 drivers/hwspinlock/starfive_hwspinlock.c
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v2 1/2 dt-bindings: hwlock: Add StarFive JHB100 HW lock

Add the new documentation of hardware spinlock for the StarFive JHB100 SoC.

---
 .../hwlock/starfive,jhb100-hwspinlock.yaml    | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml
Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml new file +43 -0
new file mode 100644
index 000000000000..af09aeb072b3
@@ -0,0 +1,43 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwlock/starfive,jhb100-hwspinlock.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: StarFive JHB100 Hardware Spinlock
+
+maintainers:
+  - Xingyu Wu <[email protected]>
+
+properties:
+  compatible:
+    const: starfive,jhb100-hwspinlock
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+  "#hwlock-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+  - resets
+  - "#hwlock-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    hwlock@13012000 {
+        compatible = "starfive,jhb100-hwspinlock";
+        reg = <0x13012000 0x400>;
+        resets = <&sys0crg 0>;
+        #hwlock-cells = <1>;
+    };
Signature · 1 line
2.34.1
author
#3 lore raw

PATCH v2 2/2 hwspinlock: Add StarFive hwspinlock device

In reply to Xingyu Wu

Add support of hardware spinlock for the StarFive JHB100 SoC. The hwspinlock provides 16 channels for using by secur core and AP core.

---
 MAINTAINERS                              |   6 ++
 drivers/hwspinlock/Kconfig               |   8 ++
 drivers/hwspinlock/Makefile              |   1 +
 drivers/hwspinlock/starfive_hwspinlock.c | 130 +++++++++++++++++++++++
 4 files changed, 145 insertions(+)
 create mode 100644 drivers/hwspinlock/starfive_hwspinlock.c
MAINTAINERS +6 -0
index c3fe46d7c4bc..4ff12806ba09 100644
@@ -25275,6 +25275,12 @@ F:	Documentation/devicetree/bindings/power/starfive*
 F:	drivers/pmdomain/starfive/
 F:	include/dt-bindings/power/starfive,jh7110-pmu.h
 
+STARFIVE JHB100 HARDWARE SPINLOCK DRIVER
+M:      Xingyu Wu <[email protected]>
+S:      Supported
+F:      Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml
+F:      drivers/hwspinlock/starfive_hwspinlock.c
+
 STARFIVE SOC DRIVERS
 M:	Conor Dooley <[email protected]>
 S:	Maintained
drivers/hwspinlock/Kconfig +8 -0
index 3874d15b0e9b..797f5a833547 100644
@@ -36,6 +36,14 @@ config HWSPINLOCK_SPRD
 
 	  If unsure, say N.
 
+config HWSPINLOCK_STARFIVE
+	tristate "StarFive Hardware Spinlock device"
+	depends on ARCH_STARFIVE || COMPILE_TEST
+	help
+	  Say y here to support the StarFive Hardware Spinlock device.
+
+	  If unsure, say N.
+
 config HWSPINLOCK_STM32
 	tristate "STM32 Hardware Spinlock device"
 	depends on MACH_STM32MP157 || COMPILE_TEST
drivers/hwspinlock/Makefile +1 -0
index a0f16c9aaa82..bc713bdc7e04 100644
@@ -7,6 +7,7 @@ obj-$(CONFIG_HWSPINLOCK)		+= hwspinlock_core.o
 obj-$(CONFIG_HWSPINLOCK_OMAP)		+= omap_hwspinlock.o
 obj-$(CONFIG_HWSPINLOCK_QCOM)		+= qcom_hwspinlock.o
 obj-$(CONFIG_HWSPINLOCK_SPRD)		+= sprd_hwspinlock.o
+obj-$(CONFIG_HWSPINLOCK_STARFIVE)       += starfive_hwspinlock.o
 obj-$(CONFIG_HWSPINLOCK_STM32)		+= stm32_hwspinlock.o
 obj-$(CONFIG_HWSPINLOCK_SUN6I)		+= sun6i_hwspinlock.o
 obj-$(CONFIG_HSEM_U8500)		+= u8500_hsem.o
drivers/hwspinlock/starfive_hwspinlock.c new file +130 -0

130 lines not on this page · raw message

Signature · 1 line
2.34.1