All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuan Liu <chuan.liu@amlogic.com>
To: Neil Armstrong <neil.armstrong@linaro.org>,
	 Michael Turquette <mturquette@baylibre.com>,
	 Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>
Cc: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org,
	 devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Chuan Liu <chuan.liu@amlogic.com>
Subject: [PATCH 03/13] dt-bindings: clock: Add Amlogic A9 misc clock control units
Date: Mon, 09 Feb 2026 13:48:49 +0800	[thread overview]
Message-ID: <20260209-a9_clock_driver-v1-3-a9198dc03d2a@amlogic.com> (raw)
In-Reply-To: <20260209-a9_clock_driver-v1-0-a9198dc03d2a@amlogic.com>

Add dt-binding documentation for various miscellaneous peripheral clock
control units in A9 SoC family.

Signed-off-by: Chuan Liu <chuan.liu@amlogic.com>
---
 .../bindings/clock/amlogic,a9-misc-ccu.yaml        | 523 +++++++++++++++++++++
 include/dt-bindings/clock/amlogic,a9-misc-ccu.h    |  53 +++
 2 files changed, 576 insertions(+)

diff --git a/Documentation/devicetree/bindings/clock/amlogic,a9-misc-ccu.yaml b/Documentation/devicetree/bindings/clock/amlogic,a9-misc-ccu.yaml
new file mode 100644
index 000000000000..cce209f75a6e
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/amlogic,a9-misc-ccu.yaml
@@ -0,0 +1,523 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2026 Amlogic, Inc. All rights reserved
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/amlogic,a9-misc-ccu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic A9 Family Misc Clock Control Unit
+
+maintainers:
+  - Chuan Liu <chuan.liu@amlogic.com>
+
+description: |
+  The misc-ccu contains clock control units which are built from dedicated,
+  non-universal model clock controllers, such as the sc-ccu for smart card and
+  the ts-ccu for temperature sensor.
+
+  The clock IDs of the subclocks of these CCUs are defined in
+  "include/dt-bindings/clock/amlogic,a9-misc-ccu.h".
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - const: amlogic,a9-sc-ccu
+        description: Clock control unit of smart card
+      - items:
+          - const: amlogic,a9-ts-ccu
+        description: Clock control unit of temperature sensor(s)
+      - items:
+          - const: amlogic,a9-genout-ccu
+        description: Clock control unit that generates clock output to pin(s)
+      - items:
+          - const: amlogic,a9-clk12_24m-ccu
+        description: Clock control unit that generates clock output 12MHz or
+                     24MHz to pin(s)
+      - items:
+          - const: amlogic,a9-vapb_ge2d-ccu
+        description: Clock control unit for vapb and ge2d
+      - items:
+          - const: amlogic,a9-di-ccu
+        description: Clock control unit of de-interlace
+      - items:
+          - const: amlogic,a9-eth-ccu
+        description: Clock control unit of ethernet
+      - items:
+          - const: amlogic,a9-mclk-ccu
+        description: Clock control unit that provides the clock to the external
+                     camera sensor
+      - items:
+          - const: amlogic,a9-dualdivmux-ccu
+        description: Clock control unit using dual divider channel toggling for
+                     fractional division
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    minItems: 1
+    maxItems: 32
+
+  clock-names:
+    minItems: 1
+    maxItems: 32
+
+  clock-output-names:
+    minItems: 1
+    maxItems: 8
+
+  '#clock-cells':
+    description:
+      The clock controller of a module may contain one or more child clock(s).
+      When a clock controller has multiple child clocks, an index is required
+      to specify a particular clock within the clock controller.
+    oneOf:
+      - const: 0
+        description: Single clock output, no specifier needed
+      - const: 1
+        description: Multiple clocks, index selects specific output
+
+  amlogic,clock-max-frequency:
+    description: |
+      Each clock's maximum output frequency is constrained during hardware
+      design to ensure proper timing requirements for the clock network. If the
+      clock frequency configured exceeds this design limit, it can lead to
+      abnormal behavior in modules relying on that clock and may even cause
+      cross-talk that affects other modules.
+
+      In the driver, this property is parsed, and interface functions from the
+      CCF are called to enforce the clock's maximum frequency, preventing
+      potential issues caused by excessive clock frequency configurations.
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+
+  amlogic,clock-init-regs:
+    description:
+      Certain CCUs and PLLs require initialization through dedicated registers
+      before becoming operational. This initialization configures internal clock
+      drive characteristics, divider parameters, and PLL internal circuitry.
+    $ref: /schemas/types.yaml#/definitions/uint32-matrix
+    items:
+      items:
+        - description: The register offset address
+        - description: The value to be written to the register
+        - description: The delay after the register write (unit is us)
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-sc-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 1
+          items:
+            - description: input clock source 0
+            - description: input clock source 1 (optional)
+            - description: input clock source 2 (optional)
+            - description: input clock source 3 (optional)
+        clock-names:
+          minItems: 1
+          items:
+            - const: clkin0
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+        clock-output-names:
+
+          items:
+            - description: preprocessing clock
+            - description: divider clock
+      required:
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-ts-ccu
+    then:
+      properties:
+        clocks:
+          description: input clock of ts-ccu
+        clock-output-names:
+          items:
+            - description: divider clock
+            - description: gate clock
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-genout-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 1
+          items:
+            - description: input clock source 0
+            - description: input clock source 1 (optional)
+            - description: input clock source 2 (optional)
+            - description: input clock source 3 (optional)
+            - description: input clock source 4 (optional)
+            - description: input clock source 5 (optional)
+            - description: input clock source 6 (optional)
+            - description: input clock source 7 (optional)
+            - description: input clock source 8 (optional)
+            - description: input clock source 9 (optional)
+            - description: input clock source 10 (optional)
+            - description: input clock source 11 (optional)
+            - description: input clock source 12 (optional)
+            - description: input clock source 13 (optional)
+            - description: input clock source 14 (optional)
+            - description: input clock source 15 (optional)
+            - description: input clock source 16 (optional)
+            - description: input clock source 17 (optional)
+            - description: input clock source 18 (optional)
+            - description: input clock source 19 (optional)
+            - description: input clock source 20 (optional)
+            - description: input clock source 21 (optional)
+            - description: input clock source 22 (optional)
+            - description: input clock source 23 (optional)
+            - description: input clock source 24 (optional)
+            - description: input clock source 25 (optional)
+            - description: input clock source 26 (optional)
+            - description: input clock source 27 (optional)
+            - description: input clock source 28 (optional)
+            - description: input clock source 29 (optional)
+            - description: input clock source 30 (optional)
+            - description: input clock source 31 (optional)
+        clock-names:
+          minItems: 1
+          items:
+            - const: clkin0
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+            - const: clkin4
+            - const: clkin5
+            - const: clkin6
+            - const: clkin7
+            - const: clkin8
+            - const: clkin9
+            - const: clkin10
+            - const: clkin11
+            - const: clkin12
+            - const: clkin13
+            - const: clkin14
+            - const: clkin15
+            - const: clkin16
+            - const: clkin17
+            - const: clkin18
+            - const: clkin19
+            - const: clkin20
+            - const: clkin21
+            - const: clkin22
+            - const: clkin23
+            - const: clkin24
+            - const: clkin25
+            - const: clkin26
+            - const: clkin27
+            - const: clkin28
+            - const: clkin29
+            - const: clkin30
+            - const: clkin31
+        clock-output-names:
+          items:
+            - description: multiplexer clock
+            - description: divider clock
+            - description: gate clock
+      required:
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-clk12_24m-ccu
+    then:
+      properties:
+        clocks:
+          maxItems: 1
+          description: 24m-xtal clock
+        clock-output-names:
+          items:
+            - description: input gate clock
+            - description: divider clock
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-vapb_ge2d-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 1
+          items:
+            - description: input clock source 0
+            - description: input clock source 1 (optional)
+            - description: input clock source 2 (optional)
+            - description: input clock source 3 (optional)
+            - description: input clock source 4 (optional)
+            - description: input clock source 5 (optional)
+            - description: input clock source 6 (optional)
+            - description: input clock source 7 (optional)
+        clock-names:
+          minItems: 1
+          items:
+            - const: clkin0
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+            - const: clkin4
+            - const: clkin5
+            - const: clkin6
+            - const: clkin7
+        clock-output-names:
+          items:
+            - description: vapb clock
+            - description: ge2d clock
+      required:
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-di-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 1
+          items:
+            - description: input clock source 0
+            - description: input clock source 1 (optional)
+            - description: input clock source 2 (optional)
+            - description: input clock source 3 (optional)
+        clock-names:
+          minItems: 1
+          items:
+            - const: clkin0
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+        clock-output-names:
+          items:
+            - description: preprocessing clock
+            - description: divider clock
+            - description: gate clock
+      required:
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-eth-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 2
+          items:
+            - description: eth_125m input clock
+            - description: rmii input clock source 0
+            - description: rmii input clock source 1 (optional)
+            - description: rmii input clock source 2 (optional)
+            - description: rmii input clock source 3 (optional)
+            - description: rmii input clock source 4 (optional)
+            - description: rmii input clock source 5 (optional)
+            - description: rmii input clock source 6 (optional)
+            - description: rmii input clock source 7 (optional)
+        clock-names:
+          minItems: 2
+          items:
+            - const: clk125m
+            - const: clkin0
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+            - const: clkin4
+            - const: clkin5
+            - const: clkin6
+            - const: clkin7
+        clock-output-names:
+          items:
+            - description: eth_125m clock
+            - description: eth_rmii clock
+      required:
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-mclk-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 1
+          items:
+            - description: mclk0/1 predivider clock source
+            - description: mclk0/1 clock source 1 (optional)
+            - description: mclk0/1 clock source 2 (optional)
+            - description: mclk0/1 clock source 3 (optional)
+        clock-names:
+          minItems: 1
+          items:
+            - const: divin
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+        clock-output-names:
+          items:
+            - description: mclk0 pre-divider clock
+            - description: mclk0 multiplexer clock
+            - description: mclk0 divider clock
+            - description: mclk0 gate clock
+            - description: mclk1 pre-divider clock
+            - description: mclk1 multiplexer clock
+            - description: mclk1 divider clock
+            - description: mclk1 gate clock
+      required:
+        - amlogic,clock-init-regs
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-dualdivmux-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 2
+          items:
+            - description: input clock of dualdiv
+            - description: mux clock source 0
+            - description: mux clock source 1 (optional)
+            - description: mux clock source 2 (optional)
+            - description: mux clock source 3 (optional)
+        clock-names:
+          minItems: 2
+          items:
+            - const: divin
+            - const: mux0
+            - const: mux1
+            - const: mux2
+            - const: mux3
+        clock-output-names:
+          items:
+            - description: dualdiv clock
+            - description: multiplexer clock
+      required:
+        - clock-names
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-output-names
+  - "#clock-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    apb {
+        #address-cells = <2>;
+        #size-cells = <2>;
+        clock-sc@370 {
+            compatible = "amlogic,a9-sc-ccu";
+            reg = <0x0 0x370 0x0 0x4>;
+            #clock-cells = <1>;
+            clock-output-names = "sc_pre",
+                                 "sc";
+            clocks = <&scmi_clk 6>,
+                     <&scmi_clk 9>,
+                     <&scmi_clk 14>,
+                     <&xtal_24m>;
+            clock-names = "clkin0",
+                          "clkin1",
+                          "clkin2",
+                          "clkin3";
+        };
+
+        clock-ts@3a0 {
+            compatible = "amlogic,a9-ts-ccu";
+            reg = <0x0 0x3a0 0x0 0x4>;
+            #clock-cells = <1>;
+            clock-output-names = "ts_div",
+                                 "ts";
+            clocks = <&xtal_24m>;
+        };
+
+        clock-eth@3a4 {
+            compatible = "amlogic,a9-eth-ccu";
+            reg = <0x0 0x3a4 0x0 0x4>;
+            #clock-cells = <1>;
+            clock-output-names = "eth_125m",
+                                 "eth_rmii";
+            clocks = <&clk_eth_125m_div>,
+                     <&scmi_clk 6>;
+            clock-names = "clk125m",
+                          "clkin0";
+        };
+
+        clock-mclk@833c {
+            compatible = "amlogic,a9-mclk-ccu";
+            reg = <0x0 0x833c 0x0 0x8>;
+            #clock-cells = <1>;
+            amlogic,clock-init-regs = <0x0  0x04000400 0>,
+                                      <0x4  0x96169616 0>;
+            clock-output-names = "mclk0_pre_div",
+                                 "mclk0_sel",
+                                 "mclk0_div",
+                                 "mclk0",
+                                 "mclk1_pre_div",
+                                 "mclk1_sel",
+                                 "mclk1_div",
+                                 "mclk1";
+            clocks = <&mclk_pll>,
+                     <&xtal_24m>,
+                     <&scmi_clk 4>;
+            clock-names = "divin",
+                          "clkin1",
+                          "clkin2";
+        };
+    };
+
+    aobus {
+        #address-cells = <2>;
+        #size-cells = <2>;
+        clkc_ao_cecb: clock-ao_cecb@38 {
+            compatible = "amlogic,a9-dualdivmux-ccu";
+            reg = <0x0 0x38 0x0 0x8>;
+            #clock-cells = <1>;
+
+            clock-output-names = "ao_cecb_dualdiv",
+                                 "ao_cecb";
+            clocks = <&xtal>,
+                     <&clkc_ao_cecb 0>,
+                     <&clkc_rtc 1>;
+            clock-names = "divin",
+                          "mux0",
+                          "mux1";
+        };
+
+        clkc_rtc: clock-rtc@8014c {
+            compatible = "amlogic,a9-dualdivmux-ccu";
+            reg = <0x0 0x8014c 0x0 0x8>;
+            #clock-cells = <1>;
+            clock-output-names = "rtc_dualdiv",
+                                 "rtc";
+            clocks = <&xtal>,
+                     <&xtal>,
+                     <&clkc_rtc 0>;
+            clock-names = "divin",
+                          "mux0",
+                          "mux1";
+        };
+    };
diff --git a/include/dt-bindings/clock/amlogic,a9-misc-ccu.h b/include/dt-bindings/clock/amlogic,a9-misc-ccu.h
new file mode 100644
index 000000000000..102aff8d68e4
--- /dev/null
+++ b/include/dt-bindings/clock/amlogic,a9-misc-ccu.h
@@ -0,0 +1,53 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+/*
+ * Copyright (C) 2026 Amlogic, Inc. All rights reserved
+ */
+
+#ifndef __AMLOGIC_A9_MISC_CCU_H
+#define __AMLOGIC_A9_MISC_CCU_H
+
+/* &clkc_sc (Smart Card) */
+#define A9_CLK_SC_PRE				0
+#define A9_CLK_SC				1
+
+/* &clkc_ts (Temperature Sensor) */
+#define A9_CLK_TS_DIV				0
+#define A9_CLK_TS				1
+
+/* &clkc_gen_out (Generate Output) */
+#define A9_CLK_GENOUT_SEL			0
+#define A9_CLK_GENOUT_DIV			1
+#define A9_CLK_GENOUT				2
+
+/* &clkc_12_24m (12M & 24M) */
+#define A9_CLK_24M_IN				0
+#define A9_CLK_12_24M				1
+
+/* &clkc_vapb_ge2d (VAPB & GE2D) */
+#define A9_CLK_VAPB				0
+#define A9_CLK_GE2D				1
+
+/* &clkc_di (Deinterlacer) */
+#define A9_CLK_VPU_CLKB_TEMP			0
+#define A9_CLK_VPU_CLKB_DIV			1
+#define A9_CLK_VPU_CLKB				2
+
+/* &clkc_eth (ETH) */
+#define A9_CLK_ETH_125M				0
+#define A9_CLK_ETH_RMII				1
+
+/* &clkc_mclk or &clkc_mclk1 (mclk-ccu) */
+#define A9_CLK_MCLK_0_PRE_DIV			0
+#define A9_CLK_MCLK_0_SEL			1
+#define A9_CLK_MCLK_0_DIV			2
+#define A9_CLK_MCLK_0				3
+#define A9_CLK_MCLK_1_PRE_DIV			4
+#define A9_CLK_MCLK_1_SEL			5
+#define A9_CLK_MCLK_1_DIV			6
+#define A9_CLK_MCLK_1				7
+
+/* &clkc_ao_cecb, &clkc_ao_rtc, &clkc_rtc (dualdivmux-ccu) */
+#define A9_CLK_DUALDIV				0
+#define A9_CLK_DUALDIV_SEL			1
+
+#endif /* __AMLOGIC_A9_MISC_CCU_H */

