mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 0/2] TH1520 SoC: Add Reset Controller Support
       [not found] <CGME20250303152520eucas1p250f2e6d8eaf1172d8813b04ceb88679c@eucas1p2.samsung.com>
@ 2025-03-03 15:25 ` Michal Wilczynski
       [not found]   ` <CGME20250303152521eucas1p26c54c5b15c024d749cf004b66345d2e0@eucas1p2.samsung.com>
                     ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Michal Wilczynski @ 2025-03-03 15:25 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, drew, guoren, wefu, p.zabel, m.szyprowski
  Cc: devicetree, linux-kernel, Michal Wilczynski

This patch series adds reset controller support for the T-Head TH1520 SoC,
which is used in boards like the LicheePi 4A. While part of a broader effort to
enable the Imagination BXM-4-64 GPU upstream, these patches focus on providing
a dedicated reset controller driver and the corresponding Device Tree
nodes/bindings.

Bigger series cover letter:
https://lore.kernel.org/all/20250219140239.1378758-1-m.wilczynski@samsung.com/

Michal Wilczynski (2):
  dt-bindings: reset: Add T-HEAD TH1520 SoC Reset Controller
  reset: thead: Add TH1520 reset controller driver

 .../bindings/reset/thead,th1520-reset.yaml    |  44 ++++++
 MAINTAINERS                                   |   3 +
 drivers/reset/Kconfig                         |  10 ++
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-th1520.c                  | 135 ++++++++++++++++++
 .../dt-bindings/reset/thead,th1520-reset.h    |  16 +++
 6 files changed, 209 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml
 create mode 100644 drivers/reset/reset-th1520.c
 create mode 100644 include/dt-bindings/reset/thead,th1520-reset.h

-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v1 1/2] dt-bindings: reset: Add T-HEAD TH1520 SoC Reset Controller
       [not found]   ` <CGME20250303152521eucas1p26c54c5b15c024d749cf004b66345d2e0@eucas1p2.samsung.com>
@ 2025-03-03 15:25     ` Michal Wilczynski
  2025-03-03 17:40       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 7+ messages in thread
From: Michal Wilczynski @ 2025-03-03 15:25 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, drew, guoren, wefu, p.zabel, m.szyprowski
  Cc: devicetree, linux-kernel, Michal Wilczynski, Krzysztof Kozlowski

Add a YAML schema for the T-HEAD TH1520 SoC reset controller. This
controller manages resets for subsystems such as the GPU within the
TH1520 SoC.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
---
 .../bindings/reset/thead,th1520-reset.yaml    | 44 +++++++++++++++++++
 MAINTAINERS                                   |  2 +
 .../dt-bindings/reset/thead,th1520-reset.h    | 16 +++++++
 3 files changed, 62 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml
 create mode 100644 include/dt-bindings/reset/thead,th1520-reset.h

diff --git a/Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml b/Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml
new file mode 100644
index 000000000000..f2e91d0add7a
--- /dev/null
+++ b/Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml
@@ -0,0 +1,44 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/reset/thead,th1520-reset.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: T-HEAD TH1520 SoC Reset Controller
+
+description:
+  The T-HEAD TH1520 reset controller is a hardware block that asserts/deasserts
+  resets for SoC subsystems.
+
+maintainers:
+  - Michal Wilczynski <m.wilczynski@samsung.com>
+
+properties:
+  compatible:
+    enum:
+      - thead,th1520-reset
+
+  reg:
+    maxItems: 1
+
+  "#reset-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+  - "#reset-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    soc {
+      #address-cells = <2>;
+      #size-cells = <2>;
+      rst: reset-controller@ffef528000 {
+        compatible = "thead,th1520-reset";
+        reg = <0xff 0xef528000 0x0 0x1000>;
+        #reset-cells = <1>;
+      };
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index 18f0eb293519..819686e98214 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -20417,6 +20417,7 @@ F:	Documentation/devicetree/bindings/firmware/thead,th1520-aon.yaml
 F:	Documentation/devicetree/bindings/mailbox/thead,th1520-mbox.yaml
 F:	Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml
 F:	Documentation/devicetree/bindings/pinctrl/thead,th1520-pinctrl.yaml
