Skip to contentSkip to conversation

clk: rockchip: Add clock controller for the RK3506

PATCH Superseded Elaine Zhang 2 participants 4 messages Nov 21, 2025

Subsystems (4)

v8 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v8 cover clk: rockchip: Add clock controller for the RK3506

[PATCH 1/5] ~ [PATCH 3/5] has applied.

Change in V8:
[PATCH v8 1/2]: Add explanations for "clocks"
[PATCH v8 2/2]: No change

Change in V7:
[PATCH v7 1/5]: No change
[PATCH v7 2/5]: Redefine clk id(start at 0), drop RESETN for reset id. [PATCH v7 3/5]: Drop RESETN for reset id.
[PATCH v7 4/5]: Fix "description: |", drop RESETN for reset id. [PATCH v7 5/5]: Drop RESETN for reset id.

Change in V6:
Drop pvtpll, others no change.
There are many questions about pvtpll and have some dependency issues. They will be submitted separately later.

Change in V5:
[PATCH v5 1/7]: No change
[PATCH v5 2/7]: No change
[PATCH v5 3/7]: Drop RV1126B_GRF_SOC_STATUS0 [PATCH v5 4/7]: Drop syscon
[PATCH v5 5/7]: No change
[PATCH v5 6/7]: Add clocks and clock-names, fix id define [PATCH v5 7/7]: Drop RK3506_GRF_SOC_STATUS

Change in V4:
[PATCH v4 1/7]: No change
[PATCH v4 2/7]: remove label
[PATCH v4 3/7]: No change
[PATCH v4 4/7]: remove label,fix order
[PATCH v4 5/7]: No change
[PATCH v4 6/7]: Add yaml and dt-bindings for the RK3506 [PATCH v4 7/7]: Add clock controller for the RK3506

Change in V3:
[PATCH v3 1/5]: No change
[PATCH v3 2/5]: Fix define error
[PATCH v3 3/5]: update driver,fix errir
[PATCH v3 4/5]: fix error
[PATCH v3 5/5]: No change

Change in V2:
[PATCH v2 1/5]: update commit message, rename v2 to multi_pll [PATCH v2 2/5]: Modify DT binding headers license [PATCH v2 3/5]: update driver
[PATCH v2 4/5]: fix error
[PATCH v2 5/5]: update commit message

Elaine Zhang (1):
clk: rockchip: Add clock and reset driver for RK3506

Finley Xiao (1):
dt-bindings: clock: rockchip: Add RK3506 clock and reset unit

 .../bindings/clock/rockchip,rk3506-cru.yaml   |  54 ++
 drivers/clk/rockchip/Kconfig                  |   7 +
 drivers/clk/rockchip/Makefile                 |   1 +
 drivers/clk/rockchip/clk-rk3506.c             | 869 ++++++++++++++++++
 drivers/clk/rockchip/clk.h                    |  13 +
 drivers/clk/rockchip/rst-rk3506.c             | 226 +++++
 .../dt-bindings/clock/rockchip,rk3506-cru.h   | 285 ++++++
 .../dt-bindings/reset/rockchip,rk3506-cru.h   | 211 +++++
 8 files changed, 1666 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/rockchip,rk3506-cru.yaml
 create mode 100644 drivers/clk/rockchip/clk-rk3506.c
 create mode 100644 drivers/clk/rockchip/rst-rk3506.c
 create mode 100644 include/dt-bindings/clock/rockchip,rk3506-cru.h
 create mode 100644 include/dt-bindings/reset/rockchip,rk3506-cru.h

base-commit: 4f0744c46de2c40e7a8f35d730e322bf33f2bb63

Signature · 1 line
2.34.1
#1 lore raw

PATCH v8 1/2 dt-bindings: clock: rockchip: Add RK3506 clock and reset unit

From: Finley Xiao <[email protected]>

Add device tree bindings for clock and reset unit on RK3506 SoC. Add clock and reset IDs for RK3506 SoC.

---
 .../bindings/clock/rockchip,rk3506-cru.yaml   |  54 ++++
 .../dt-bindings/clock/rockchip,rk3506-cru.h   | 285 ++++++++++++++++++
 .../dt-bindings/reset/rockchip,rk3506-cru.h   | 211 +++++++++++++
 3 files changed, 550 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/rockchip,rk3506-cru.yaml
 create mode 100644 include/dt-bindings/clock/rockchip,rk3506-cru.h
 create mode 100644 include/dt-bindings/reset/rockchip,rk3506-cru.h