-- 
2.42.0


WARNING: multiple messages have this Message-ID (diff)
From: Chuan Liu via B4 Relay <devnull+chuan.liu.amlogic.com@kernel.org>
To: Neil Armstrong <neil.armstrong@linaro.org>,
	 Michael Turquette <mturquette@baylibre.com>,
	 Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>
Cc: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org,
	 devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Chuan Liu <chuan.liu@amlogic.com>
Subject: [PATCH 03/13] dt-bindings: clock: Add Amlogic A9 misc clock control units
Date: Mon, 09 Feb 2026 13:48:49 +0800	[thread overview]
Message-ID: <20260209-a9_clock_driver-v1-3-a9198dc03d2a@amlogic.com> (raw)
In-Reply-To: <20260209-a9_clock_driver-v1-0-a9198dc03d2a@amlogic.com>

From: Chuan Liu <chuan.liu@amlogic.com>

Add dt-binding documentation for various miscellaneous peripheral clock
control units in A9 SoC family.

Signed-off-by: Chuan Liu <chuan.liu@amlogic.com>
---
 .../bindings/clock/amlogic,a9-misc-ccu.yaml        | 523 +++++++++++++++++++++
 include/dt-bindings/clock/amlogic,a9-misc-ccu.h    |  53 +++
 2 files changed, 576 insertions(+)

