Skip to contentSkip to conversation

Add driver support for ESWIN eic7700 SoC reset controller

PATCH Superseded [email protected] 3 participants 7 messages Jun 4, 2025

Subsystems (2)

v2 of 15 Superseded Latest is v15 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add driver support for ESWIN eic7700 SoC reset controller

From: Xuyang Dong <[email protected]>

Updates:

dt-bindings: reset: eswin: Documentation for eic7700 SoC
v1 -> v2:
1. Clear warnings/errors by 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
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   |  41 +++
 drivers/reset/Kconfig                         |  10 +
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-eic7700.c                 | 234 ++++++++++++++++++
 .../dt-bindings/reset/eswin,eic7700-reset.h   |  73 ++++++
 5 files changed, 359 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 v2 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   | 41 +++++++++++
 .../dt-bindings/reset/eswin,eic7700-reset.h   | 73 +++++++++++++++++++
 2 files changed, 114 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 +41 -0
new file mode 100644
index 000000000000..85ad5fec9430
@@ -0,0 +1,41 @@
+# 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]>
+
+properties:
+  compatible:
+    items:
+      - const: eswin,eic7700-reset
+      - const: syscon
+      - const: simple-mfd
+
+  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", "syscon", "simple-mfd";
+        reg = <0x51828000 0x80000>;
+        #reset-cells = <2>;
+    };
include/dt-bindings/reset/eswin,eic7700-reset.h new file +73 -0

73 lines not on this page · raw message

--
2.17.1

#2 lore raw

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

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

Quoted 6 lines · On 04/06/2025 10:52, [email protected] wrote:
Documentation/devicetree/bindings/reset/eswin,eic7700-reset.yaml new file +6 -0
+
+properties:
+  compatible:
+    items:
+      - const: eswin,eic7700-reset
+      - const: syscon

Hm? Did you just add it for the driver? If so, then no, drop. Use standard MMIO regmap (if you want regmap).

Quoted 1 line

+ - const: simple-mfd

Why did this appear? Changelog is silent on this and it makes no sense here. No children.

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

Quoted 12 lines
Documentation/devicetree/bindings/reset/eswin,eic7700-reset.yaml new file +12 -0
+
+  reg:
+    maxItems: 1
+
+  '#reset-cells':
+    const: 2
+
+required:
+  - compatible
+  - reg
+  - '#reset-cells'
+

Best regards,
Krzysztof

maintainer
#3 lore raw

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

In reply to [email protected]
Quoted 128 lines · On Mi, 2025-06-04 at 16:52 +0800, [email protected] wrote:

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   | 41 +++++++++++
 .../dt-bindings/reset/eswin,eic7700-reset.h   | 73 +++++++++++++++++++
 2 files changed, 114 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 +41 -0
new file mode 100644
index 000000000000..85ad5fec9430
@@ -0,0 +1,41 @@
+# 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]>
+
+properties:
+  compatible:
+    items:
+      - const: eswin,eic7700-reset
+      - const: syscon
+      - const: simple-mfd
+
+  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", "syscon", "simple-mfd";
+        reg = <0x51828000 0x80000>;
+        #reset-cells = <2>;
+    };
include/dt-bindings/reset/eswin,eic7700-reset.h new file +61 -0
new file mode 100644
index 000000000000..7ba31db86141
@@ -0,0 +1,73 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright 2024, Beijing ESWIN Computing Technology Co., Ltd.. All rights reserved.
+ *
+ * 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
+#define GPIO_RST_CTRL 14
+#define TIMER_RST_CTRL 15
+#define SSI_RST_CTRL 16
+#define WDT_RST_CTRL 17
+#define LSP_CFGRST_CTRL 18
+#define U84_RST_CTRL 19
+#define SCPU_RST_CTRL 20
+#define LPCPU_RST_CTRL 21
+#define VC_RST_CTRL 22
+#define JD_RST_CTRL 23
+#define JE_RST_CTRL 24
+#define VD_RST_CTRL 25
+#define VE_RST_CTRL 26
+#define G2D_RST_CTRL 27
+#define VI_RST_CTRL 28
+#define DVP_RST_CTRL 29
+#define ISP0_RST_CTRL 30
+#define ISP1_RST_CTRL 31
+#define SHUTTER_RST_CTRL 32
+#define VO_PHYRST_CTRL 33
+#define VO_I2SRST_CTRL 34
+#define VO_RST_CTRL 35
+#define BOOTSPI_RST_CTRL 36
+#define I2C1_RST_CTRL 37
+#define I2C0_RST_CTRL 38
+#define DMA1_RST_CTRL 39
+#define FPRT_RST_CTRL 40
+#define HBLOCK_RST_CTRL 41
+#define SECSR_RST_CTRL 42
+#define OTP_RST_CTRL 43
+#define PKA_RST_CTRL 44
+#define SPACC_RST_CTRL 45
+#define TRNG_RST_CTRL 46

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

Quoted 10 lines
include/dt-bindings/reset/eswin,eic7700-reset.h new file +10 -0
+#define RESERVED 47
+#define TIMER0_RST_CTRL 48
+#define TIMER1_RST_CTRL 49
+#define TIMER2_RST_CTRL 50
+#define TIMER3_RST_CTRL 51
+#define RTC_RST_CTRL 52
+#define MNOC_RST_CTRL 53
+#define RNOC_RST_CTRL 54
+#define CNOC_RST_CTRL 55
+#define LNOC_RST_CTRL 56

These appear to be register offsets, not individual reset control indices.

Are PIPE_RST_CTRL, TBU_RST_CTRL, and TEST_RST_CTRL left out on purpose?

regards
Philipp

#4 lore raw

PATCH v2 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 | 234 ++++++++++++++++++++++++++++++++++
 3 files changed, 245 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 +234 -0

234 lines not on this page · raw message

Signature · 1 line
2.17.1
#5 lore raw

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

drivers/reset/reset-eic7700.c line 125

Quoted 8 lines · On 04/06/2025 10:53, [email protected] wrote:
drivers/reset/reset-eic7700.c new file +8 -0
+	.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 = (struct of_phandle_args *)data;

Wrong cast. Look at the type in xlate.

drivers/reset/reset-eic7700.c line 133

Quoted 8 lines
drivers/reset/reset-eic7700.c new file +8 -0
+	struct eswin_reset_control *slot_control =
+		(struct eswin_reset_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

#6 lore raw

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

In reply to [email protected]

drivers/reset/reset-eic7700.c line 125

Quoted 8 lines · On 04/06/2025 10:53, [email protected] wrote:
drivers/reset/reset-eic7700.c new file +8 -0
+	.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 = (struct of_phandle_args *)data;

Wrong cast. Look at the type in xlate.

drivers/reset/reset-eic7700.c line 133

Quoted 8 lines
drivers/reset/reset-eic7700.c new file +8 -0
+	struct eswin_reset_control *slot_control =
+		(struct eswin_reset_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