+F:	Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml
 F:	arch/riscv/boot/dts/thead/
 F:	drivers/clk/thead/clk-th1520-ap.c
 F:	drivers/firmware/thead,th1520-aon.c
@@ -20426,6 +20427,7 @@ F:	drivers/pinctrl/pinctrl-th1520.c
 F:	drivers/pmdomain/thead/
 F:	include/dt-bindings/clock/thead,th1520-clk-ap.h
 F:	include/dt-bindings/power/thead,th1520-power.h
+F:	include/dt-bindings/reset/thead,th1520-reset.h
 F:	include/linux/firmware/thead/thead,th1520-aon.h
 
 RNBD BLOCK DRIVERS
diff --git a/include/dt-bindings/reset/thead,th1520-reset.h b/include/dt-bindings/reset/thead,th1520-reset.h
new file mode 100644
index 000000000000..00459f160489
--- /dev/null
+++ b/include/dt-bindings/reset/thead,th1520-reset.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Author: Michal Wilczynski <m.wilczynski@samsung.com>
+ */
+
+#ifndef _DT_BINDINGS_TH1520_RESET_H
+#define _DT_BINDINGS_TH1520_RESET_H
+
+#define TH1520_RESET_ID_GPU		0
+#define TH1520_RESET_ID_GPU_CLKGEN	1
+#define TH1520_RESET_ID_NPU		2
+#define TH1520_RESET_ID_WDT0		3
+#define TH1520_RESET_ID_WDT1		4
+
+#endif /* _DT_BINDINGS_TH1520_RESET_H */
-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v1 2/2] reset: thead: Add TH1520 reset controller driver
       [not found]   ` <CGME20250303152521eucas1p20128508eb79e20c1e124155beaf8fb4d@eucas1p2.samsung.com>
@ 2025-03-03 15:25     ` Michal Wilczynski
  0 siblings, 0 replies; 7+ messages in thread
From: Michal Wilczynski @ 2025-03-03 15:25 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, drew, guoren, wefu, p.zabel, m.szyprowski
  Cc: devicetree, linux-kernel, Michal Wilczynski

Add reset controller driver for the T-HEAD TH1520 SoC that manages
hardware reset lines for various subsystems. The driver currently
implements support for GPU reset control, with infrastructure in place
to extend support for NPU and Watchdog Timer resets in future updates.

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
---
 MAINTAINERS                  |   1 +
 drivers/reset/Kconfig        |  10 +++
 drivers/reset/Makefile       |   1 +
 drivers/reset/reset-th1520.c | 135 +++++++++++++++++++++++++++++++++++
 4 files changed, 147 insertions(+)
 create mode 100644 drivers/reset/reset-th1520.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 819686e98214..e4a0a83b4c11 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -20425,6 +20425,7 @@ F:	drivers/mailbox/mailbox-th1520.c
 F:	drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c
 F:	drivers/pinctrl/pinctrl-th1520.c
 F:	drivers/pmdomain/thead/
+F:	drivers/reset/reset-th1520.c
 F:	include/dt-bindings/clock/thead,th1520-clk-ap.h
 F:	include/dt-bindings/power/thead,th1520-power.h
 F:	include/dt-bindings/reset/thead,th1520-reset.h
diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
index 5b3abb6db248..fa0943c3d1de 100644
--- a/drivers/reset/Kconfig
+++ b/drivers/reset/Kconfig
@@ -272,6 +272,16 @@ config RESET_SUNXI
 	help
 	  This enables the reset driver for Allwinner SoCs.
 