diff --git a/Documentation/devicetree/bindings/clock/amlogic,a9-misc-ccu.yaml b/Documentation/devicetree/bindings/clock/amlogic,a9-misc-ccu.yaml
new file mode 100644
index 000000000000..cce209f75a6e
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/amlogic,a9-misc-ccu.yaml
@@ -0,0 +1,523 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2026 Amlogic, Inc. All rights reserved
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/amlogic,a9-misc-ccu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic A9 Family Misc Clock Control Unit
+
+maintainers:
+  - Chuan Liu <chuan.liu@amlogic.com>
+
+description: |
+  The misc-ccu contains clock control units which are built from dedicated,
+  non-universal model clock controllers, such as the sc-ccu for smart card and
+  the ts-ccu for temperature sensor.
+
+  The clock IDs of the subclocks of these CCUs are defined in
+  "include/dt-bindings/clock/amlogic,a9-misc-ccu.h".
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - const: amlogic,a9-sc-ccu
+        description: Clock control unit of smart card
+      - items:
+          - const: amlogic,a9-ts-ccu
+        description: Clock control unit of temperature sensor(s)
+      - items:
+          - const: amlogic,a9-genout-ccu
+        description: Clock control unit that generates clock output to pin(s)
+      - items:
+          - const: amlogic,a9-clk12_24m-ccu
+        description: Clock control unit that generates clock output 12MHz or
+                     24MHz to pin(s)
+      - items:
+          - const: amlogic,a9-vapb_ge2d-ccu
+        description: Clock control unit for vapb and ge2d
+      - items:
+          - const: amlogic,a9-di-ccu
+        description: Clock control unit of de-interlace
+      - items:
+          - const: amlogic,a9-eth-ccu
+        description: Clock control unit of ethernet
+      - items:
+          - const: amlogic,a9-mclk-ccu
+        description: Clock control unit that provides the clock to the external
+                     camera sensor
+      - items:
+          - const: amlogic,a9-dualdivmux-ccu
+        description: Clock control unit using dual divider channel toggling for
+                     fractional division
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    minItems: 1
+    maxItems: 32
+
+  clock-names:
+    minItems: 1
+    maxItems: 32
+
+  clock-output-names:
+    minItems: 1
+    maxItems: 8
+
+  '#clock-cells':
+    description:
+      The clock controller of a module may contain one or more child clock(s).
+      When a clock controller has multiple child clocks, an index is required
+      to specify a particular clock within the clock controller.
+    oneOf:
+      - const: 0
+        description: Single clock output, no specifier needed
+      - const: 1
+        description: Multiple clocks, index selects specific output
+
+  amlogic,clock-max-frequency:
+    description: |
+      Each clock's maximum output frequency is constrained during hardware
+      design to ensure proper timing requirements for the clock network. If the
+      clock frequency configured exceeds this design limit, it can lead to
+      abnormal behavior in modules relying on that clock and may even cause
+      cross-talk that affects other modules.
+
+      In the driver, this property is parsed, and interface functions from the
+      CCF are called to enforce the clock's maximum frequency, preventing
+      potential issues caused by excessive clock frequency configurations.
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+
+  amlogic,clock-init-regs:
+    description:
+      Certain CCUs and PLLs require initialization through dedicated registers
+      before becoming operational. This initialization configures internal clock
+      drive characteristics, divider parameters, and PLL internal circuitry.
+    $ref: /schemas/types.yaml#/definitions/uint32-matrix
+    items:
+      items:
+        - description: The register offset address
+        - description: The value to be written to the register
+        - description: The delay after the register write (unit is us)
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-sc-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 1
+          items:
+            - description: input clock source 0
+            - description: input clock source 1 (optional)
+            - description: input clock source 2 (optional)
+            - description: input clock source 3 (optional)
+        clock-names:
+          minItems: 1
+          items:
+            - const: clkin0
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+        clock-output-names:
+
+          items:
+            - description: preprocessing clock
+            - description: divider clock
+      required:
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-ts-ccu
+    then:
+      properties:
+        clocks:
+          description: input clock of ts-ccu
+        clock-output-names:
+          items:
+            - description: divider clock
+            - description: gate clock
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-genout-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 1
+          items:
+            - description: input clock source 0
+            - description: input clock source 1 (optional)
+            - description: input clock source 2 (optional)
+            - description: input clock source 3 (optional)
+            - description: input clock source 4 (optional)
+            - description: input clock source 5 (optional)
+            - description: input clock source 6 (optional)
+            - description: input clock source 7 (optional)
+            - description: input clock source 8 (optional)
+            - description: input clock source 9 (optional)
+            - description: input clock source 10 (optional)
+            - description: input clock source 11 (optional)
+            - description: input clock source 12 (optional)
+            - description: input clock source 13 (optional)
+            - description: input clock source 14 (optional)
+            - description: input clock source 15 (optional)
+            - description: input clock source 16 (optional)
+            - description: input clock source 17 (optional)
+            - description: input clock source 18 (optional)
+            - description: input clock source 19 (optional)
+            - description: input clock source 20 (optional)
+            - description: input clock source 21 (optional)
+            - description: input clock source 22 (optional)
+            - description: input clock source 23 (optional)
+            - description: input clock source 24 (optional)
+            - description: input clock source 25 (optional)
+            - description: input clock source 26 (optional)
+            - description: input clock source 27 (optional)
+            - description: input clock source 28 (optional)
+            - description: input clock source 29 (optional)
+            - description: input clock source 30 (optional)
+            - description: input clock source 31 (optional)
+        clock-names:
+          minItems: 1
+          items:
+            - const: clkin0
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+            - const: clkin4
+            - const: clkin5
+            - const: clkin6
+            - const: clkin7
+            - const: clkin8
+            - const: clkin9
+            - const: clkin10
+            - const: clkin11
+            - const: clkin12
+            - const: clkin13
+            - const: clkin14
+            - const: clkin15
+            - const: clkin16
+            - const: clkin17
+            - const: clkin18
+            - const: clkin19
+            - const: clkin20
+            - const: clkin21
+            - const: clkin22
+            - const: clkin23
+            - const: clkin24
+            - const: clkin25
+            - const: clkin26
+            - const: clkin27
+            - const: clkin28
+            - const: clkin29
+            - const: clkin30
+            - const: clkin31
+        clock-output-names:
+          items:
+            - description: multiplexer clock
+            - description: divider clock
+            - description: gate clock
+      required:
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-clk12_24m-ccu
+    then:
+      properties:
+        clocks:
+          maxItems: 1
+          description: 24m-xtal clock
+        clock-output-names:
+          items:
+            - description: input gate clock
+            - description: divider clock
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-vapb_ge2d-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 1
+          items:
+            - description: input clock source 0
+            - description: input clock source 1 (optional)
+            - description: input clock source 2 (optional)
+            - description: input clock source 3 (optional)
+            - description: input clock source 4 (optional)
+            - description: input clock source 5 (optional)
+            - description: input clock source 6 (optional)
+            - description: input clock source 7 (optional)
+        clock-names:
+          minItems: 1
+          items:
+            - const: clkin0
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+            - const: clkin4
+            - const: clkin5
+            - const: clkin6
+            - const: clkin7
+        clock-output-names:
+          items:
+            - description: vapb clock
+            - description: ge2d clock
+      required:
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-di-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 1
+          items:
+            - description: input clock source 0
+            - description: input clock source 1 (optional)
+            - description: input clock source 2 (optional)
+            - description: input clock source 3 (optional)
+        clock-names:
+          minItems: 1
+          items:
+            - const: clkin0
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+        clock-output-names:
+          items:
+            - description: preprocessing clock
+            - description: divider clock
+            - description: gate clock
+      required:
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-eth-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 2
+          items:
+            - description: eth_125m input clock
+            - description: rmii input clock source 0
+            - description: rmii input clock source 1 (optional)
+            - description: rmii input clock source 2 (optional)
+            - description: rmii input clock source 3 (optional)
+            - description: rmii input clock source 4 (optional)
+            - description: rmii input clock source 5 (optional)
+            - description: rmii input clock source 6 (optional)
+            - description: rmii input clock source 7 (optional)
+        clock-names:
+          minItems: 2
+          items:
+            - const: clk125m
+            - const: clkin0
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+            - const: clkin4
+            - const: clkin5
+            - const: clkin6
+            - const: clkin7
+        clock-output-names:
+          items:
+            - description: eth_125m clock
+            - description: eth_rmii clock
+      required:
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-mclk-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 1
+          items:
+            - description: mclk0/1 predivider clock source
+            - description: mclk0/1 clock source 1 (optional)
+            - description: mclk0/1 clock source 2 (optional)
+            - description: mclk0/1 clock source 3 (optional)
+        clock-names:
+          minItems: 1
+          items:
+            - const: divin
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+        clock-output-names:
+          items:
+            - description: mclk0 pre-divider clock
+            - description: mclk0 multiplexer clock
+            - description: mclk0 divider clock
+            - description: mclk0 gate clock
+            - description: mclk1 pre-divider clock
+            - description: mclk1 multiplexer clock
+            - description: mclk1 divider clock
+            - description: mclk1 gate clock
+      required:
+        - amlogic,clock-init-regs
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-dualdivmux-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 2
+          items:
+            - description: input clock of dualdiv
+            - description: mux clock source 0
+            - description: mux clock source 1 (optional)
+            - description: mux clock source 2 (optional)
+            - description: mux clock source 3 (optional)
+        clock-names:
+          minItems: 2
+          items:
+            - const: divin
+            - const: mux0
+            - const: mux1
+            - const: mux2
+            - const: mux3
+        clock-output-names:
+          items:
+            - description: dualdiv clock
+            - description: multiplexer clock
+      required:
+        - clock-names
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-output-names
+  - "#clock-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    apb {
+        #address-cells = <2>;
+        #size-cells = <2>;
+        clock-sc@370 {
+            compatible = "amlogic,a9-sc-ccu";
+            reg = <0x0 0x370 0x0 0x4>;
+            #clock-cells = <1>;
+            clock-output-names = "sc_pre",
+                                 "sc";
+            clocks = <&scmi_clk 6>,
+                     <&scmi_clk 9>,
+                     <&scmi_clk 14>,
+                     <&xtal_24m>;
+            clock-names = "clkin0",
+                          "clkin1",
+                          "clkin2",
+                          "clkin3";
+        };
+
+        clock-ts@3a0 {
+            compatible = "amlogic,a9-ts-ccu";
+            reg = <0x0 0x3a0 0x0 0x4>;
+            #clock-cells = <1>;
+            clock-output-names = "ts_div",
+                                 "ts";
+            clocks = <&xtal_24m>;
+        };
+
+        clock-eth@3a4 {
+            compatible = "amlogic,a9-eth-ccu";
+            reg = <0x0 0x3a4 0x0 0x4>;
+            #clock-cells = <1>;
+            clock-output-names = "eth_125m",
+                                 "eth_rmii";
+            clocks = <&clk_eth_125m_div>,
+                     <&scmi_clk 6>;
+            clock-names = "clk125m",
+                          "clkin0";
+        };
+
+        clock-mclk@833c {
+            compatible = "amlogic,a9-mclk-ccu";
+            reg = <0x0 0x833c 0x0 0x8>;
+            #clock-cells = <1>;
+            amlogic,clock-init-regs = <0x0  0x04000400 0>,
+                                      <0x4  0x96169616 0>;
+            clock-output-names = "mclk0_pre_div",
+                                 "mclk0_sel",
+                                 "mclk0_div",
+                                 "mclk0",
+                                 "mclk1_pre_div",
+                                 "mclk1_sel",
+                                 "mclk1_div",
+                                 "mclk1";
+            clocks = <&mclk_pll>,
+                     <&xtal_24m>,
+                     <&scmi_clk 4>;
+            clock-names = "divin",
+                          "clkin1",
+                          "clkin2";
+        };
+    };
+
+    aobus {
+        #address-cells = <2>;
+        #size-cells = <2>;
+        clkc_ao_cecb: clock-ao_cecb@38 {
+            compatible = "amlogic,a9-dualdivmux-ccu";
+            reg = <0x0 0x38 0x0 0x8>;
+            #clock-cells = <1>;
+
+            clock-output-names = "ao_cecb_dualdiv",
+                                 "ao_cecb";
+            clocks = <&xtal>,
+                     <&clkc_ao_cecb 0>,
+                     <&clkc_rtc 1>;
+            clock-names = "divin",
+                          "mux0",
+                          "mux1";
+        };
+
+        clkc_rtc: clock-rtc@8014c {
+            compatible = "amlogic,a9-dualdivmux-ccu";
+            reg = <0x0 0x8014c 0x0 0x8>;
+            #clock-cells = <1>;
+            clock-output-names = "rtc_dualdiv",
+                                 "rtc";
+            clocks = <&xtal>,
+                     <&xtal>,
+                     <&clkc_rtc 0>;
+            clock-names = "divin",
+                          "mux0",
+                          "mux1";
+        };
+    };
diff --git a/include/dt-bindings/clock/amlogic,a9-misc-ccu.h b/include/dt-bindings/clock/amlogic,a9-misc-ccu.h
new file mode 100644
index 000000000000..102aff8d68e4
--- /dev/null
+++ b/include/dt-bindings/clock/amlogic,a9-misc-ccu.h
@@ -0,0 +1,53 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+/*
+ * Copyright (C) 2026 Amlogic, Inc. All rights reserved
+ */
+
+#ifndef __AMLOGIC_A9_MISC_CCU_H
+#define __AMLOGIC_A9_MISC_CCU_H
+
+/* &clkc_sc (Smart Card) */
+#define A9_CLK_SC_PRE				0
+#define A9_CLK_SC				1
+
+/* &clkc_ts (Temperature Sensor) */
+#define A9_CLK_TS_DIV				0
+#define A9_CLK_TS				1
+
+/* &clkc_gen_out (Generate Output) */
+#define A9_CLK_GENOUT_SEL			0
+#define A9_CLK_GENOUT_DIV			1
+#define A9_CLK_GENOUT				2
+
+/* &clkc_12_24m (12M & 24M) */
+#define A9_CLK_24M_IN				0
+#define A9_CLK_12_24M				1
+
+/* &clkc_vapb_ge2d (VAPB & GE2D) */
+#define A9_CLK_VAPB				0
+#define A9_CLK_GE2D				1
+
+/* &clkc_di (Deinterlacer) */
+#define A9_CLK_VPU_CLKB_TEMP			0
+#define A9_CLK_VPU_CLKB_DIV			1
+#define A9_CLK_VPU_CLKB				2
+
+/* &clkc_eth (ETH) */
+#define A9_CLK_ETH_125M				0
+#define A9_CLK_ETH_RMII				1
+
+/* &clkc_mclk or &clkc_mclk1 (mclk-ccu) */
+#define A9_CLK_MCLK_0_PRE_DIV			0
+#define A9_CLK_MCLK_0_SEL			1
+#define A9_CLK_MCLK_0_DIV			2
+#define A9_CLK_MCLK_0				3
+#define A9_CLK_MCLK_1_PRE_DIV			4
+#define A9_CLK_MCLK_1_SEL			5
+#define A9_CLK_MCLK_1_DIV			6
+#define A9_CLK_MCLK_1				7
+
+/* &clkc_ao_cecb, &clkc_ao_rtc, &clkc_rtc (dualdivmux-ccu) */
+#define A9_CLK_DUALDIV				0
+#define A9_CLK_DUALDIV_SEL			1
+
+#endif /* __AMLOGIC_A9_MISC_CCU_H */

