Skip to contentSkip to conversation

Add driver support for ESWIN eic7700 SoC reset controller

PATCH Superseded [email protected] 2 participants 6 messages Jun 19, 2025

Subsystems (2)

v3 of 15 Superseded Latest is v15 →

lore
Share & tools
lore
#0 lore raw

v3 cover Add driver support for ESWIN eic7700 SoC reset controller

From: Xuyang Dong <[email protected]>

There are some register offsets in reset dt-bindings. It could be used. Therefore, we want to keep these bindings. I don't known if it meets the requirements.

PIPE_RST_CTRL, TBU_RST_CTRL and TEST_RST_CTRL are not used in this driver. Therefore, these are left out.

Updates:

dt-bindings: reset: eswin: Documentation for eic7700 SoC v2 -> v3:
1. Drop syscon and simple-mfd from yaml and code, because these are not necessary.
2. Update description to introduce reset controller.
3. Add reset control indices for dt-bindings.
4. Keep the register offsets in dt-bindings.

v1 -> v2:
1. Clear warnings/errors for using "make dt_binding_check".
2. Update example, change parent node from sys-crg to reset-controller for reset yaml.
3. Drop the child node and add '#reset-cells' to the parent node.
4. Drop the description, because sys-crg block is changed to reset- controller.
5. Change hex numbers to decimal numbers going from 0, and drop the not needed hardware numbers.

reset: eswin: Add eic7700 reset driver
v2 -> v3:
1. Change syscon_node_to_regmap() to MMIO regmap functions, because droped syscon.
2. Add BIT() in function eswin_reset_set() to shift the reset control indices.
3. Remove forced type conversions from function eswin_reset_of_ xlate_lookup_id().

v1 -> v2:
1. Modify the code according to the suggestions.
2. Use eswin_reset_assert() and eswin_reset_deassert in function eswin_reset_reset().
3. Place RESET_EIC7700 in Kconfig and Makefile in order.
4. Use dev_err_probe() in probe function.

Xuyang Dong (2):
dt-bindings: reset: eswin: Documentation for eic7700 SoC
reset: eswin: Add eic7700 reset driver

 .../bindings/reset/eswin,eic7700-reset.yaml   |  42 ++
 drivers/reset/Kconfig                         |  10 +
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-eic7700.c                 | 243 +++++++++
 .../dt-bindings/reset/eswin,eic7700-reset.h   | 460 ++++++++++++++++++
 5 files changed, 756 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/eswin,eic7700-reset.yaml
 create mode 100644 drivers/reset/reset-eic7700.c
 create mode 100644 include/dt-bindings/reset/eswin,eic7700-reset.h

--
2.17.1

#1 lore raw

PATCH v3 1/2 dt-bindings: reset: eswin: Documentation for eic7700 SoC

From: Xuyang Dong <[email protected]>

Add device tree binding documentation and header file for the ESWIN eic7700 reset controller module.

---
 .../bindings/reset/eswin,eic7700-reset.yaml   |  42 ++
 .../dt-bindings/reset/eswin,eic7700-reset.h   | 460 ++++++++++++++++++
 2 files changed, 502 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/eswin,eic7700-reset.yaml
 create mode 100644 include/dt-bindings/reset/eswin,eic7700-reset.h
Documentation/devicetree/bindings/reset/eswin,eic7700-reset.yaml new file +42 -0
new file mode 100644
index 000000000000..b844a9c5a169
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/reset/eswin,eic7700-reset.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ESWIN EIC7700 SoC reset controller
+
+maintainers:
+  - Yifeng Huang <[email protected]>
+  - Xuyang Dong <[email protected]>
+
+description:
+  The system reset controller can be used to reset various peripheral
+  controllers in ESWIN eic7700 SoC.
+
+properties:
+  compatible:
+    const: eswin,eic7700-reset
+
+  reg:
+    maxItems: 1
+
+  '#reset-cells':
+    const: 2
+
+required:
+  - compatible
+  - reg
+  - '#reset-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/reset/eswin,eic7700-reset.h>
+
+    reset-controller@51828000 {
+        compatible = "eswin,eic7700-reset";
+        reg = <0x51828000 0x80000>;
+        #reset-cells = <2>;
+    };
include/dt-bindings/reset/eswin,eic7700-reset.h new file +460 -0

460 lines not on this page · raw message

Signature · 1 line
2.17.1
#3 lore raw