+config RESET_TH1520
+	tristate "T-HEAD 1520 reset controller"
+	depends on ARCH_THEAD || COMPILE_TEST
+	select REGMAP_MMIO
+	help
+	  This driver provides support for the T-HEAD TH1520 SoC reset controller,
+	  which manages hardware reset lines for SoC components such as the GPU.
+	  Enable this option if you need to control hardware resets on TH1520-based
+	  systems.
+
 config RESET_TI_SCI
 	tristate "TI System Control Interface (TI-SCI) reset driver"
 	depends on TI_SCI_PROTOCOL || (COMPILE_TEST && TI_SCI_PROTOCOL=n)
diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
index 677c4d1e2632..d6c2774407ae 100644
--- a/drivers/reset/Makefile
+++ b/drivers/reset/Makefile
@@ -35,6 +35,7 @@ obj-$(CONFIG_RESET_SIMPLE) += reset-simple.o
 obj-$(CONFIG_RESET_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_RESET_SUNPLUS) += reset-sunplus.o
 obj-$(CONFIG_RESET_SUNXI) += reset-sunxi.o
+obj-$(CONFIG_RESET_TH1520) += reset-th1520.o
 obj-$(CONFIG_RESET_TI_SCI) += reset-ti-sci.o
 obj-$(CONFIG_RESET_TI_SYSCON) += reset-ti-syscon.o
 obj-$(CONFIG_RESET_TI_TPS380X) += reset-tps380x.o
