Skip to contentSkip to conversation

Add hwspinlock driver for StarFive JHB100 SoC

PATCH Superseded Xingyu Wu 3 participants 7 messages Apr 24 – Apr 27

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
author
#6 lore raw

PATCH 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 7d10988cbc62..adf04852186c 100644
@@ -25266,6 +25266,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
author
#1 lore raw

PATCH 1/2 dt-bindings: hwlock: Add the support of HWspinlock for StarFive JHB100

In reply to Xingyu Wu

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

---
 .../hwlock/starfive,jhb100-hwspinlock.yaml    | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml
Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml new file +40 -0
new file mode 100644
index 000000000000..b1b27fafe9bc
@@ -0,0 +1,40 @@
+# 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 Hardware Spinlock
+
+maintainers:
+  - Xingyu Wu <[email protected]>
+
+properties:
+  compatible:
+    const: starfive,jhb100-hwspinlock
+
+  reg:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+  "#hwlock-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+  - resets
+  - "#hwlock-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    hwspinlock@13012000 {
+        compatible = "starfive,jhb100-hwspinlock";
+        reg = <0x13012000 0x400>;
+        resets = <&sys0crg 0>;
+        #hwlock-cells = <1>;
+    };
Signature · 1 line
2.34.1

Xingyu Wu

author
#0 lore raw

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.

Xingyu Wu (2):
dt-bindings: hwlock: Add the support of HWspinlock for StarFive JHB100
hwspinlock: Add StarFive hwspinlock device

 .../hwlock/starfive,jhb100-hwspinlock.yaml    |  40 ++++++
 MAINTAINERS                                   |   6 +
 drivers/hwspinlock/Kconfig                    |   8 ++
 drivers/hwspinlock/Makefile                   |   1 +
 drivers/hwspinlock/starfive_hwspinlock.c      | 130 ++++++++++++++++++
 5 files changed, 185 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
#2 lore raw

Re: [PATCH v1 1/2] dt-bindings: hwlock: Add the support of HWspinlock for StarFive JHB100

In reply to Xingyu Wu
Quoted 27 lines · Xingyu Wu

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

---
 .../hwlock/starfive,jhb100-hwspinlock.yaml    | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml
Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml new file +13 -0
new file mode 100644
index 000000000000..b1b27fafe9bc
@@ -0,0 +1,40 @@
+# 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 Hardware Spinlock
+
+maintainers:
+  - Xingyu Wu <[email protected]>
+
+properties:
+  compatible:

Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml line 23

Quoted 10 lines
Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml new file +10 -0
+    const: starfive,jhb100-hwspinlock
+
+  reg:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+  "#hwlock-cells":
+    const: 1

Does this peripheral not have a clock?
Seems unlikely to me that it doesnt.

Quoted 21 lines
Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml new file +17 -0
+
+required:
+  - compatible
+  - reg
+  - resets
+  - "#hwlock-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    hwspinlock@13012000 {
+        compatible = "starfive,jhb100-hwspinlock";
+        reg = <0x13012000 0x400>;
+        resets = <&sys0crg 0>;
+        #hwlock-cells = <1>;
+    };
Signature · 1 line
2.34.1
#4 lore raw

Re: [PATCH v1 1/2] dt-bindings: hwlock: Add the support of HWspinlock for StarFive JHB100

In reply to Xingyu Wu
Quoted 1 line · Xingyu Wu

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

Simplify the subject. You cannot add here support for a device, you just add a device simply.

"Add StarFive JHB100 HW lock"

Quoted 13 lines
---
 .../hwlock/starfive,jhb100-hwspinlock.yaml    | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml
Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml new file +0 -0
new file mode 100644
index 000000000000..b1b27fafe9bc

Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml line 7

Quoted 7 lines
Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml new file +7 -0
@@ -0,0 +1,40 @@
+# 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 Hardware Spinlock

StarFive JHB100?

Quoted 18 lines
Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml new file +18 -0
+
+maintainers:
+  - Xingyu Wu <[email protected]>
+
+properties:
+  compatible:
+    const: starfive,jhb100-hwspinlock
+
+  reg:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+  "#hwlock-cells":
+    const: 1
+
+required:

Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml line 35

Quoted 10 lines
Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.yaml new file +10 -0
+  - compatible
+  - reg
+  - resets
+  - "#hwlock-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    hwspinlock@13012000 {

name: hwlock

Best regards,
Krzysztof

author
#3 lore raw

RE: [PATCH v1 1/2] dt-bindings: hwlock: Add the support of HWspinlock for StarFive JHB100

In reply to Conor Dooley
Quoted 40 lines · Conor Dooley
Quoted 39 lines · Xingyu Wu

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

---
 .../hwlock/starfive,jhb100-hwspinlock.yaml    | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.ya ml

diff --git a/Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock. yaml b/Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock. yaml
new file mode 100644
index 000000000000..b1b27fafe9bc

Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinl new file +19 -0
+++ ock.yaml
@@ -0,0 +1,40 @@
+# 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 Hardware Spinlock
+
+maintainers:
+  - Xingyu Wu <[email protected]>
+
+properties:
+  compatible:
+    const: starfive,jhb100-hwspinlock
+
+  reg:
+    maxItems: 1
+
Quoted 9 lines

Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinl line 23

Quoted 5 lines
Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinl new file +5 -0
+  resets:
+    maxItems: 1
+
+  "#hwlock-cells":
+    const: 1

Does this peripheral not have a clock?
Seems unlikely to me that it doesnt.

Yes, there is a clock in the hardware and I will add it in next patch.

Best regards,
Xingyu Wu

author
#5 lore raw

RE: [PATCH v1 1/2] dt-bindings: hwlock: Add the support of HWspinlock for StarFive JHB100

In reply to Krzysztof Kozlowski
Quoted 29 lines · Krzysztof Kozlowski
Quoted 1 line · Xingyu Wu

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

Simplify the subject. You cannot add here support for a device, you just add a device simply.

"Add StarFive JHB100 HW lock"

Quoted 21 lines
---
 .../hwlock/starfive,jhb100-hwspinlock.yaml    | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock.ya ml

diff --git a/Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock. yaml b/Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinlock. yaml
new file mode 100644
index 000000000000..b1b27fafe9bc

Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinl new file +2 -0
+++ ock.yaml
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
Quoted 8 lines

Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinl line 7

Quoted 6 lines
Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinl new file +6 -0
+---
+$id:
+http://devicetree.org/schemas/hwlock/starfive,jhb100-hwspinlock.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: StarFive Hardware Spinlock

StarFive JHB100?

Noted.

Quoted 23 lines
Quoted 23 lines
Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinl new file +22 -0
+
+maintainers:
+  - Xingyu Wu <[email protected]>
+
+properties:
+  compatible:
+    const: starfive,jhb100-hwspinlock
+
+  reg:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+  "#hwlock-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+  - resets
+  - "#hwlock-cells"
Quoted 8 lines

Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinl line 35

Quoted 6 lines
Documentation/devicetree/bindings/hwlock/starfive,jhb100-hwspinl new file +6 -0
+
+additionalProperties: false
+
+examples:
+  - |
+    hwspinlock@13012000 {

name: hwlock

Noted.

Best regards,
Xingyu Wu