Documentation/devicetree/bindings/clock/rockchip,rk3506-cru.yaml new file +54 -0
new file mode 100644
index 000000000000..fee49700113e
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/rockchip,rk3506-cru.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Rockchip RK3506 Clock and Reset Unit (CRU)
+
+maintainers:
+  - Finley Xiao <[email protected]>
+  - Heiko Stuebner <[email protected]>
+
+description:
+  The RK3506 CRU generates the clock and also implements reset for SoC
+  peripherals.
+
+properties:
+  compatible:
+    const: rockchip,rk3506-cru
+
+  reg:
+    maxItems: 1
+
+  "#clock-cells":
+    const: 1
+
+  "#reset-cells":
+    const: 1
+
+  clocks:
+    maxItems: 1
+    description:
+      Reference clock input. This is optional when the clock source
+      has already been configured and enabled by the bootloader/firmware.
+
+  clock-names:
+    const: xin24m
+
+required:
+  - compatible
+  - reg
+  - "#clock-cells"
+  - "#reset-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    clock-controller@ff9a0000 {
+      compatible = "rockchip,rk3506-cru";
+      reg = <0xff9a0000 0x20000>;
+      #clock-cells = <1>;
+      #reset-cells = <1>;
+    };
include/dt-bindings/clock/rockchip,rk3506-cru.h new file +285 -0

285 lines not on this page · raw message

include/dt-bindings/reset/rockchip,rk3506-cru.h new file +211 -0

211 lines not on this page · raw message

Signature · 7 lines
2.34.1


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
#2 lore raw

Re: [PATCH v8 1/2] dt-bindings: clock: rockchip: Add RK3506 clock and reset unit

Quoted 46 lines · Elaine Zhang

From: Finley Xiao <[email protected]>

Add device tree bindings for clock and reset unit on RK3506 SoC. Add clock and reset IDs for RK3506 SoC.

---
 .../bindings/clock/rockchip,rk3506-cru.yaml   |  54 ++++
 .../dt-bindings/clock/rockchip,rk3506-cru.h   | 285 ++++++++++++++++++
 .../dt-bindings/reset/rockchip,rk3506-cru.h   | 211 +++++++++++++
 3 files changed, 550 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/rockchip,rk3506-cru.yaml
 create mode 100644 include/dt-bindings/clock/rockchip,rk3506-cru.h
 create mode 100644 include/dt-bindings/reset/rockchip,rk3506-cru.h
Documentation/devicetree/bindings/clock/rockchip,rk3506-cru.yaml new file +24 -0
new file mode 100644
index 000000000000..fee49700113e
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/rockchip,rk3506-cru.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Rockchip RK3506 Clock and Reset Unit (CRU)
+
+maintainers:
+  - Finley Xiao <[email protected]>
+  - Heiko Stuebner <[email protected]>
+
+description:
+  The RK3506 CRU generates the clock and also implements reset for SoC
+  peripherals.
+
+properties:
+  compatible:
+    const: rockchip,rk3506-cru
+
+  reg:
+    maxItems: 1
+
+  "#clock-cells":

Documentation/devicetree/bindings/clock/rockchip,rk3506-cru.yaml line 34

Quoted 10 lines
Documentation/devicetree/bindings/clock/rockchip,rk3506-cru.yaml new file +10 -0
+    const: 1
+
+  "#reset-cells":
+    const: 1
+
+  clocks:
+    maxItems: 1
+    description:
+      Reference clock input. This is optional when the clock source
+      has already been configured and enabled by the bootloader/firmware.

So your description confirms - this is not an optional clock. It must be enabled/configure and it is always in the hardware. You could have avoided one more version of patchset if you only bothered to respond to review.

Drop description and make it required.

Documentation/devicetree/bindings/clock/rockchip,rk3506-cru.yaml line 37

Quoted 3 lines
Documentation/devicetree/bindings/clock/rockchip,rk3506-cru.yaml new file +3 -0
+
+  clock-names:
+    const: xin24m

Nothing improved. Conor made comments some revisions ago and reminded you about them. And you just ignored them?

That's just xin pin, isn't it?

Documentation/devicetree/bindings/clock/rockchip,rk3506-cru.yaml line 43

Quoted 6 lines
Documentation/devicetree/bindings/clock/rockchip,rk3506-cru.yaml new file +6 -0
+
+required:
+  - compatible
+  - reg
+  - "#clock-cells"
+  - "#reset-cells"

clocks and clock-names.

Best regards,
Krzysztof

#3 lore raw

PATCH v8 2/2 clk: rockchip: Add clock and reset driver for RK3506