diff --git a/drivers/reset/reset-th1520.c b/drivers/reset/reset-th1520.c
new file mode 100644
index 000000000000..7874f0693e1b
--- /dev/null
+++ b/drivers/reset/reset-th1520.c
@@ -0,0 +1,135 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Author: Michal Wilczynski <m.wilczynski@samsung.com>
+ */
+
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/reset-controller.h>
+#include <linux/regmap.h>
+
+#include <dt-bindings/reset/thead,th1520-reset.h>
+
+ /* register offset in VOSYS_REGMAP */
+#define TH1520_GPU_RST_CFG		0x0
+#define TH1520_GPU_RST_CFG_MASK		GENMASK(1, 0)
+
+/* register values */
+#define TH1520_GPU_SW_GPU_RST		BIT(0)
+#define TH1520_GPU_SW_CLKGEN_RST	BIT(1)
+
+struct th1520_reset_priv {
+	struct reset_controller_dev rcdev;
+	struct regmap *map;
+};
+
+struct th1520_reset_map {
+	u32 bit;
+	u32 reg;
+};
+
+static const struct th1520_reset_map th1520_resets[] = {
+	[TH1520_RESET_ID_GPU] = {
+		.bit = TH1520_GPU_SW_GPU_RST,
+		.reg = TH1520_GPU_RST_CFG,
+	},
+	[TH1520_RESET_ID_GPU_CLKGEN] = {
+		.bit = TH1520_GPU_SW_CLKGEN_RST,
+		.reg = TH1520_GPU_RST_CFG,
+	}
+};
+
+static inline struct th1520_reset_priv *
+to_th1520_reset(struct reset_controller_dev *rcdev)
+{
+	return container_of(rcdev, struct th1520_reset_priv, rcdev);
+}
+
+static int th1520_reset_assert(struct reset_controller_dev *rcdev,
+			       unsigned long id)
+{
+	struct th1520_reset_priv *priv = to_th1520_reset(rcdev);
+	const struct th1520_reset_map *reset;
+
+	reset = &th1520_resets[id];
+
+	return regmap_update_bits(priv->map, reset->reg, reset->bit, 0);
+}
+
+static int th1520_reset_deassert(struct reset_controller_dev *rcdev,
+				 unsigned long id)
+{
+	struct th1520_reset_priv *priv = to_th1520_reset(rcdev);
+	const struct th1520_reset_map *reset;
+
+	reset = &th1520_resets[id];
+
+	return regmap_update_bits(priv->map, reset->reg, reset->bit,
+				  reset->bit);
+}
+
+static const struct reset_control_ops th1520_reset_ops = {
+	.assert	= th1520_reset_assert,
+	.deassert = th1520_reset_deassert,
+};
+
+static const struct regmap_config th1520_reset_regmap_config = {
+	.reg_bits = 32,
+	.val_bits = 32,
+	.reg_stride = 4,
+	.fast_io = true,
+};
+
+static int th1520_reset_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct th1520_reset_priv *priv;
+	void __iomem *base;
+	int ret;
+
+	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+	if (!priv)
+		return -ENOMEM;
+
+	base = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
+
+	priv->map = devm_regmap_init_mmio(dev, base,
+					  &th1520_reset_regmap_config);
+	if (IS_ERR(priv->map))
+		return PTR_ERR(priv->map);
+
+	/* Initialize GPU resets to asserted state */
+	ret = regmap_update_bits(priv->map, TH1520_GPU_RST_CFG,
+				 TH1520_GPU_RST_CFG_MASK, 0);
+	if (ret)
+		return ret;
+
+	priv->rcdev.owner = THIS_MODULE;
+	priv->rcdev.nr_resets = ARRAY_SIZE(th1520_resets);
+	priv->rcdev.ops = &th1520_reset_ops;
+	priv->rcdev.of_node = dev->of_node;
+
+	return devm_reset_controller_register(dev, &priv->rcdev);
+}
+
+static const struct of_device_id th1520_reset_match[] = {
+	{ .compatible = "thead,th1520-reset" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, th1520_reset_match);
+
+static struct platform_driver th1520_reset_driver = {
+	.driver = {
+		.name = "th1520-reset",
+		.of_match_table = th1520_reset_match,
+	},
+	.probe = th1520_reset_probe,
+};
+module_platform_driver(th1520_reset_driver);
+
+MODULE_AUTHOR("Michal Wilczynski <m.wilczynski@samsung.com>");
+MODULE_DESCRIPTION("T-HEAD TH1520 SoC reset controller");
+MODULE_LICENSE("GPL");
-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/2] dt-bindings: reset: Add T-HEAD TH1520 SoC Reset Controller
  2025-03-03 15:25     ` [PATCH v1 1/2] dt-bindings: reset: Add T-HEAD TH1520 SoC Reset Controller Michal Wilczynski
@ 2025-03-03 17:40       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2025-03-03 17:40 UTC (permalink / raw)
  To: Michal Wilczynski, robh, krzk+dt, conor+dt, drew, guoren, wefu,
	p.zabel, m.szyprowski
  Cc: devicetree, linux-kernel

On 03/03/2025 16:25, Michal Wilczynski wrote:
> Add a YAML schema for the T-HEAD TH1520 SoC reset controller. This
> controller manages resets for subsystems such as the GPU within the
> TH1520 SoC.
> 
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

You cannot get my review on v1, I never give review tags out of lists.

This is vN, like I suggested when I asked about splitting the patchset.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 0/2] TH1520 SoC: Add Reset Controller Support
  2025-03-03 15:25 ` [PATCH v1 0/2] TH1520 SoC: Add Reset Controller Support Michal Wilczynski
       [not found]   ` <CGME20250303152521eucas1p26c54c5b15c024d749cf004b66345d2e0@eucas1p2.samsung.com>
       [not found]   ` <CGME20250303152521eucas1p20128508eb79e20c1e124155beaf8fb4d@eucas1p2.samsung.com>