-- 
2.42.0



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

WARNING: multiple messages have this Message-ID (diff)
From: Chuan Liu via B4 Relay <devnull+chuan.liu.amlogic.com@kernel.org>
To: Neil Armstrong <neil.armstrong@linaro.org>,
	 Michael Turquette <mturquette@baylibre.com>,
	 Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>
Cc: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org,
	 devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Chuan Liu <chuan.liu@amlogic.com>
Subject: [PATCH 03/13] dt-bindings: clock: Add Amlogic A9 misc clock control units
Date: Mon, 09 Feb 2026 13:48:49 +0800	[thread overview]
Message-ID: <20260209-a9_clock_driver-v1-3-a9198dc03d2a@amlogic.com> (raw)
In-Reply-To: <20260209-a9_clock_driver-v1-0-a9198dc03d2a@amlogic.com>

From: Chuan Liu <chuan.liu@amlogic.com>

Add dt-binding documentation for various miscellaneous peripheral clock
control units in A9 SoC family.

Signed-off-by: Chuan Liu <chuan.liu@amlogic.com>
---
 .../bindings/clock/amlogic,a9-misc-ccu.yaml        | 523 +++++++++++++++++++++
 include/dt-bindings/clock/amlogic,a9-misc-ccu.h    |  53 +++
 2 files changed, 576 insertions(+)

