Skip to contentSkip to conversation

Add driver support for ESWIN eic7700 SoC reset controller

PATCH In review [email protected] 4 participants 8 messages May 14, 2025 – May 16, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Add driver support for ESWIN eic7700 SoC reset controller

From: Xuyang Dong <[email protected]>

Add support for the reset functionality in the Linux kernel. The driver provides basic functionality to manage and control the reset signals for the eic7700 series chips, which are part of the Eswin SoC family.

The driver integrates with the Linux reset subsystem, allowing kernel code to trigger resets on the hardware and ensuring proper handling of reset events.

Features:

Implement support for the ESWIN eic7700 SoC reset controller. Provide API to manage reset signals for the eic7700 series SoC. Integrate with the Linux reset subsystem for consistency and scalability.

Supported chips:
ESWIN eic7700 series SoC.

Test:
The tests tested on the Sifive HiFive Premier P550 (which uses the EIC7700 SoC), including system boot, networking, EMMC, display, and other peripherals. The drivers of these modules all use the reset module,
so the verifies that this clock driver patch is working properly.

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

 .../bindings/reset/eswin,eic7700-reset.yaml   |  57 +++
 drivers/reset/Kconfig                         |   9 +
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-eic7700.c                 | 249 ++++++++++
 .../dt-bindings/reset/eswin,eic7700-reset.h   | 460 ++++++++++++++++++
 5 files changed, 776 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 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   |  47 +++
 .../dt-bindings/reset/eswin,eic7700-reset.h   | 460 ++++++++++++++++++
 2 files changed, 517 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 +47 -0
new file mode 100644
index 000000000000..1a3c6d230efe
@@ -0,0 +1,47 @@
+# 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 reset controller registers are part of the syscrg block on
+  the EIC7700 SoC.
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - const: eswin,eic7700-reset
+
+  '#reset-cells':
+    description: |
+      Specifies the number of cells needed to encode a reset source.
+      Cell #1 : module id of the reset consumer
+      Cell #2 : bit position of the reset in each reset consumer module
+    const: 2
+
+required:
+  - compatible
+  - '#reset-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/reset/eswin,eic7700-reset.h>
+
+    sys_crg: sys-crg@51828000 {
+        compatible = "syscon", "simple-mfd";
+        reg = <0x000000 0x51828000 0x000000 0x80000>;
+        reset: reset-controller {
+            compatible = "eswin,eic7700-reset";
+            #reset-cells = <2>;
+        };
+    };
include/dt-bindings/reset/eswin,eic7700-reset.h new file +460 -0

460 lines not on this page · raw message

--
2.17.1

#2 lore raw

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

Quoted 5 lines · On Wed, 14 May 2025 08:31:21 +0800, [email protected] wrote:

From: Xuyang Dong <[email protected]>

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

Quoted 9 lines
---
 .../bindings/reset/eswin,eic7700-reset.yaml   |  47 +++
 .../dt-bindings/reset/eswin,eic7700-reset.h   | 460 ++++++++++++++++++
 2 files changed, 517 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/eswin,eic7700-reset.yaml
 create mode 100644 include/dt-bindings/reset/eswin,eic7700-reset.h

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/reset/eswin,eic7700-reset.example.dtb: sys-crg@51828000 (syscon): compatible: ['syscon', 'simple-mfd'] is too short
from schema $id: http://devicetree.org/schemas/mfd/syscon-common.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/reset/eswin,eic7700-reset.example.dtb: sys-crg@51828000 (syscon): reg: [[0, 1367506944], [0, 524288]] is too long
from schema $id: http://devicetree.org/schemas/mfd/syscon-common.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

maintainer
#3 lore raw

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

In reply to [email protected]
Quoted 55 lines · On Wed, May 14, 2025 at 08:31:21AM +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   |  47 +++
 .../dt-bindings/reset/eswin,eic7700-reset.h   | 460 ++++++++++++++++++
 2 files changed, 517 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 +35 -0