@ 2025-03-05  8:23   ` Michal Wilczynski
  2025-04-07 10:27     ` Philipp Zabel
  2025-04-07 10:30   ` Philipp Zabel
  3 siblings, 1 reply; 7+ messages in thread
From: Michal Wilczynski @ 2025-03-05  8:23 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, drew, guoren, wefu, p.zabel, m.szyprowski
  Cc: devicetree, linux-kernel



On 3/3/25 16:25, Michal Wilczynski wrote:
> This patch series adds reset controller support for the T-Head TH1520 SoC,
> which is used in boards like the LicheePi 4A. While part of a broader effort to
> enable the Imagination BXM-4-64 GPU upstream, these patches focus on providing
> a dedicated reset controller driver and the corresponding Device Tree
> nodes/bindings.
> 
> Bigger series cover letter:
> https://lore.kernel.org/all/20250219140239.1378758-1-m.wilczynski@samsung.com/


This series should be versioned as v6, to maintain continuity with the
bigger patchset it is a subseries of. Please find below a changelog for
the reset sub-series:

v6:
 - split the reset part into sub-series, add the Reviewed-by from
   Philipp

v5:
 - Moved the reset de-assertion from the reset driver to the clock driver. The
   reset is now only de-asserted once the sys and core clocks have been enabled
 - Added and exported the GPU_CLKGEN reset, allowing the clock driver to reset
   the GPU clock circuit

v4:
 - reverted reset-cells configuration to single cell as in v2
 - maintained reset definitions in device tree bindings while deferring
   implementation of watchdog timer (WDT) reset functionality

v3:
 - refactored reset driver to use zero cells

v2:
 - developed a reset controller driver for the TH1520 to manage reset
   sequences
 - added new dt-bindings for reset

> 
> Michal Wilczynski (2):
>   dt-bindings: reset: Add T-HEAD TH1520 SoC Reset Controller
>   reset: thead: Add TH1520 reset controller driver
> 
>  .../bindings/reset/thead,th1520-reset.yaml    |  44 ++++++
>  MAINTAINERS                                   |   3 +
>  drivers/reset/Kconfig                         |  10 ++
>  drivers/reset/Makefile                        |   1 +
>  drivers/reset/reset-th1520.c                  | 135 ++++++++++++++++++
>  .../dt-bindings/reset/thead,th1520-reset.h    |  16 +++
>  6 files changed, 209 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml
>  create mode 100644 drivers/reset/reset-th1520.c
>  create mode 100644 include/dt-bindings/reset/thead,th1520-reset.h
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 0/2] TH1520 SoC: Add Reset Controller Support
  2025-03-05  8:23   ` [PATCH v1 0/2] TH1520 SoC: Add Reset Controller Support Michal Wilczynski