PATCH v3 2/2 reset: eswin: Add eic7700 reset driver

In reply to [email protected]

From: Xuyang Dong <[email protected]>

Add support for reset controller in eic7700 series chips. Provide functionality for asserting and deasserting resets on the chip.

---
 drivers/reset/Kconfig         |  10 ++
 drivers/reset/Makefile        |   1 +
 drivers/reset/reset-eic7700.c | 243 ++++++++++++++++++++++++++++++++++
 3 files changed, 254 insertions(+)
 create mode 100644 drivers/reset/reset-eic7700.c
drivers/reset/Kconfig +10 -0
index d85be5899da6..82f829f4c9f0 100644
@@ -66,6 +66,16 @@ config RESET_BRCMSTB_RESCAL
 	  This enables the RESCAL reset controller for SATA, PCIe0, or PCIe1 on
 	  BCM7216.
 
+config RESET_EIC7700
+	bool "Reset controller driver for ESWIN SoCs"
+	depends on ARCH_ESWIN || COMPILE_TEST
+	default ARCH_ESWIN
+	help
+	  This enables the reset controller driver for ESWIN SoCs. This driver is
+	  specific to ESWIN SoCs and should only be enabled if using such hardware.
+	  The driver supports eic7700 series chips and provides functionality for
+	  asserting and deasserting resets on the chip.
+
 config RESET_EYEQ
 	bool "Mobileye EyeQ reset controller"
 	depends on MACH_EYEQ5 || MACH_EYEQ6H || COMPILE_TEST
drivers/reset/Makefile +1 -0
index 91e6348e3351..ceafbad0555c 100644
@@ -12,6 +12,7 @@ obj-$(CONFIG_RESET_BCM6345) += reset-bcm6345.o
 obj-$(CONFIG_RESET_BERLIN) += reset-berlin.o
 obj-$(CONFIG_RESET_BRCMSTB) += reset-brcmstb.o
 obj-$(CONFIG_RESET_BRCMSTB_RESCAL) += reset-brcmstb-rescal.o
+obj-$(CONFIG_RESET_EIC7700) += reset-eic7700.o
 obj-$(CONFIG_RESET_EYEQ) += reset-eyeq.o
 obj-$(CONFIG_RESET_GPIO) += reset-gpio.o
 obj-$(CONFIG_RESET_HSDK) += reset-hsdk.o
drivers/reset/reset-eic7700.c new file +243 -0

243 lines not on this page · raw message

--
2.17.1

#2 lore raw

Re: [PATCH v3 1/2] dt-bindings: reset: eswin: Documentation for eic7700 SoC

In reply to [email protected]

Documentation/devicetree/bindings/reset/eswin,eic7700-reset.yaml line 25

Quoted 6 lines · On 19/06/2025 10:00, [email protected] wrote:
Documentation/devicetree/bindings/reset/eswin,eic7700-reset.yaml new file +6 -0
+
+  reg:
+    maxItems: 1
+
+  '#reset-cells':
+    const: 2

What is the meaning of the cells?

Quoted 24 lines
Documentation/devicetree/bindings/reset/eswin,eic7700-reset.yaml new file +17 -0
+
+required:
+  - compatible
+  - reg
+  - '#reset-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/reset/eswin,eic7700-reset.h>
+
+    reset-controller@51828000 {
+        compatible = "eswin,eic7700-reset";
+        reg = <0x51828000 0x80000>;
+        #reset-cells = <2>;
+    };
include/dt-bindings/reset/eswin,eic7700-reset.h new file +1 -1
new file mode 100644
index 000000000000..8c3aa3c87ea4
--- /dev/null
 
+++ b/include/dt-bindings/reset/eswin,eic7700-reset.h

include/dt-bindings/reset/eswin,eic7700-reset.h line 3

Quoted 3 lines
include/dt-bindings/reset/eswin,eic7700-reset.h new file +3 -0
@@ -0,0 +1,460 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright 2024, Beijing ESWIN Computing Technology Co., Ltd.. All rights reserved.

2025