new file mode 100644
index 000000000000..1a3c6d230efe
@@ -0,0 +1,47 @@
+# 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 reset controller registers are part of the syscrg block on
+  the EIC7700 SoC.
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - const: eswin,eic7700-reset
+
+  '#reset-cells':
+    description: |
+      Specifies the number of cells needed to encode a reset source.
+      Cell #1 : module id of the reset consumer
+      Cell #2 : bit position of the reset in each reset consumer module
+    const: 2
+
+required:
+  - compatible
+  - '#reset-cells'
+
+additionalProperties: false
+

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

Quoted 10 lines
Documentation/devicetree/bindings/reset/eswin,eic7700-reset.yaml new file +10 -0
+examples:
+  - |
+    #include <dt-bindings/reset/eswin,eic7700-reset.h>
+
+    sys_crg: sys-crg@51828000 {
+        compatible = "syscon", "simple-mfd";
+        reg = <0x000000 0x51828000 0x000000 0x80000>;
+        reset: reset-controller {
+            compatible = "eswin,eic7700-reset";
+            #reset-cells = <2>;

Same comment here as #clock-cells.

This is one h/w block, so there should be 1 binding for it. Make the binding for the sys-crg as complete as possible rather than adding 1 feature at a time.

Rob

#4 lore raw

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

In reply to [email protected]
Quoted 11 lines · On 14/05/2025 02:31, [email protected] wrote:
include/dt-bindings/reset/eswin,eic7700-reset.h new file +5 -0
new file mode 100644
index 000000000000..fcf004620db9
@@ -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.
+ *
+ * Device Tree binding constants for EIC7700 reset controller.

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

Quoted 10 lines
include/dt-bindings/reset/eswin,eic7700-reset.h new file +10 -0
+ *
+ * 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 0X00

No, IDs are abstract, decimal numbers going from 0. Not hex.

...

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

Quoted 1 line
include/dt-bindings/reset/eswin,eic7700-reset.h new file +1 -0
+#define SW_NOC_NSP_RSTN (1 << 0)

All these are not really bindings IDs either. This all should be 0, 1, 2 etc. Do not treat hardware numbers as bindings, because it is not needed and it does not bring any benefits.

Best regards,
Krzysztof

#5 lore raw

PATCH 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         |   9 ++
 drivers/reset/Makefile        |   1 +
 drivers/reset/reset-eic7700.c | 249 ++++++++++++++++++++++++++++++++++
 3 files changed, 259 insertions(+)
 create mode 100644 drivers/reset/reset-eic7700.c
drivers/reset/Kconfig +9 -0
index 99f6f9784e68..d6eef5358e13 100644
@@ -350,6 +350,15 @@ config RESET_ZYNQMP
 	help
 	  This enables the reset controller driver for Xilinx ZynqMP SoCs.
 
+config RESET_EIC7700
+	bool "Reset controller driver for Eswin SoCs"
+	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.
+
 source "drivers/reset/amlogic/Kconfig"
 source "drivers/reset/starfive/Kconfig"
 source "drivers/reset/sti/Kconfig"
drivers/reset/Makefile +1 -0
index 31f9904d13f9..2210c4e55834 100644
@@ -44,3 +44,4 @@ obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o
 obj-$(CONFIG_RESET_UNIPHIER_GLUE) += reset-uniphier-glue.o
 obj-$(CONFIG_RESET_ZYNQ) += reset-zynq.o
 obj-$(CONFIG_RESET_ZYNQMP) += reset-zynqmp.o
+obj-$(CONFIG_RESET_EIC7700) += reset-eic7700.o
drivers/reset/reset-eic7700.c new file +249 -0

249 lines not on this page · raw message

Signature · 1 line
2.17.1
#6 lore raw

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

Quoted 20 lines · On 14/05/2025 02:32, [email protected] wrote:

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         |   9 ++
 drivers/reset/Makefile        |   1 +
 drivers/reset/reset-eic7700.c | 249 ++++++++++++++++++++++++++++++++++
 3 files changed, 259 insertions(+)
 create mode 100644 drivers/reset/reset-eic7700.c
drivers/reset/Kconfig +0 -0
index 99f6f9784e68..d6eef5358e13 100644

drivers/reset/Kconfig config RESET_ZYNQMP · line 353

Quoted 4 lines
drivers/reset/Kconfig +1 -0
@@ -350,6 +350,15 @@ config RESET_ZYNQMP
 	help
 	  This enables the reset controller driver for Xilinx ZynqMP SoCs.
 
+config RESET_EIC7700

E is not after Z. Don't add your entries to the end. This applies to all your patches.

Quoted 16 lines
drivers/reset/Kconfig +8 -0
+	bool "Reset controller driver for Eswin SoCs"
+	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.
+
 source "drivers/reset/amlogic/Kconfig"
 source "drivers/reset/starfive/Kconfig"
 source "drivers/reset/sti/Kconfig"
drivers/reset/Makefile +0 -0
index 31f9904d13f9..2210c4e55834 100644

drivers/reset/Makefile obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o · line 47

Quoted 4 lines
drivers/reset/Makefile +1 -0
@@ -44,3 +44,4 @@ obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o
 obj-$(CONFIG_RESET_UNIPHIER_GLUE) += reset-uniphier-glue.o
 obj-$(CONFIG_RESET_ZYNQ) += reset-zynq.o
 obj-$(CONFIG_RESET_ZYNQMP) += reset-zynqmp.o
+obj-$(CONFIG_RESET_EIC7700) += reset-eic7700.o

E is not after Z.

drivers/reset/Makefile

Quoted 8 lines
drivers/reset/Makefile +8 -0
+static int eswin_reset_probe(struct platform_device *pdev)
+{
+	struct eswin_reset_data *data;
+	struct device *parent;
+
+	parent = pdev->dev.parent;
+	if (!parent) {
+		dev_err(&pdev->dev, "no parent\n");

Not possible. Fix your DTS otherwise.

drivers/reset/Makefile

Quoted 11 lines
drivers/reset/Makefile +11 -0
+		return -ENODEV;
+	}
+
+	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
+
+	data->regmap = syscon_node_to_regmap(parent->of_node);
+	if (IS_ERR(data->regmap)) {
+		dev_err(&pdev->dev, "failed to get parent regmap\n");
+		return PTR_ERR(data->regmap);

Syntax is always: return dev_err_probe. You already got such comment. All your patches repeat the same issues.

Quoted 8 lines
drivers/reset/Makefile +8 -0
+	}
+
+	platform_set_drvdata(pdev, data);
+
+	data->rcdev.owner = THIS_MODULE;
+	data->rcdev.ops = &eswin_reset_ops;
+	data->rcdev.of_node = pdev->dev.of_node;
+	data->rcdev.of_reset_n_cells = 2;

drivers/reset/Makefile

Quoted 10 lines
drivers/reset/Makefile +10 -0
+	data->rcdev.of_xlate = eswin_reset_of_xlate;
+	data->rcdev.dev = &pdev->dev;
+	data->dev = &pdev->dev;
+	idr_init(&data->idr);
+
+	/*clear boot flag so u84 and scpu could be reseted by software*/
+	regmap_set_bits(data->regmap, SYSCRG_CLEAR_BOOT_INFO_OFFSET,
+			CLEAR_BOOT_FLAG_BIT);
+	msleep(50);
+	platform_set_drvdata(pdev, data);

Drop, no need to do it twice.

Quoted 15 lines
drivers/reset/Makefile +15 -0
+
+	return devm_reset_controller_register(&pdev->dev, &data->rcdev);
+}
+
+static void eswin_reset_remove(struct platform_device *pdev)
+{
+	struct eswin_reset_data *data = platform_get_drvdata(pdev);
+
+	idr_destroy(&data->idr);
+}
+
+static struct platform_driver eswin_reset_driver = {
+	.probe	= eswin_reset_probe,
+	.remove = eswin_reset_remove,
+	.driver = {

drivers/reset/Makefile

Quoted 10 lines
drivers/reset/Makefile +10 -0
+		.name		= "eswin-reset",
+		.of_match_table	= eswin_reset_dt_ids,
+	},
+};
+
+static int __init eswin_reset_init(void)
+{
+	return platform_driver_register(&eswin_reset_driver);
+}
+arch_initcall(eswin_reset_init);

Best regards,
Krzysztof

#7 lore raw

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

In reply to [email protected]

Le 14/05/2025 à 02:32, dongxuyang-sYo9T6QOUuK8M3too/[email protected] a écrit :

Quoted 5 lines

From: Xuyang Dong <dongxuyang-sYo9T6QOUuK8M3too/[email protected]>

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

...

drivers/reset/reset-eic7700.c line 20

Quoted 9 lines
drivers/reset/reset-eic7700.c new file +9 -0
+#include <linux/err.h>
+#include <linux/init.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/reset-controller.h>
+#include <linux/slab.h>
+#include <linux/types.h>
+#include <linux/regmap.h>
+#include <linux/mfd/syscon.h>

Would be better if fully alphabetically ordered.

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+#define SYSCRG_CLEAR_BOOT_INFO_OFFSET (0x30C)

Unneeded ()

Quoted 1 line

+#define CLEAR_BOOT_FLAG_BIT BIT_ULL(0)

It is only used as a unsigned int parameter with regmap_set_bits(), so why ULL?

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+#define SYSCRG_RESET_OFFSET (0x400)

Unneeded ()

...

Quoted 13 lines
drivers/reset/reset-eic7700.c new file +13 -0
+/**
+ * eswin_reset_set() - program a device's reset
+ * @rcdev: reset controller entity
+ * @id: ID of the reset to toggle
+ * @assert: boolean flag to indicate assert or deassert
+ *
+ * This is a common internal function used to assert or deassert a device's
+ * reset by clear and set the reset bit. The device's reset is asserted if the
+ * @assert argument is true, or deasserted if @assert argument is false.
+ *
+ * Return: 0 for successful request, else a corresponding error value
+ */
+static int eswin_reset_set(struct reset_controller_dev *rcdev, unsigned long id,

drivers/reset/reset-eic7700.c line 74

Quoted 10 lines
drivers/reset/reset-eic7700.c new file +10 -0
+			   bool assert)
+{
+	struct eswin_reset_data *data = to_eswin_reset_data(rcdev);
+	struct eswin_reset_control *control;
+	int ret;
+
+	control = idr_find(&data->idr, id);
+
+	dev_dbg(rcdev->dev, "dev_id 0x%x reset_bit 0x%x assert 0x%x\r\n",
+		control->dev_id, control->reset_bit, assert);

We test of control is NULL the line after. So if it can happen, it would crash here.

Quoted 5 lines
drivers/reset/reset-eic7700.c new file +5 -0
+
+	if (!control)
+		return -EINVAL;
+
+	if (assert) {

drivers/reset/reset-eic7700.c line 89

Quoted 10 lines
drivers/reset/reset-eic7700.c new file +10 -0
+		ret = regmap_clear_bits(data->regmap,
+					SYSCRG_RESET_OFFSET +
+						control->dev_id * sizeof(u32),
+					control->reset_bit);
+	} else {
+		ret = regmap_set_bits(data->regmap,
+				      SYSCRG_RESET_OFFSET +
+					      control->dev_id * sizeof(u32),
+				      control->reset_bit);
+	}

No need fo { } around each of these branches.

drivers/reset/reset-eic7700.c line 99

Quoted 10 lines
drivers/reset/reset-eic7700.c new file +10 -0
+
+	return ret;
+}
+
+static int eswin_reset_reset(struct reset_controller_dev *rcdev,
+			     unsigned long id)
+{
+	int ret;
+
+	ret = eswin_reset_set(rcdev, id, true);

Would it make sense to use eswin_reset_assert()?

drivers/reset/reset-eic7700.c line 104

Quoted 5 lines
drivers/reset/reset-eic7700.c new file +5 -0
+	if (ret != 0)
+		return ret;
+
+	usleep_range(10, 15);
+	ret = eswin_reset_set(rcdev, id, false);

Would it make sense to use eswin_reset_deassert()?

Quoted 17 lines
drivers/reset/reset-eic7700.c new file +17 -0
+	if (ret != 0)
+		return ret;
+
+	return 0;
+}
+
+static int eswin_reset_assert(struct reset_controller_dev *rcdev,
+			      unsigned long id)
+{
+	return eswin_reset_set(rcdev, id, true);
+}
+
+static int eswin_reset_deassert(struct reset_controller_dev *rcdev,
+				unsigned long id)
+{
+	return eswin_reset_set(rcdev, id, false);
+}

...

drivers/reset/reset-eic7700.c line 138

Quoted 10 lines
drivers/reset/reset-eic7700.c new file +10 -0
+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;
+	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;
+	else

Unneeded else.

Quoted 20 lines
drivers/reset/reset-eic7700.c new file +20 -0
+		return 0;
+}
+
+/**
+ * eswin_reset_of_xlate() - translate a set of OF arguments to a reset ID
+ * @rcdev: reset controller entity
+ * @reset_spec: OF reset argument specifier
+ *
+ * This function performs the translation of the reset argument specifier
+ * values defined in a reset consumer device node. The function allocates a
+ * reset control structure for that device reset, and will be used by the
+ * driver for performing any reset functions on that reset. An idr structure
+ * is allocated and used to map to the reset control structure. This idr
+ * is used by the driver to do reset lookups.
+ *
+ * Return: 0 for successful request, else a corresponding error value
+ */
+static int eswin_reset_of_xlate(struct reset_controller_dev *rcdev,
+				const struct of_phandle_args *reset_spec)
+{

drivers/reset/reset-eic7700.c line 168

Quoted 10 lines
drivers/reset/reset-eic7700.c new file +10 -0
+	struct eswin_reset_data *data = to_eswin_reset_data(rcdev);
+	struct eswin_reset_control *control;
+	int ret;
+
+	if (WARN_ON(reset_spec->args_count != rcdev->of_reset_n_cells))
+		return -EINVAL;
+
+	ret = idr_for_each(&data->idr, eswin_reset_of_xlate_lookup_id,
+			   (void *)reset_spec);
+	if (ret != 0)

if (ret)

Quoted 7 lines
drivers/reset/reset-eic7700.c new file +7 -0
+		return ret;
+
+	control = devm_kzalloc(data->dev, sizeof(*control), GFP_KERNEL);
+	if (!control)
+		return -ENOMEM;
+
+	control->dev_id = reset_spec->args[0];

drivers/reset/reset-eic7700.c line 185

Quoted 10 lines
drivers/reset/reset-eic7700.c new file +10 -0
+	control->reset_bit = reset_spec->args[1];
+
+	return idr_alloc(&data->idr, control, 0, 0, GFP_KERNEL);
+}
+
+static const struct of_device_id eswin_reset_dt_ids[] = {
+	{
+		.compatible = "eswin,eic7700-reset",
+	},
+	{ /* sentinel */ },

No need for a trailing , after a terminator.

Quoted 25 lines
drivers/reset/reset-eic7700.c new file +25 -0
+};
+
+static int eswin_reset_probe(struct platform_device *pdev)
+{
+	struct eswin_reset_data *data;
+	struct device *parent;
+
+	parent = pdev->dev.parent;
+	if (!parent) {
+		dev_err(&pdev->dev, "no parent\n");
+		return -ENODEV;
+	}
+
+	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
+
+	data->regmap = syscon_node_to_regmap(parent->of_node);
+	if (IS_ERR(data->regmap)) {
+		dev_err(&pdev->dev, "failed to get parent regmap\n");
+		return PTR_ERR(data->regmap);
+	}
+
+	platform_set_drvdata(pdev, data);
+

drivers/reset/reset-eic7700.c line 220

Quoted 10 lines
drivers/reset/reset-eic7700.c new file +10 -0
+	data->rcdev.owner = THIS_MODULE;
+	data->rcdev.ops = &eswin_reset_ops;
+	data->rcdev.of_node = pdev->dev.of_node;
+	data->rcdev.of_reset_n_cells = 2;
+	data->rcdev.of_xlate = eswin_reset_of_xlate;
+	data->rcdev.dev = &pdev->dev;
+	data->dev = &pdev->dev;
+	idr_init(&data->idr);
+
+	/*clear boot flag so u84 and scpu could be reseted by software*/

Missing spaces at the start and the end of the comment.

drivers/reset/reset-eic7700.c line 227

Quoted 7 lines
drivers/reset/reset-eic7700.c new file +7 -0
+	regmap_set_bits(data->regmap, SYSCRG_CLEAR_BOOT_INFO_OFFSET,
+			CLEAR_BOOT_FLAG_BIT);
+	msleep(50);
+	platform_set_drvdata(pdev, data);
+
+	return devm_reset_controller_register(&pdev->dev, &data->rcdev);
+}

...

CJ