Skip to contentSkip to conversation

reset: amlogic-c3: add reset driver

PATCH Applied zelong dong 3 participants 10 messages Sep 14, 2023 – Dec 19, 2023

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

v4 cover reset: amlogic-c3: add reset driver

From: Zelong Dong <[email protected]>

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

Changes since v1:
- remove Change-ID
- run scripts/checkpatch.pl and fix reported warnings
- sort dts node by base reg offset

Changes since v2:
- replace keyword "meson" with "amlogic"

Changes since v3:
- rebase on v6.6-rc1

---
v1:https://lore.kernel.org/all/[email protected]/ v2:https://lore.kernel.org/all/[email protected]/ v3:https://lore.kernel.org/all/[email protected]/

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

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

PATCH v4 1/3 dt-bindings: reset: Add compatible and DT bindings for Amlogic C3 Reset Controller

From: Zelong Dong <[email protected]>

Add new compatible and DT bindings for Amlogic C3 Reset Controller

---
 .../bindings/reset/amlogic,meson-reset.yaml   |   1 +
 include/dt-bindings/reset/amlogic,c3-reset.h  | 119 ++++++++++++++++++
 2 files changed, 120 insertions(+)
 create mode 100644 include/dt-bindings/reset/amlogic,c3-reset.h
Documentation/devicetree/bindings/reset/amlogic,meson-reset.yaml +1 -0
index d3fdee89d4f8..f0c6c0df0ce3 100644
@@ -18,6 +18,7 @@ properties:
       - amlogic,meson-axg-reset # Reset Controller on AXG and compatible SoCs
       - amlogic,meson-a1-reset # Reset Controller on A1 and compatible SoCs
       - amlogic,meson-s4-reset # Reset Controller on S4 and compatible SoCs
+      - amlogic,c3-reset # Reset Controller on C3 and compatible SoCs
 
   reg:
     maxItems: 1
include/dt-bindings/reset/amlogic,c3-reset.h new file +119 -0

119 lines not on this page · raw message

Signature · 1 line
2.35.1
maintainer Reviewed-by on v4 1/3
#2 lore raw

Re: [PATCH v4 1/3] dt-bindings: reset: Add compatible and DT bindings for Amlogic C3 Reset Controller

Quoted 141 lines · zelong dong

From: Zelong Dong <[email protected]>

Add new compatible and DT bindings for Amlogic C3 Reset Controller

---
  .../bindings/reset/amlogic,meson-reset.yaml   |   1 +
  include/dt-bindings/reset/amlogic,c3-reset.h  | 119 ++++++++++++++++++
  2 files changed, 120 insertions(+)

create mode 100644 include/dt-bindings/reset/amlogic,c3-reset.h

Documentation/devicetree/bindings/reset/amlogic,meson-reset.yaml +1 -0
index d3fdee89d4f8..f0c6c0df0ce3 100644
@@ -18,6 +18,7 @@ properties:
        - amlogic,meson-axg-reset # Reset Controller on AXG and compatible SoCs
        - amlogic,meson-a1-reset # Reset Controller on A1 and compatible SoCs
        - amlogic,meson-s4-reset # Reset Controller on S4 and compatible SoCs
+      - amlogic,c3-reset # Reset Controller on C3 and compatible SoCs
 
    reg:
      maxItems: 1
