Skip to contentSkip to conversation

Enable Hi3559A SOC clock

PATCH Applied Dongjiu Geng 2 participants 5 messages Mar 23, 2021 – Jun 28, 2021

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

v8 cover Enable Hi3559A SOC clock

This patchset is separated from this series: https://lore.kernel.org/patchwork/cover/1353321/

v7->v8:
Mainly address Stephen's comments
1. Add const for some function and variables
2. Remove the useless function and variables
3. Add a define for a mask width

Dongjiu Geng (2):
dt-bindings: Document the hi3559a clock bindings
clk: hisilicon: Add clock driver for hi3559A SoC

 .../clock/hisilicon,hi3559av100-clock.yaml         |  59 ++
 drivers/clk/hisilicon/Kconfig                      |   7 +
 drivers/clk/hisilicon/Makefile                     |   1 +
 drivers/clk/hisilicon/clk-hi3559a.c                | 847 +++++++++++++++++++++
 drivers/clk/hisilicon/clk.c                        |   2 +-
 drivers/clk/hisilicon/clk.h                        |   2 +-
 include/dt-bindings/clock/hi3559av100-clock.h      | 165 ++++
 7 files changed, 1081 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/hisilicon,hi3559av100-clock.yaml
 create mode 100644 drivers/clk/hisilicon/clk-hi3559a.c
 create mode 100644 include/dt-bindings/clock/hi3559av100-clock.h
Signature · 1 line
2.7.4
#1 lore raw

PATCH v8 1/2 dt-bindings: Document the hi3559a clock bindings

From: Dongjiu Geng <[email protected]>

Add DT bindings documentation for hi3559a SoC clock.

---
 .../clock/hisilicon,hi3559av100-clock.yaml         |  59 ++++++++
 include/dt-bindings/clock/hi3559av100-clock.h      | 165 +++++++++++++++++++++
 2 files changed, 224 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/hisilicon,hi3559av100-clock.yaml
 create mode 100644 include/dt-bindings/clock/hi3559av100-clock.h
Documentation/devicetree/bindings/clock/hisilicon,hi3559av100-clock.yaml new file +59 -0
new file mode 100644
index 0000000..3ceb29c
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/hisilicon,hi3559av100-clock.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Hisilicon SOC Clock for HI3559AV100
+
+maintainers:
+  - Dongjiu Geng <[email protected]>
+
+description: |
+  Hisilicon SOC clock control module which supports the clocks, resets and
+  power domains on HI3559AV100.
+
+  See also:
+    dt-bindings/clock/hi3559av100-clock.h
+
+properties:
+  compatible:
+    enum:
+      - hisilicon,hi3559av100-clock
+      - hisilicon,hi3559av100-shub-clock
+
+  reg:
+    minItems: 1
+    maxItems: 2
+
+  '#clock-cells':
+    const: 1
+
+  '#reset-cells':
+    const: 2
+    description: |
+      First cell is reset request register offset.
+      Second cell is bit offset in reset request register.
+
+required:
+  - compatible
+  - reg
+  - '#clock-cells'
+  - '#reset-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        clock-controller@12010000 {
+            compatible = "hisilicon,hi3559av100-clock";
+            #clock-cells = <1>;
+            #reset-cells = <2>;
+            reg = <0x0 0x12010000 0x0 0x10000>;
+        };
+    };
+...
include/dt-bindings/clock/hi3559av100-clock.h new file +165 -0

165 lines not on this page · raw message

Signature · 1 line
2.7.4
#3 lore raw

PATCH v8 2/2 clk: hisilicon: Add clock driver for hi3559A SoC

In reply to Dongjiu Geng

From: Dongjiu Geng <[email protected]>

Add clock drivers for hi3559A SoC, this driver
controls the SoC registers to supply different
clocks to different IPs in the SoC.

---
 drivers/clk/hisilicon/Kconfig       |   7 +
 drivers/clk/hisilicon/Makefile      |   1 +
 drivers/clk/hisilicon/clk-hi3559a.c | 847 ++++++++++++++++++++++++++++++++++++
 drivers/clk/hisilicon/clk.c         |   2 +-
 drivers/clk/hisilicon/clk.h         |   2 +-
 5 files changed, 857 insertions(+), 2 deletions(-)
 create mode 100644 drivers/clk/hisilicon/clk-hi3559a.c
drivers/clk/hisilicon/Kconfig +7 -0
index 6a9e93a..5ecc37a 100644
@@ -15,6 +15,13 @@ config COMMON_CLK_HI3519
 	help
 	  Build the clock driver for hi3519.
 
+config COMMON_CLK_HI3559A
+	bool "Hi3559A Clock Driver"
+	depends on ARCH_HISI || COMPILE_TEST
+	default ARCH_HISI
+	help
+	  Build the clock driver for hi3559a.
+
 config COMMON_CLK_HI3660
 	bool "Hi3660 Clock Driver"
 	depends on ARCH_HISI || COMPILE_TEST
drivers/clk/hisilicon/Makefile +1 -0
index b2441b9..2978e56 100644
@@ -10,6 +10,7 @@ obj-$(CONFIG_ARCH_HIP04)	+= clk-hip04.o
 obj-$(CONFIG_ARCH_HIX5HD2)	+= clk-hix5hd2.o
 obj-$(CONFIG_COMMON_CLK_HI3516CV300)	+= crg-hi3516cv300.o
 obj-$(CONFIG_COMMON_CLK_HI3519)	+= clk-hi3519.o
+obj-$(CONFIG_COMMON_CLK_HI3559A)	+= clk-hi3559a.o
 obj-$(CONFIG_COMMON_CLK_HI3660) += clk-hi3660.o
 obj-$(CONFIG_COMMON_CLK_HI3670) += clk-hi3670.o
 obj-$(CONFIG_COMMON_CLK_HI3798CV200)	+= crg-hi3798cv200.o
drivers/clk/hisilicon/clk-hi3559a.c new file +847 -0

847 lines not on this page · raw message

drivers/clk/hisilicon/clk.c +1 -1
index 54d9fdc..9361fba 100644
@@ -162,7 +162,7 @@ int hisi_clk_register_mux(const struct hisi_mux_clock *clks,
 					clks[i].num_parents, clks[i].flags,
 					base + clks[i].offset, clks[i].shift,
 					mask, clks[i].mux_flags,
-					clks[i].table, &hisi_clk_lock);
+					(u32 *)clks[i].table, &hisi_clk_lock);
 		if (IS_ERR(clk)) {
 			pr_err("%s: failed to register clock %s\n",
 			       __func__, clks[i].name);
drivers/clk/hisilicon/clk.h +1 -1
index 61cbd90..7a9b42e 100644
@@ -50,7 +50,7 @@ struct hisi_mux_clock {
 	u8			shift;
 	u8			width;
 	u8			mux_flags;
-	u32			*table;
+	const u32		*table;
 	const char		*alias;
 };
 
Signature · 1 line
2.7.4
maintainer Applied
#4 lore raw

Re: [PATCH v8 2/2] clk: hisilicon: Add clock driver for hi3559A SoC

Quoting Dongjiu Geng (2021-03-23 04:29:33)

Quoted 8 lines

From: Dongjiu Geng <[email protected]>

Add clock drivers for hi3559A SoC, this driver
controls the SoC registers to supply different
clocks to different IPs in the SoC.

---

Applied to clk-next