In reply to Elaine Zhang

Add the clock and reset tree definitions for the new RK3506 SoC.

---
 drivers/clk/rockchip/Kconfig      |   7 +
 drivers/clk/rockchip/Makefile     |   1 +
 drivers/clk/rockchip/clk-rk3506.c | 869 ++++++++++++++++++++++++++++++
 drivers/clk/rockchip/clk.h        |  13 +
 drivers/clk/rockchip/rst-rk3506.c | 226 ++++++++
 5 files changed, 1116 insertions(+)
 create mode 100644 drivers/clk/rockchip/clk-rk3506.c
 create mode 100644 drivers/clk/rockchip/rst-rk3506.c
drivers/clk/rockchip/Kconfig +7 -0
index e1ea0a098ca9..5cf1e0fd6fb3 100644
@@ -100,6 +100,13 @@ config CLK_RK3399
 	help
 	  Build the driver for RK3399 Clock Driver.
 
+config CLK_RK3506
+	bool "Rockchip RK3506 clock controller support"
+	depends on ARM || COMPILE_TEST
+	default y
+	help
+	  Build the driver for RK3506 Clock Driver.
+
 config CLK_RK3528
 	bool "Rockchip RK3528 clock controller support"
 	depends on ARM64 || COMPILE_TEST
drivers/clk/rockchip/Makefile +1 -0
index 82b4b29ad036..4d8cbb2044c7 100644
@@ -30,6 +30,7 @@ obj-$(CONFIG_CLK_RK3308)        += clk-rk3308.o
 obj-$(CONFIG_CLK_RK3328)        += clk-rk3328.o
 obj-$(CONFIG_CLK_RK3368)        += clk-rk3368.o
 obj-$(CONFIG_CLK_RK3399)        += clk-rk3399.o
+obj-$(CONFIG_CLK_RK3506)	+= clk-rk3506.o rst-rk3506.o
 obj-$(CONFIG_CLK_RK3528)	+= clk-rk3528.o rst-rk3528.o
 obj-$(CONFIG_CLK_RK3562)	+= clk-rk3562.o rst-rk3562.o
 obj-$(CONFIG_CLK_RK3568)	+= clk-rk3568.o
drivers/clk/rockchip/clk-rk3506.c new file +869 -0

869 lines not on this page · raw message

drivers/clk/rockchip/clk.h +13 -0
index 87f09320b942..b2fff1d13a4a 100644
@@ -275,6 +275,18 @@ struct clk;
 #define RK3399_PMU_CLKGATE_CON(x)	((x) * 0x4 + 0x100)
 #define RK3399_PMU_SOFTRST_CON(x)	((x) * 0x4 + 0x110)
 
+#define RK3506_PMU_CRU_BASE		0x10000
+#define RK3506_PLL_CON(x)		((x) * 0x4 + RK3506_PMU_CRU_BASE)
+#define RK3506_CLKSEL_CON(x)		((x) * 0x4 + 0x300)
+#define RK3506_CLKGATE_CON(x)		((x) * 0x4 + 0x800)
+#define RK3506_SOFTRST_CON(x)		((x) * 0x4 + 0xa00)
+#define RK3506_PMU_CLKSEL_CON(x)	((x) * 0x4 + 0x300 + RK3506_PMU_CRU_BASE)
+#define RK3506_PMU_CLKGATE_CON(x)	((x) * 0x4 + 0x800 + RK3506_PMU_CRU_BASE)
+#define RK3506_MODE_CON			0x280
+#define RK3506_GLB_CNT_TH		0xc00
+#define RK3506_GLB_SRST_FST		0xc08
+#define RK3506_GLB_SRST_SND		0xc0c
+
 #define RK3528_PMU_CRU_BASE		0x10000
 #define RK3528_PCIE_CRU_BASE		0x20000
 #define RK3528_DDRPHY_CRU_BASE		0x28000
@@ -1329,6 +1341,7 @@ static inline void rockchip_register_softrst(struct device_node *np,
 }
 
 void rv1126b_rst_init(struct device_node *np, void __iomem *reg_base);
+void rk3506_rst_init(struct device_node *np, void __iomem *reg_base);
 void rk3528_rst_init(struct device_node *np, void __iomem *reg_base);
 void rk3562_rst_init(struct device_node *np, void __iomem *reg_base);
 void rk3576_rst_init(struct device_node *np, void __iomem *reg_base);
drivers/clk/rockchip/rst-rk3506.c new file +226 -0

226 lines not on this page · raw message

Signature · 1 line
2.34.1