include/dt-bindings/reset/amlogic,c3-reset.h new file +109 -0
new file mode 100644
index 000000000000..d9127863f603
@@ -0,0 +1,119 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+/*
+ * Copyright (c) 2023 Amlogic, Inc. All rights reserved.
+ */
+
+#ifndef _DT_BINDINGS_AMLOGIC_C3_RESET_H
+#define _DT_BINDINGS_AMLOGIC_C3_RESET_H
+
+/* RESET0 */
+/*						0-3 */
+#define RESET_USBCTRL				4
+/*						5-7 */
+#define RESET_USBPHY20				8
+/*						9 */
+#define RESET_USB2DRD				10
+#define RESET_MIPI_DSI_HOST			11
+#define RESET_MIPI_DSI_PHY			12
+/*						13-20 */
+#define RESET_GE2D				21
+#define RESET_DWAP				22
+/*						23-31 */
+
+/* RESET1 */
+#define RESET_AUDIO				32
+/*						33-34 */
+#define RESET_DDRAPB				35
+#define RESET_DDR				36
+#define RESET_DOS_CAPB3				37
+#define RESET_DOS				38
+/*						39-46 */
+#define RESET_NNA				47
+#define RESET_ETHERNET				48
+#define RESET_ISP				49
+#define RESET_VC9000E_APB			50
+#define RESET_VC9000E_A				51
+/*						52 */
+#define RESET_VC9000E_CORE			53
+/*						54-63 */
+
+/* RESET2 */
+#define RESET_ABUS_ARB				64
+#define RESET_IRCTRL				65
+/*						66 */
+#define RESET_TEMP_PII				67
+/*						68-72 */
+#define RESET_SPICC_0				73
+#define RESET_SPICC_1				74
+#define RESET_RSA				75
+
+/*						76-79 */
+#define RESET_MSR_CLK				80
+#define RESET_SPIFC				81
+#define RESET_SAR_ADC				82
+/*						83-87 */
+#define RESET_ACODEC				88
+/*						89-90 */
+#define RESET_WATCHDOG				91
+/*						92-95 */
+
+/* RESET3 */
+#define RESET_ISP_NIC_GPV			96
+#define RESET_ISP_NIC_MAIN			97
+#define RESET_ISP_NIC_VCLK			98
+#define RESET_ISP_NIC_VOUT			99
+#define RESET_ISP_NIC_ALL			100
+#define RESET_VOUT				101
+#define RESET_VOUT_VENC				102
+/*						103 */
+#define RESET_CVE_NIC_GPV			104
+#define RESET_CVE_NIC_MAIN			105
+#define RESET_CVE_NIC_GE2D			106
+#define RESET_CVE_NIC_DW			106
+#define RESET_CVE_NIC_CVE			108
+#define RESET_CVE_NIC_ALL			109
+#define RESET_CVE				110
+/*						112-127 */
+
+/* RESET4 */
+#define RESET_RTC				128
+#define RESET_PWM_AB				129
+#define RESET_PWM_CD				130
+#define RESET_PWM_EF				131
+#define RESET_PWM_GH				132
+#define RESET_PWM_IJ				133
+#define RESET_PWM_KL				134
+#define RESET_PWM_MN				135
+/*						136-137 */
+#define RESET_UART_A				138
+#define RESET_UART_B				139
+#define RESET_UART_C				140
+#define RESET_UART_D				141
+#define RESET_UART_E				142
+#define RESET_UART_F				143
+#define RESET_I2C_S_A				144
+#define RESET_I2C_M_A				145
+#define RESET_I2C_M_B				146
+#define RESET_I2C_M_C				147
+#define RESET_I2C_M_D				148
+/*						149-151 */
+#define RESET_SD_EMMC_A				152
+#define RESET_SD_EMMC_B				153
+#define RESET_SD_EMMC_C				154
+
+/* RESET5 */
+/*						160-172 */
+#define RESET_BRG_NIC_NNA			173
+#define RESET_BRG_MUX_NIC_MAIN			174
+#define RESET_BRG_AO_NIC_ALL			175
+/*						176-183 */

include/dt-bindings/reset/amlogic,c3-reset.h line 119

Quoted 10 lines
include/dt-bindings/reset/amlogic,c3-reset.h new file +10 -0
+#define RESET_BRG_NIC_VAPB			184
+#define RESET_BRG_NIC_SDIO_B			185
+#define RESET_BRG_NIC_SDIO_A			186
+#define RESET_BRG_NIC_EMMC			187
+#define RESET_BRG_NIC_DSU			188
+#define RESET_BRG_NIC_SYSCLK			189
+#define RESET_BRG_NIC_MAIN			190
+#define RESET_BRG_NIC_ALL			191
+
+#endif
#3 lore raw

PATCH v4 2/3 reset: reset-meson: add support for Amlogic C3 SoC Reset Controller

In reply to zelong dong

From: Zelong Dong <[email protected]>

