[PATCH 1/3] dt-bindings: reset: Document reset controller of Loongson 2K0300 SoC

Yao Zi posted 3 patches 1 month, 2 weeks ago
[PATCH 1/3] dt-bindings: reset: Document reset controller of Loongson 2K0300 SoC
Posted by Yao Zi 1 month, 2 weeks ago
Add bindings for the reset controller of Loongson 2K0300 SoC.

Signed-off-by: Yao Zi <ziyao@disroot.org>
---
 .../reset/loongson,ls2k0300-reset.yaml        | 35 ++++++++++
 .../reset/loongson,ls2k0300-reset.h           | 70 +++++++++++++++++++
 2 files changed, 105 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/loongson,ls2k0300-reset.yaml
 create mode 100644 include/dt-bindings/reset/loongson,ls2k0300-reset.h

diff --git a/Documentation/devicetree/bindings/reset/loongson,ls2k0300-reset.yaml b/Documentation/devicetree/bindings/reset/loongson,ls2k0300-reset.yaml
new file mode 100644
index 000000000000..23c90b892673
--- /dev/null
+++ b/Documentation/devicetree/bindings/reset/loongson,ls2k0300-reset.yaml
@@ -0,0 +1,35 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/reset/loongson,ls2k0300-reset.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Loongson 2K0300 SoC Reset Controller
+
+maintainers:
+  - Yao Zi <ziyao@disroot.org>
+
+properties:
+  compatible:
+    const: loongson,ls2k0300-reset
+
+  reg:
+    maxItems: 1
+
+  "#reset-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+  - "#reset-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    rst: reset-controller@1600011c {
+        compatible = "loongson,ls2k0300-reset";
+        reg = <0x1600011c 0x8>;
+        #reset-cells = <1>;
+    };
diff --git a/include/dt-bindings/reset/loongson,ls2k0300-reset.h b/include/dt-bindings/reset/loongson,ls2k0300-reset.h
new file mode 100644
index 000000000000..d425411e6d19
--- /dev/null
+++ b/include/dt-bindings/reset/loongson,ls2k0300-reset.h
@@ -0,0 +1,70 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+/*
+ * Copyright (C) 2025 Yao Zi <ziyao@disroot.org>
+ */
+#ifndef _DT_BINDINGS_RESET_LOONGSON_LS2K0300_H_
+#define _DT_BINDINGS_RESET_LOONGSON_LS2K0300_H_
+
+#define RST_DDR			0
+#define RST_SPI0		1
+#define RST_SPI1		2
+#define RST_LIO			3
+#define RST_DC			4
+#define RST_GMAC0		5
+#define RST_GMAC1		6
+#define RST_USBM		7
+#define RST_USB			8
+#define RST_OTG			9
+#define RST_GPIO		10
+#define RST_I2S			11
+#define RST_ADC			12
+#define RST_WDT			13
+#define RST_RTC			14
+#define RST_OTP			15
+#define RST_DMA			16
+#define RST_SPI2		17
+#define RST_SPI3		18
+#define RST_CAN0		19
+#define RST_CAN1		20
+#define RST_CAN2		21
+#define RST_CAN3		22
+#define RST_I2C0		23
+#define RST_I2C1		24
+#define RST_I2C2		25
+#define RST_I2C3		26
+#define RST_HPET0		27
+#define RST_HPET1		28
+#define RST_HPET2		29
+#define RST_HPET3		30
+#define RST_ATIMER		31
+#define RST_GTIMER		32
+#define RST_BTIMER		33
+#define RST_PWM			34
+#define RST_UART0		35
+#define RST_UART1		36
+#define RST_UART2		37
+#define RST_UART3		38
+#define RST_UART4		39
+#define RST_UART5		40
+#define RST_UART6		41
+#define RST_UART7		42
+#define RST_UART8		43
+#define RST_UART9		44
+#define RST_SDIO0		45
+#define RST_SDIO1		46
+#define RST_CANBUF0		47
+#define RST_CANBUF1		48
+#define RST_CANBUF2		49
+#define RST_CANBUF3		50
+#define RST_CANRAM		51
+#define RST_ENCDMA		52
+#define RST_SM2			53
+#define RST_RNG			54
+#define RST_AES			55
+#define RST_DES			56
+#define RST_SM3			57
+#define RST_SM4			58
+#define RST_SDIOM		59
+#define RST_APBM		60
+
+#endif /* _DT_BINDINGS_RESET_LOONGSON_LS2K0300_H_ */
-- 
2.50.1
Re: [PATCH 1/3] dt-bindings: reset: Document reset controller of Loongson 2K0300 SoC
Posted by Krzysztof Kozlowski 1 month, 2 weeks ago
On 16/08/2025 05:33, Yao Zi wrote:
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    rst: reset-controller@1600011c {

Drop unused label


> +        compatible = "loongson,ls2k0300-reset";
> +        reg = <0x1600011c 0x8>;
> +        #reset-cells = <1>;
> +    };
> diff --git a/include/dt-bindings/reset/loongson,ls2k0300-reset.h b/include/dt-bindings/reset/loongson,ls2k0300-reset.h
> new file mode 100644
> index 000000000000..d425411e6d19
> --- /dev/null
> +++ b/include/dt-bindings/reset/loongson,ls2k0300-reset.h
> @@ -0,0 +1,70 @@
> +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */

Why not using same license as the binding?


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
Re: [PATCH 1/3] dt-bindings: reset: Document reset controller of Loongson 2K0300 SoC
Posted by Yao Zi 1 month, 2 weeks ago
On Sat, Aug 16, 2025 at 11:48:46AM +0200, Krzysztof Kozlowski wrote:
> On 16/08/2025 05:33, Yao Zi wrote:
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    rst: reset-controller@1600011c {
> 
> Drop unused label
> 
> 
> > +        compatible = "loongson,ls2k0300-reset";
> > +        reg = <0x1600011c 0x8>;
> > +        #reset-cells = <1>;
> > +    };
> > diff --git a/include/dt-bindings/reset/loongson,ls2k0300-reset.h b/include/dt-bindings/reset/loongson,ls2k0300-reset.h
> > new file mode 100644
> > index 000000000000..d425411e6d19
> > --- /dev/null
> > +++ b/include/dt-bindings/reset/loongson,ls2k0300-reset.h
> > @@ -0,0 +1,70 @@
> > +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
> 
> Why not using same license as the binding?

I was referring to another binding's header when writing this, and yes
it's better to keep them the same.

> 
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Will fix these issues and carry the tag in v2, thanks.

> Best regards,
> Krzysztof

Best regards,
Yao Zi