Quoted 25 lines
include/dt-bindings/reset/eswin,eic7700-reset.h new file +25 -0
+ *
+ * Device Tree binding constants for EIC7700 reset controller.
+ *
+ * Authors:
+ *	Yifeng Huang <[email protected]>
+ *	Xuyang Dong <[email protected]>
+ */
+
+#ifndef __DT_ESWIN_EIC7700_RESET_H__
+#define __DT_ESWIN_EIC7700_RESET_H__
+
+#define SNOC_RST_CTRL 0
+#define GPU_RST_CTRL 1
+#define DSP_RST_CTRL 2
+#define D2D_RST_CTRL 3
+#define DDR_RST_CTRL 4
+#define TCU_RST_CTRL 5
+#define NPU_RST_CTRL 6
+#define HSPDMA_RST_CTRL 7
+#define PCIE_RST_CTRL 8
+#define I2C_RST_CTRL 9
+#define FAN_RST_CTRL 10
+#define PVT_RST_CTRL 11
+#define MBOX_RST_CTRL 12
+#define UART_RST_CTRL 13

...

Quoted 12 lines
include/dt-bindings/reset/eswin,eic7700-reset.h new file +12 -0
+
+/*TIMER1*/
+#define SW_TIMER1_RSTN_0 0
+#define SW_TIMER1_RSTN_1 1
+#define SW_TIMER1_RSTN_2 2
+#define SW_TIMER1_RSTN_3 3
+#define SW_TIMER1_RSTN_4 4
+#define SW_TIMER1_RSTN_5 5
+#define SW_TIMER1_RSTN_6 6
+#define SW_TIMER1_RSTN_7 7
+#define SW_TIMER1_PRSTN 8
+

include/dt-bindings/reset/eswin,eic7700-reset.h line 403

Quoted 10 lines
include/dt-bindings/reset/eswin,eic7700-reset.h new file +10 -0
+/*TIMER2*/
+#define SW_TIMER2_RSTN_0 0
+#define SW_TIMER2_RSTN_1 1
+#define SW_TIMER2_RSTN_2 2
+#define SW_TIMER2_RSTN_3 3
+#define SW_TIMER2_RSTN_4 4
+#define SW_TIMER2_RSTN_5 5
+#define SW_TIMER2_RSTN_6 6
+#define SW_TIMER2_RSTN_7 7
+#define SW_TIMER2_PRSTN 8

That's unreadable - missing indent before the value. Ids equal to block number are not useful anyway.

The problem is: you still do not use this as an ABI. No driver usage at all and (comment which I repeat very often) no point to add it to the bindings. Look at other bindings how this is supposed to look like.

Best regards,
Krzysztof

#5 lore raw
In reply to [email protected]
Quoted 11 lines · On 19/06/2025 09:58, [email protected] wrote:

From: Xuyang Dong <[email protected]>

There are some register offsets in reset dt-bindings. It could be used. Therefore, we want to keep these bindings. I don't known if it meets the requirements.

PIPE_RST_CTRL, TBU_RST_CTRL and TEST_RST_CTRL are not used in this driver. Therefore, these are left out.

Updates:

Quoted 7 lines

dt-bindings: reset: eswin: Documentation for eic7700 SoC v2 -> v3:
1. Drop syscon and simple-mfd from yaml and code, because these are not necessary.
2. Update description to introduce reset controller.
3. Add reset control indices for dt-bindings.
4. Keep the register offsets in dt-bindings.

No, drop. Register offsets are not bindings. That was last comment, so don't keep them. Remove them.

Best regards,
Krzysztof

#4 lore raw

Re: [PATCH v3 2/2] reset: eswin: Add eic7700 reset driver

In reply to [email protected]

drivers/reset/reset-eic7700.c line 130

Quoted 10 lines · On 19/06/2025 10:01, [email protected] wrote:
drivers/reset/reset-eic7700.c new file +10 -0
+
+static const struct reset_control_ops eswin_reset_ops = {
+	.reset = eswin_reset_reset,
+	.assert = eswin_reset_assert,
+	.deassert = eswin_reset_deassert,
+};
+
+static int eswin_reset_of_xlate_lookup_id(int id, void *p, void *data)
+{
+	struct of_phandle_args *reset_spec = data;

Still wrong cast.

What is the type? You got exactly that question. How did you resolve it?

drivers/reset/reset-eic7700.c line 139

Quoted 9 lines
drivers/reset/reset-eic7700.c new file +9 -0
+	struct eswin_reset_control *slot_control = p;
+
+	if (reset_spec->args[0] == slot_control->dev_id &&
+	    reset_spec->args[1] == slot_control->reset_bit)
+		return id;
+
+	return 0;
+}
+

Best regards,
Krzysztof