Add a new compatible string to support for the reset controller on the C3 SoC. The count and offset for C3 Soc RESET registers are same as S4 Soc.

---
 drivers/reset/reset-meson.c | 1 +
 1 file changed, 1 insertion(+)
drivers/reset/reset-meson.c +1 -0
index a7af051b17fb..f78be97898bc 100644
@@ -108,6 +108,7 @@ static const struct of_device_id meson_reset_dt_ids[] = {
 	 { .compatible = "amlogic,meson-axg-reset",  .data = &meson8b_param},
 	 { .compatible = "amlogic,meson-a1-reset",   .data = &meson_a1_param},
 	 { .compatible = "amlogic,meson-s4-reset",   .data = &meson_s4_param},
+	 { .compatible = "amlogic,c3-reset",   .data = &meson_s4_param},
 	 { /* sentinel */ },
 };
 MODULE_DEVICE_TABLE(of, meson_reset_dt_ids);
Signature · 1 line
2.35.1
maintainer Reviewed-by on v4 2/3
#4 lore raw

Re: [PATCH v4 2/3] reset: reset-meson: add support for Amlogic C3 SoC Reset Controller

Quoted 18 lines · zelong dong

From: Zelong Dong <[email protected]>

Add a new compatible string to support for the reset controller on the C3 SoC. The count and offset for C3 Soc RESET registers are same as S4 Soc.

---
  drivers/reset/reset-meson.c | 1 +
  1 file changed, 1 insertion(+)
drivers/reset/reset-meson.c +0 -0
index a7af051b17fb..f78be97898bc 100644