diff --git a/Documentation/devicetree/bindings/clock/amlogic,a9-misc-ccu.yaml b/Documentation/devicetree/bindings/clock/amlogic,a9-misc-ccu.yaml
new file mode 100644
index 000000000000..cce209f75a6e
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/amlogic,a9-misc-ccu.yaml
@@ -0,0 +1,523 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2026 Amlogic, Inc. All rights reserved
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/amlogic,a9-misc-ccu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic A9 Family Misc Clock Control Unit
+
+maintainers:
+  - Chuan Liu <chuan.liu@amlogic.com>
+
+description: |
+  The misc-ccu contains clock control units which are built from dedicated,
+  non-universal model clock controllers, such as the sc-ccu for smart card and
+  the ts-ccu for temperature sensor.
+
+  The clock IDs of the subclocks of these CCUs are defined in
+  "include/dt-bindings/clock/amlogic,a9-misc-ccu.h".
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - const: amlogic,a9-sc-ccu
+        description: Clock control unit of smart card
+      - items:
+          - const: amlogic,a9-ts-ccu
+        description: Clock control unit of temperature sensor(s)
+      - items:
+          - const: amlogic,a9-genout-ccu
+        description: Clock control unit that generates clock output to pin(s)
+      - items:
+          - const: amlogic,a9-clk12_24m-ccu
+        description: Clock control unit that generates clock output 12MHz or
+                     24MHz to pin(s)
+      - items:
+          - const: amlogic,a9-vapb_ge2d-ccu
+        description: Clock control unit for vapb and ge2d
+      - items:
+          - const: amlogic,a9-di-ccu
+        description: Clock control unit of de-interlace
+      - items:
+          - const: amlogic,a9-eth-ccu
+        description: Clock control unit of ethernet
+      - items:
+          - const: amlogic,a9-mclk-ccu
+        description: Clock control unit that provides the clock to the external
+                     camera sensor
+      - items:
+          - const: amlogic,a9-dualdivmux-ccu
+        description: Clock control unit using dual divider channel toggling for
+                     fractional division
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    minItems: 1
+    maxItems: 32
+
+  clock-names:
+    minItems: 1
+    maxItems: 32
+
+  clock-output-names:
+    minItems: 1
+    maxItems: 8
+
+  '#clock-cells':
+    description:
+      The clock controller of a module may contain one or more child clock(s).
+      When a clock controller has multiple child clocks, an index is required
+      to specify a particular clock within the clock controller.
+    oneOf:
+      - const: 0
+        description: Single clock output, no specifier needed
+      - const: 1
+        description: Multiple clocks, index selects specific output
+
+  amlogic,clock-max-frequency:
+    description: |
+      Each clock's maximum output frequency is constrained during hardware
+      design to ensure proper timing requirements for the clock network. If the
+      clock frequency configured exceeds this design limit, it can lead to
+      abnormal behavior in modules relying on that clock and may even cause
+      cross-talk that affects other modules.
+
+      In the driver, this property is parsed, and interface functions from the
+      CCF are called to enforce the clock's maximum frequency, preventing
+      potential issues caused by excessive clock frequency configurations.
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+
+  amlogic,clock-init-regs:
+    description:
+      Certain CCUs and PLLs require initialization through dedicated registers
+      before becoming operational. This initialization configures internal clock
+      drive characteristics, divider parameters, and PLL internal circuitry.
+    $ref: /schemas/types.yaml#/definitions/uint32-matrix
+    items:
+      items:
+        - description: The register offset address
+        - description: The value to be written to the register
+        - description: The delay after the register write (unit is us)
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-sc-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 1
+          items:
+            - description: input clock source 0
+            - description: input clock source 1 (optional)
+            - description: input clock source 2 (optional)
+            - description: input clock source 3 (optional)
+        clock-names:
+          minItems: 1
+          items:
+            - const: clkin0
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+        clock-output-names:
+
+          items:
+            - description: preprocessing clock
+            - description: divider clock
+      required:
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-ts-ccu
+    then:
+      properties:
+        clocks:
+          description: input clock of ts-ccu
+        clock-output-names:
+          items:
+            - description: divider clock
+            - description: gate clock
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-genout-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 1
+          items:
+            - description: input clock source 0
+            - description: input clock source 1 (optional)
+            - description: input clock source 2 (optional)
+            - description: input clock source 3 (optional)
+            - description: input clock source 4 (optional)
+            - description: input clock source 5 (optional)
+            - description: input clock source 6 (optional)
+            - description: input clock source 7 (optional)
+            - description: input clock source 8 (optional)
+            - description: input clock source 9 (optional)
+            - description: input clock source 10 (optional)
+            - description: input clock source 11 (optional)
+            - description: input clock source 12 (optional)
+            - description: input clock source 13 (optional)
+            - description: input clock source 14 (optional)
+            - description: input clock source 15 (optional)
+            - description: input clock source 16 (optional)
+            - description: input clock source 17 (optional)
+            - description: input clock source 18 (optional)
+            - description: input clock source 19 (optional)
+            - description: input clock source 20 (optional)
+            - description: input clock source 21 (optional)
+            - description: input clock source 22 (optional)
+            - description: input clock source 23 (optional)
+            - description: input clock source 24 (optional)
+            - description: input clock source 25 (optional)
+            - description: input clock source 26 (optional)
+            - description: input clock source 27 (optional)
+            - description: input clock source 28 (optional)
+            - description: input clock source 29 (optional)
+            - description: input clock source 30 (optional)
+            - description: input clock source 31 (optional)
+        clock-names:
+          minItems: 1
+          items:
+            - const: clkin0
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+            - const: clkin4
+            - const: clkin5
+            - const: clkin6
+            - const: clkin7
+            - const: clkin8
+            - const: clkin9
+            - const: clkin10
+            - const: clkin11
+            - const: clkin12
+            - const: clkin13
+            - const: clkin14
+            - const: clkin15
+            - const: clkin16
+            - const: clkin17
+            - const: clkin18
+            - const: clkin19
+            - const: clkin20
+            - const: clkin21
+            - const: clkin22
+            - const: clkin23
+            - const: clkin24
+            - const: clkin25
+            - const: clkin26
+            - const: clkin27
+            - const: clkin28
+            - const: clkin29
+            - const: clkin30
+            - const: clkin31
+        clock-output-names:
+          items:
+            - description: multiplexer clock
+            - description: divider clock
+            - description: gate clock
+      required:
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-clk12_24m-ccu
+    then:
+      properties:
+        clocks:
+          maxItems: 1
+          description: 24m-xtal clock
+        clock-output-names:
+          items:
+            - description: input gate clock
+            - description: divider clock
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-vapb_ge2d-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 1
+          items:
+            - description: input clock source 0
+            - description: input clock source 1 (optional)
+            - description: input clock source 2 (optional)
+            - description: input clock source 3 (optional)
+            - description: input clock source 4 (optional)
+            - description: input clock source 5 (optional)
+            - description: input clock source 6 (optional)
+            - description: input clock source 7 (optional)
+        clock-names:
+          minItems: 1
+          items:
+            - const: clkin0
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+            - const: clkin4
+            - const: clkin5
+            - const: clkin6
+            - const: clkin7
+        clock-output-names:
+          items:
+            - description: vapb clock
+            - description: ge2d clock
+      required:
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-di-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 1
+          items:
+            - description: input clock source 0
+            - description: input clock source 1 (optional)
+            - description: input clock source 2 (optional)
+            - description: input clock source 3 (optional)
+        clock-names:
+          minItems: 1
+          items:
+            - const: clkin0
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+        clock-output-names:
+          items:
+            - description: preprocessing clock
+            - description: divider clock
+            - description: gate clock
+      required:
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-eth-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 2
+          items:
+            - description: eth_125m input clock
+            - description: rmii input clock source 0
+            - description: rmii input clock source 1 (optional)
+            - description: rmii input clock source 2 (optional)
+            - description: rmii input clock source 3 (optional)
+            - description: rmii input clock source 4 (optional)
+            - description: rmii input clock source 5 (optional)
+            - description: rmii input clock source 6 (optional)
+            - description: rmii input clock source 7 (optional)
+        clock-names:
+          minItems: 2
+          items:
+            - const: clk125m
+            - const: clkin0
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+            - const: clkin4
+            - const: clkin5
+            - const: clkin6
+            - const: clkin7
+        clock-output-names:
+          items:
+            - description: eth_125m clock
+            - description: eth_rmii clock
+      required:
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-mclk-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 1
+          items:
+            - description: mclk0/1 predivider clock source
+            - description: mclk0/1 clock source 1 (optional)
+            - description: mclk0/1 clock source 2 (optional)
+            - description: mclk0/1 clock source 3 (optional)
+        clock-names:
+          minItems: 1
+          items:
+            - const: divin
+            - const: clkin1
+            - const: clkin2
+            - const: clkin3
+        clock-output-names:
+          items:
+            - description: mclk0 pre-divider clock
+            - description: mclk0 multiplexer clock
+            - description: mclk0 divider clock
+            - description: mclk0 gate clock
+            - description: mclk1 pre-divider clock
+            - description: mclk1 multiplexer clock
+            - description: mclk1 divider clock
+            - description: mclk1 gate clock
+      required:
+        - amlogic,clock-init-regs
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: amlogic,a9-dualdivmux-ccu
+    then:
+      properties:
+        clocks:
+          minItems: 2
+          items:
+            - description: input clock of dualdiv
+            - description: mux clock source 0
+            - description: mux clock source 1 (optional)
+            - description: mux clock source 2 (optional)
+            - description: mux clock source 3 (optional)
+        clock-names:
+          minItems: 2
+          items:
+            - const: divin
+            - const: mux0
+            - const: mux1
+            - const: mux2
+            - const: mux3
+        clock-output-names:
+          items:
+            - description: dualdiv clock
+            - description: multiplexer clock
+      required:
+        - clock-names
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-output-names
+  - "#clock-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    apb {
+        #address-cells = <2>;
+        #size-cells = <2>;
+        clock-sc@370 {
+            compatible = "amlogic,a9-sc-ccu";
+            reg = <0x0 0x370 0x0 0x4>;
+            #clock-cells = <1>;
+            clock-output-names = "sc_pre",
+                                 "sc";
+            clocks = <&scmi_clk 6>,
+                     <&scmi_clk 9>,
+                     <&scmi_clk 14>,
+                     <&xtal_24m>;
+            clock-names = "clkin0",
+                          "clkin1",
+                          "clkin2",
+                          "clkin3";
+        };
+
+        clock-ts@3a0 {
+            compatible = "amlogic,a9-ts-ccu";
+            reg = <0x0 0x3a0 0x0 0x4>;
+            #clock-cells = <1>;
+            clock-output-names = "ts_div",
+                                 "ts";
+            clocks = <&xtal_24m>;
+        };
+
+        clock-eth@3a4 {
+            compatible = "amlogic,a9-eth-ccu";
+            reg = <0x0 0x3a4 0x0 0x4>;
+            #clock-cells = <1>;
+            clock-output-names = "eth_125m",
+                                 "eth_rmii";
+            clocks = <&clk_eth_125m_div>,
+                     <&scmi_clk 6>;
+            clock-names = "clk125m",
+                          "clkin0";
+        };
+
+        clock-mclk@833c {
+            compatible = "amlogic,a9-mclk-ccu";
+            reg = <0x0 0x833c 0x0 0x8>;
+            #clock-cells = <1>;
+            amlogic,clock-init-regs = <0x0  0x04000400 0>,
+                                      <0x4  0x96169616 0>;
+            clock-output-names = "mclk0_pre_div",
+                                 "mclk0_sel",
+                                 "mclk0_div",
+                                 "mclk0",
+                                 "mclk1_pre_div",
+                                 "mclk1_sel",
+                                 "mclk1_div",
+                                 "mclk1";
+            clocks = <&mclk_pll>,
+                     <&xtal_24m>,
+                     <&scmi_clk 4>;
+            clock-names = "divin",
+                          "clkin1",
+                          "clkin2";
+        };
+    };
+
+    aobus {
+        #address-cells = <2>;
+        #size-cells = <2>;
+        clkc_ao_cecb: clock-ao_cecb@38 {
+            compatible = "amlogic,a9-dualdivmux-ccu";
+            reg = <0x0 0x38 0x0 0x8>;
+            #clock-cells = <1>;
+
+            clock-output-names = "ao_cecb_dualdiv",
+                                 "ao_cecb";
+            clocks = <&xtal>,
+                     <&clkc_ao_cecb 0>,
+                     <&clkc_rtc 1>;
+            clock-names = "divin",
+                          "mux0",
+                          "mux1";
+        };
+
+        clkc_rtc: clock-rtc@8014c {
+            compatible = "amlogic,a9-dualdivmux-ccu";
+            reg = <0x0 0x8014c 0x0 0x8>;
+            #clock-cells = <1>;
+            clock-output-names = "rtc_dualdiv",
+                                 "rtc";
+            clocks = <&xtal>,
+                     <&xtal>,
+                     <&clkc_rtc 0>;
+            clock-names = "divin",
+                          "mux0",
+                          "mux1";
+        };
+    };
diff --git a/include/dt-bindings/clock/amlogic,a9-misc-ccu.h b/include/dt-bindings/clock/amlogic,a9-misc-ccu.h
new file mode 100644
index 000000000000..102aff8d68e4
--- /dev/null
+++ b/include/dt-bindings/clock/amlogic,a9-misc-ccu.h
@@ -0,0 +1,53 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+/*
+ * Copyright (C) 2026 Amlogic, Inc. All rights reserved
+ */
+
+#ifndef __AMLOGIC_A9_MISC_CCU_H
+#define __AMLOGIC_A9_MISC_CCU_H
+
+/* &clkc_sc (Smart Card) */
+#define A9_CLK_SC_PRE				0
+#define A9_CLK_SC				1
+
+/* &clkc_ts (Temperature Sensor) */
+#define A9_CLK_TS_DIV				0
+#define A9_CLK_TS				1
+
+/* &clkc_gen_out (Generate Output) */
+#define A9_CLK_GENOUT_SEL			0
+#define A9_CLK_GENOUT_DIV			1
+#define A9_CLK_GENOUT				2
+
+/* &clkc_12_24m (12M & 24M) */
+#define A9_CLK_24M_IN				0
+#define A9_CLK_12_24M				1
+
+/* &clkc_vapb_ge2d (VAPB & GE2D) */
+#define A9_CLK_VAPB				0
+#define A9_CLK_GE2D				1
+
+/* &clkc_di (Deinterlacer) */
+#define A9_CLK_VPU_CLKB_TEMP			0
+#define A9_CLK_VPU_CLKB_DIV			1
+#define A9_CLK_VPU_CLKB				2
+
+/* &clkc_eth (ETH) */
+#define A9_CLK_ETH_125M				0
+#define A9_CLK_ETH_RMII				1
+
+/* &clkc_mclk or &clkc_mclk1 (mclk-ccu) */
+#define A9_CLK_MCLK_0_PRE_DIV			0
+#define A9_CLK_MCLK_0_SEL			1
+#define A9_CLK_MCLK_0_DIV			2
+#define A9_CLK_MCLK_0				3
+#define A9_CLK_MCLK_1_PRE_DIV			4
+#define A9_CLK_MCLK_1_SEL			5
+#define A9_CLK_MCLK_1_DIV			6
+#define A9_CLK_MCLK_1				7
+
+/* &clkc_ao_cecb, &clkc_ao_rtc, &clkc_rtc (dualdivmux-ccu) */
+#define A9_CLK_DUALDIV				0
+#define A9_CLK_DUALDIV_SEL			1
+
+#endif /* __AMLOGIC_A9_MISC_CCU_H */