@ 2025-04-07 10:27     ` Philipp Zabel
  0 siblings, 0 replies; 7+ messages in thread
From: Philipp Zabel @ 2025-04-07 10:27 UTC (permalink / raw)
  To: Michal Wilczynski, robh, krzk+dt, conor+dt, drew, guoren, wefu,
	m.szyprowski
  Cc: devicetree, linux-kernel

On Mi, 2025-03-05 at 09:23 +0100, Michal Wilczynski wrote:
> 
> On 3/3/25 16:25, Michal Wilczynski wrote:
> > This patch series adds reset controller support for the T-Head TH1520 SoC,
> > which is used in boards like the LicheePi 4A. While part of a broader effort to
> > enable the Imagination BXM-4-64 GPU upstream, these patches focus on providing
> > a dedicated reset controller driver and the corresponding Device Tree
> > nodes/bindings.
> > 
> > Bigger series cover letter:
> > https://lore.kernel.org/all/20250219140239.1378758-1-m.wilczynski@samsung.com/
> 
> 
> This series should be versioned as v6, to maintain continuity with the
> bigger patchset it is a subseries of. Please find below a changelog for
> the reset sub-series:
> 
> v6:
>  - split the reset part into sub-series, add the Reviewed-by from
>    Philipp

FTR, I'll apply this as v6. I've checked differences to v5 semi-
manually - the changes are not listed in the changelog, but they are
what I suggested:

----------8<----------
$ b4 am -T 20250219140239.1378758-1-m.wilczynski@samsung.com
$ b4 am -T 20250303152511.494405-1-m.wilczynski@samsung.com
$ b4 diff -m v5_20250219_m_wilczynski_enable_drm_imagination_bxm_4_64_support_for_licheepi_4a.mbx \
             20250303_m_wilczynski_th1520_soc_add_reset_controller_support.mbx

 1:  0394b6a226519 <  -:  ------------- dt-bindings: clock: thead: Add TH1520 VO clock controller
 2:  bd073ef5d8100 <  -:  ------------- clk: thead: Add clock support for VO subsystem in T-Head TH1520 SoC
 3:  bbfd6b84574eb <  -:  ------------- dt-bindings: firmware: thead,th1520: Add support for firmware node
 4:  9fa4a7c315420 <  -:  ------------- firmware: thead: Add AON firmware protocol driver
 5:  5775fe10945af <  -:  ------------- dt-bindings: power: Add TH1520 SoC power domains
 6:  501c3260c8060 <  -:  ------------- pmdomain: thead: Add power-domain driver for TH1520
 7:  67191981e2bd2 <  -:  ------------- riscv: Enable PM_GENERIC_DOMAINS for T-Head SoCs
 8:  e866e1039b1f1 <  -:  ------------- clk: thead: Add support for custom ops in CCU_GATE_CLK_OPS macro
 9:  73b7c8a74dfc6 <  -:  ------------- dt-bindings: clock: thead: Add GPU clkgen reset property
10:  116940381d1a3 <  -:  ------------- clk: thead: Add GPU clock gate control with CLKGEN reset support
11:  6ed636028a35c =  1:  cc4aca290ed6a dt-bindings: reset: Add T-HEAD TH1520 SoC Reset Controller
12:  49eee8a9fa0b1 !  2:  34edd507ac54b reset: thead: Add TH1520 reset controller driver
    @@ Commit message
         implements support for GPU reset control, with infrastructure in place
         to extend support for NPU and Watchdog Timer resets in future updates.
     
    +    Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
         Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
     
      ## MAINTAINERS ##
    @@ drivers/reset/reset-th1520.c (new)
     +	struct th1520_reset_priv *priv = to_th1520_reset(rcdev);
     +	const struct th1520_reset_map *reset;
     +
    -+	if (id >= ARRAY_SIZE(th1520_resets))
    -+		return -EINVAL;
    -+
     +	reset = &th1520_resets[id];
     +
     +	return regmap_update_bits(priv->map, reset->reg, reset->bit, 0);
    @@ drivers/reset/reset-th1520.c (new)
     +	struct th1520_reset_priv *priv = to_th1520_reset(rcdev);
     +	const struct th1520_reset_map *reset;
     +
    -+	if (id >= ARRAY_SIZE(th1520_resets))
    -+		return -EINVAL;
    -+
     +	reset = &th1520_resets[id];
     +
     +	return regmap_update_bits(priv->map, reset->reg, reset->bit,
    @@ drivers/reset/reset-th1520.c (new)
     +		return ret;
     +
     +	priv->rcdev.owner = THIS_MODULE;
    -+	priv->rcdev.nr_resets = 2;
    ++	priv->rcdev.nr_resets = ARRAY_SIZE(th1520_resets);
     +	priv->rcdev.ops = &th1520_reset_ops;
     +	priv->rcdev.of_node = dev->of_node;
     +
13:  5b3a5c4e99c6e <  -:  ------------- drm/imagination: Add reset controller support for GPU initialization
14:  8175d1ae71f27 <  -:  ------------- dt-bindings: gpu: Add 'resets' property for GPU initialization
15:  37258df02d9f5 <  -:  ------------- dt-bindings: gpu: Add support for T-HEAD TH1520 GPU
16:  0da2bcc589f4e <  -:  ------------- drm/imagination: Add support for IMG BXM-4-64 GPU
17:  4a130662031ab <  -:  ------------- drm/imagination: Enable PowerVR driver for RISC-V
18:  96435f063bc3f <  -:  ------------- riscv: dts: thead: Add device tree VO clock controller
19:  d8734c51119f5 <  -:  ------------- riscv: dts: thead: Introduce power domain nodes with aon firmware
20:  bbd2819cbd342 <  -:  ------------- riscv: dts: thead: Introduce reset controller node
21:  b22cf01230932 <  -:  ------------- riscv: dts: thead: Add GPU node to TH1520 device tree
---------->8----------

regards
Philipp

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 0/2] TH1520 SoC: Add Reset Controller Support
  2025-03-03 15:25 ` [PATCH v1 0/2] TH1520 SoC: Add Reset Controller Support Michal Wilczynski
                     ` (2 preceding siblings ...)
  2025-03-05  8:23   ` [PATCH v1 0/2] TH1520 SoC: Add Reset Controller Support Michal Wilczynski