drivers/reset/reset-meson.c static const struct of_device_id meson_reset_dt_ids[] = { · line 114

Quoted 7 lines
drivers/reset/reset-meson.c +1 -0
@@ -108,6 +108,7 @@ static const struct of_device_id meson_reset_dt_ids[] = {
  	 { .compatible = "amlogic,meson-axg-reset",  .data = &meson8b_param},
  	 { .compatible = "amlogic,meson-a1-reset",   .data = &meson_a1_param},
  	 { .compatible = "amlogic,meson-s4-reset",   .data = &meson_s4_param},
+	 { .compatible = "amlogic,c3-reset",   .data = &meson_s4_param},
  	 { /* sentinel */ },
  };
  MODULE_DEVICE_TABLE(of, meson_reset_dt_ids);
#5 lore raw

PATCH v4 3/3 arm64: dts: amlogic: add reset controller for Amlogic C3 SoC

In reply to zelong dong

From: Zelong Dong <[email protected]>

Add the reset controller device of Amlogic C3 SoC family

---
 arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi +7 -0
index 998f5050795c..d086bfab3228 100644
@@ -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,c3-reset.h>
 
 / {
 	cpus {
@@ -81,6 +82,12 @@ apb4: bus@fe000000 {
 			#size-cells = <2>;
 			ranges = <0x0 0x0 0x0 0xfe000000 0x0 0x480000>;
 
+			reset: reset-controller@2000 {
+				compatible = "amlogic,c3-reset";
+				reg = <0x0 0x2000 0x0 0x98>;
+				#reset-cells = <1>;
+			};
+
 			periphs_pinctrl: pinctrl@4000 {
 				compatible = "amlogic,c3-periphs-pinctrl";
 				#address-cells = <2>;
Signature · 1 line
2.35.1
maintainer Reviewed-by on v4 3/3
#6 lore raw

Re: [PATCH v4 3/3] arm64: dts: amlogic: add reset controller for Amlogic C3 SoC

Quoted 25 lines · zelong dong

From: Zelong Dong <[email protected]>

Add the reset controller device of Amlogic C3 SoC family

---
  arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi | 7 +++++++
  1 file changed, 7 insertions(+)
arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi +1 -0
index 998f5050795c..d086bfab3228 100644
@@ -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,c3-reset.h>
 
  / {
  	cpus {
@@ -81,6 +82,12 @@ apb4: bus@fe000000 {
  			#size-cells = <2>;
  			ranges = <0x0 0x0 0x0 0xfe000000 0x0 0x480000>;

arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi apb4: bus@fe000000 { · line 93

Quoted 10 lines
arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi +6 -0
 
+			reset: reset-controller@2000 {
+				compatible = "amlogic,c3-reset";
+				reg = <0x0 0x2000 0x0 0x98>;
+				#reset-cells = <1>;
+			};
+
  			periphs_pinctrl: pinctrl@4000 {
  				compatible = "amlogic,c3-periphs-pinctrl";
  				#address-cells = <2>;
maintainer Applied
#7 lore raw
In reply to zelong dong
Quoted 11 lines · zelong dong

From: Zelong Dong <[email protected]>

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

Changes since v1:
- remove Change-ID
- run scripts/checkpatch.pl and fix reported warnings
- sort dts node by base reg offset

[...]

Applied patches 1 and 2 to reset/next, thanks!

[1/3] dt-bindings: reset: Add compatible and DT bindings for Amlogic C3 Reset Controller

      https://git.pengutronix.de/cgit/pza/linux/commit/?id=0c0ea61c9b3a
[2/3] reset: reset-meson: add support for Amlogic C3 SoC Reset Controller
      https://git.pengutronix.de/cgit/pza/linux/commit/?id=41df5d7d5e99

regards
Philipp

maintainer Applied
#8 lore raw

Re: (subset) [PATCH v4 0/3] reset: amlogic-c3: add reset driver

In reply to zelong dong

Hi,

Quoted 11 lines · zelong dong

From: Zelong Dong <[email protected]>

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

Changes since v1:
- remove Change-ID
- run scripts/checkpatch.pl and fix reported warnings
- sort dts node by base reg offset

[...]

Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (v6.8/arm64-dt)

[3/3] arm64: dts: amlogic: add reset controller for Amlogic C3 SoC

      https://git.kernel.org/amlogic/c/a5468f5ea9a01acf29d02745abae7b82482989d4

These changes has been applied on the intermediate git tree [1].

The v6.8/arm64-dt branch will then be sent via a formal Pull Request to the Linux SoC maintainers for inclusion in their intermediate git branches in order to be sent to Linus during the next merge window, or sooner if it's a set of fixes.

In the cases of fixes, those will be merged in the current release candidate kernel and as soon they appear on the Linux master branch they will be backported to the previous Stable and Long-Stable kernels [2].

The intermediate git branches are merged daily in the linux-next tree [3], people are encouraged testing these pre-release kernels and report issues on the relevant mailing-lists.

If problems are discovered on those changes, please submit a signed-off-by revert patch followed by a corrective changeset.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
[3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

Signature · 1 line
Neil
maintainer
#9 lore raw

Re: (subset) [PATCH v4 0/3] reset: amlogic-c3: add reset driver

Hi,

Quoted 13 lines · Neil Armstrong

Hi,

Quoted 10 lines · zelong dong

From: Zelong Dong <[email protected]>

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

Changes since v1:
- remove Change-ID
- run scripts/checkpatch.pl and fix reported warnings
- sort dts node by base reg offset

Quoted 6 lines
Quoted 1 line

[...]

Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (v6.8/arm64-dt)

[3/3] arm64: dts: amlogic: add reset controller for Amlogic C3 SoC

       https://git.kernel.org/amlogic/c/a5468f5ea9a01acf29d02745abae7b82482989d4

I'll need to drop this patch from v6.8/arm64-dt since the amlogic,c3-reset.h is missing from my tree, I'll postpone it to v6.9.

Thanks,
Neil

Quoted 22 lines

These changes has been applied on the intermediate git tree [1].

The v6.8/arm64-dt branch will then be sent via a formal Pull Request to the Linux SoC maintainers for inclusion in their intermediate git branches in order to be sent to Linus during the next merge window, or sooner if it's a set of fixes.

In the cases of fixes, those will be merged in the current release candidate kernel and as soon they appear on the Linux master branch they will be backported to the previous Stable and Long-Stable kernels [2].

The intermediate git branches are merged daily in the linux-next tree [3], people are encouraged testing these pre-release kernels and report issues on the relevant mailing-lists.

If problems are discovered on those changes, please submit a signed-off-by revert patch followed by a corrective changeset.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
[3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git