-- 
2.42.0



  parent reply	other threads:[~2026-02-09  5:48 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-09  5:48 [PATCH 00/13] clk: amlogic: Introduce A9 PLL and CCU driver support Chuan Liu
2026-02-09  5:48 ` Chuan Liu via B4 Relay
2026-02-09  5:48 ` Chuan Liu via B4 Relay
2026-02-09  5:48 ` [PATCH 01/13] dt-bindings: clock: Add Amlogic A9 standardized model clock control units Chuan Liu
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09 13:14   ` Krzysztof Kozlowski
2026-02-09 13:14     ` Krzysztof Kozlowski
2026-04-08 14:37     ` Chuan Liu
2026-04-08 14:37       ` Chuan Liu
2026-02-09 13:18   ` Krzysztof Kozlowski
2026-02-09 13:18     ` Krzysztof Kozlowski
2026-02-09  5:48 ` [PATCH 02/13] dt-bindings: clock: Add Amlogic A9 PLL controllers Chuan Liu
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48 ` Chuan Liu [this message]
2026-02-09  5:48   ` [PATCH 03/13] dt-bindings: clock: Add Amlogic A9 misc clock control units Chuan Liu via B4 Relay
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09 13:15   ` Krzysztof Kozlowski
2026-02-09 13:15     ` Krzysztof Kozlowski
2026-02-09  5:48 ` [PATCH 04/13] clk: amlogic: Add basic clock driver Chuan Liu
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09 13:17   ` Krzysztof Kozlowski
2026-02-09 13:17     ` Krzysztof Kozlowski
2026-04-08 14:32     ` Chuan Liu
2026-04-08 14:32       ` Chuan Liu
2026-04-08 17:34       ` Jerome Brunet
2026-04-08 17:34         ` Jerome Brunet
2026-04-15 12:21         ` Chuan Liu
2026-04-15 12:21           ` Chuan Liu
2026-04-09  6:12       ` Krzysztof Kozlowski
2026-04-09  6:12         ` Krzysztof Kozlowski
2026-04-15 11:40         ` Chuan Liu
2026-04-15 11:40           ` Chuan Liu
2026-04-15 12:58           ` Krzysztof Kozlowski
2026-04-15 12:58             ` Krzysztof Kozlowski
2026-02-09  5:48 ` [PATCH 05/13] clk: amlogic: Add composite " Chuan Liu
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09 13:18   ` Krzysztof Kozlowski
2026-02-09 13:18     ` Krzysztof Kozlowski
2026-02-09  5:48 ` [PATCH 06/13] clk: amlogic: Add noglitch " Chuan Liu
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09 21:51   ` Martin Blumenstingl
2026-02-09 21:51     ` Martin Blumenstingl
2026-04-08 14:44     ` Chuan Liu
2026-04-08 14:44       ` Chuan Liu
2026-02-09  5:48 ` [PATCH 07/13] clk: amlogic: Add duandiv " Chuan Liu
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48 ` [PATCH 08/13] clk: amlogic: Add PLL driver Chuan Liu
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09 15:37   ` kernel test robot
2026-02-09 15:37     ` kernel test robot
2026-02-09 17:35   ` kernel test robot
2026-02-09 17:35     ` kernel test robot
2026-02-09  5:48 ` [PATCH 09/13] clk: amlogic: Add DT-based clock registration functions Chuan Liu
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48 ` [PATCH 10/13] clk: amlogic: Add A9 standardized model clock control units driver Chuan Liu
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48 ` [PATCH 11/13] clk: amlogic: Add A9 PLL controllers driver Chuan Liu
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48 ` [PATCH 12/13] clk: amlogic: Add A9 misc clock control units driver Chuan Liu
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48 ` [PATCH 13/13] clk: amlogic: Add support for building as combined kernel module Chuan Liu
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-09  5:48   ` Chuan Liu via B4 Relay
2026-02-11  8:34 ` [PATCH 00/13] clk: amlogic: Introduce A9 PLL and CCU driver support Jerome Brunet
2026-02-11  8:34   ` Jerome Brunet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260209-a9_clock_driver-v1-3-a9198dc03d2a@amlogic.com \
    --to=chuan.liu@amlogic.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=neil.armstrong@linaro.org \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.