2023-06-30 12:40:20

by zelong dong

[permalink] [raw]
Subject: [PATCH 0/3] reset: meson-c3: add reset driver

From: Zelong Dong <[email protected]>

This patchset adds Reset controller driver support for Meson-C3 SoC.
The RESET registers count and offset for C3 Soc are same as S4 Soc.


Zelong Dong (3):
dt-bindings: reset: Add compatible and DT bindings for Meson-C3 Reset
Controller
reset: reset-meson: add support for the Meson-C3 SoC Reset Controller
arm64: dts: meson: add reset controller for Meson-C3 SoC

.../bindings/reset/amlogic,meson-reset.yaml | 1 +
arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi | 7 ++
drivers/reset/reset-meson.c | 1 +
.../reset/amlogic,meson-c3-reset.h | 119 ++++++++++++++++++
4 files changed, 128 insertions(+)
create mode 100644 include/dt-bindings/reset/amlogic,meson-c3-reset.h

--
2.35.1



2023-06-30 12:42:09

by zelong dong

[permalink] [raw]
Subject: [PATCH 3/3] arm64: dts: meson: add reset controller for Meson-C3 SoC

From: Zelong Dong <[email protected]>

Add the reset controller device of Meson-C3 SoC family

Signed-off-by: Zelong Dong <[email protected]>
---
arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
index 60ad4f3eef9d..62684b7a684c 100644
--- a/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
+++ b/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
@@ -6,6 +6,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/reset/amlogic,meson-c3-reset.h>

/ {
cpus {
@@ -82,6 +83,12 @@ uart_b: serial@7a000 {
clock-names = "xtal", "pclk", "baud";
};

+ reset: reset-controller@0x2000 {
+ compatible = "amlogic,meson-c3-reset";
+ reg = <0x0 0x2000 0x0 0x98>;
+ #reset-cells = <1>;
+ };
+
};
};
};
--
2.35.1


2023-06-30 16:30:34

by Dmitry Rokosov

[permalink] [raw]
Subject: Re: [PATCH 3/3] arm64: dts: meson: add reset controller for Meson-C3 SoC

Hello Zelong,

Thanks a lot for the patch, please find my comments below.

On Fri, Jun 30, 2023 at 08:10:59PM +0800, zelong dong wrote:
> From: Zelong Dong <[email protected]>
>
> Add the reset controller device of Meson-C3 SoC family
>
> Signed-off-by: Zelong Dong <[email protected]>
> ---
> arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
> index 60ad4f3eef9d..62684b7a684c 100644
> --- a/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
> @@ -6,6 +6,7 @@
> #include <dt-bindings/interrupt-controller/irq.h>
> #include <dt-bindings/interrupt-controller/arm-gic.h>
> #include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/reset/amlogic,meson-c3-reset.h>
>
> / {
> cpus {
> @@ -82,6 +83,12 @@ uart_b: serial@7a000 {
> clock-names = "xtal", "pclk", "baud";
> };
>
> + reset: reset-controller@0x2000 {
> + compatible = "amlogic,meson-c3-reset";
> + reg = <0x0 0x2000 0x0 0x98>;
> + #reset-cells = <1>;
> + };
> +

As Martin mentioned in the my review, internal apb entries should be
sorted by base reg offset. So reset-controller must be located before
uart_b.

Please refer to:

https://lore.kernel.org/linux-amlogic/CAFBinCAO14zcgY66UyJO9UxuCWf1N-Lsx=iYNTJL=cwXoJv__Q@mail.gmail.com/

> };
> };
> };
> --
> 2.35.1
>
>
> _______________________________________________
> linux-amlogic mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/linux-amlogic

--
Thank you,
Dmitry

2023-06-30 16:43:19

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 3/3] arm64: dts: meson: add reset controller for Meson-C3 SoC

On 30/06/2023 14:10, zelong dong wrote:
> From: Zelong Dong <[email protected]>
>
> Add the reset controller device of Meson-C3 SoC family
>
> Signed-off-by: Zelong Dong <[email protected]>
> ---
> arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
> index 60ad4f3eef9d..62684b7a684c 100644
> --- a/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
> @@ -6,6 +6,7 @@
> #include <dt-bindings/interrupt-controller/irq.h>
> #include <dt-bindings/interrupt-controller/arm-gic.h>
> #include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/reset/amlogic,meson-c3-reset.h>
>
> / {
> cpus {
> @@ -82,6 +83,12 @@ uart_b: serial@7a000 {
> clock-names = "xtal", "pclk", "baud";
> };
>
> + reset: reset-controller@0x2000 {

Please drop 0x, the node name should be: reset-controller@2000

Thanks,
Neil

> + compatible = "amlogic,meson-c3-reset";
> + reg = <0x0 0x2000 0x0 0x98>;
> + #reset-cells = <1>;
> + };
> +
> };
> };
> };