@ 2025-04-07 10:30   ` Philipp Zabel
  3 siblings, 0 replies; 7+ messages in thread
From: Philipp Zabel @ 2025-04-07 10:30 UTC (permalink / raw)
  To: Michal Wilczynski, robh, krzk+dt, conor+dt, drew, guoren, wefu,
	m.szyprowski
  Cc: devicetree, linux-kernel

On Mo, 2025-03-03 at 16:25 +0100, Michal Wilczynski wrote:
> This patch series adds reset controller support for the T-Head TH1520 SoC,
> which is used in boards like the LicheePi 4A. While part of a broader effort to
> enable the Imagination BXM-4-64 GPU upstream, these patches focus on providing
> a dedicated reset controller driver and the corresponding Device Tree
> nodes/bindings.
> 
> Bigger series cover letter:
> https://lore.kernel.org/all/20250219140239.1378758-1-m.wilczynski@samsung.com/
> 
> Michal Wilczynski (2):
>   dt-bindings: reset: Add T-HEAD TH1520 SoC Reset Controller
>   reset: thead: Add TH1520 reset controller driver
> 
>  .../bindings/reset/thead,th1520-reset.yaml    |  44 ++++++
>  MAINTAINERS                                   |   3 +
>  drivers/reset/Kconfig                         |  10 ++
>  drivers/reset/Makefile                        |   1 +
>  drivers/reset/reset-th1520.c                  | 135 ++++++++++++++++++
>  .../dt-bindings/reset/thead,th1520-reset.h    |  16 +++
>  6 files changed, 209 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml
>  create mode 100644 drivers/reset/reset-th1520.c
>  create mode 100644 include/dt-bindings/reset/thead,th1520-reset.h

Applied to reset/next, thanks!

[1/2] dt-bindings: reset: Add T-HEAD TH1520 SoC Reset Controller
      https://git.pengutronix.de/cgit/pza/linux/commit/?id=30e7573babdc
[2/2] reset: thead: Add TH1520 reset controller driver
      https://git.pengutronix.de/cgit/pza/linux/commit/?id=4a65326311ab

regards
Philipp


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-04-07 10:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20250303152520eucas1p250f2e6d8eaf1172d8813b04ceb88679c@eucas1p2.samsung.com>
2025-03-03 15:25 ` [PATCH v1 0/2] TH1520 SoC: Add Reset Controller Support Michal Wilczynski
     [not found]   ` <CGME20250303152521eucas1p26c54c5b15c024d749cf004b66345d2e0@eucas1p2.samsung.com>
2025-03-03 15:25     ` [PATCH v1 1/2] dt-bindings: reset: Add T-HEAD TH1520 SoC Reset Controller Michal Wilczynski
2025-03-03 17:40       ` Krzysztof Kozlowski
     [not found]   ` <CGME20250303152521eucas1p20128508eb79e20c1e124155beaf8fb4d@eucas1p2.samsung.com>
2025-03-03 15:25     ` [PATCH v1 2/2] reset: thead: Add TH1520 reset controller driver Michal Wilczynski
2025-03-05  8:23   ` [PATCH v1 0/2] TH1520 SoC: Add Reset Controller Support Michal Wilczynski
2025-04-07 10:27     ` Philipp Zabel
2025-04-07 10:30   ` Philipp Zabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®