Skip to contentSkip to conversation

Add S4 SoC PLLs and Peripheral clock

PATCH Applied Yu Tu 2 participants 6 messages Sep 4, 2023 – Sep 27, 2023

Subsystems (4)
lore
Share & tools
lore

Yu Tu

author
#0 lore raw

v11 cover Add S4 SoC PLLs and Peripheral clock

1. Add S4 SoC PLLs and Peripheral clock controller dt-bindings.
2. Add PLLs and Peripheral clock controller driver for S4 SOC.

Yu Tu (4):
dt-bindings: clock: document Amlogic S4 SoC PLL clock controller
dt-bindings: clock: document Amlogic S4 SoC peripherals clock
controller
clk: meson: S4: add support for Amlogic S4 SoC PLL clock driver
clk: meson: S4: add support for Amlogic S4 SoC peripheral clock
controller

V10 -> V11:
1. Change patch 0001/0002 dt-bindings tag. Suggested by Krzysztof.
2. Change patch 0002 dt-bindings added minItems. Suggested by Jerome.
3. Change patch 0004 added clock ".flags = 0" and comment. Suggested by Jerome.

V9 -> V10:
1. Change the relevant S4 CLK patch based on Neil's recently modified patch.
2. Change patch 0003/0004 clocks comment, format and clock flags suggested by Jerome.

V8 -> V9: Add patch 0001/0002 dt-bindings tag. Suggested by Krzysztof. V7 -> V8:
1. Change patch 0001/0002 dt-bindings title description, remove "meson". Suggested by Dmitry, Neil.
2. Change patch 0003/0004 clocks comment, format and clock flags suggested by Dmitry, Neil, Jerome.

V6 -> V7: Change send patch series as well change format and clock flags suggested by Jerome. Change dt-bindings suggested by Krzysztof. V5 -> V6: Change send patch series, as well change format and clock flags. V4 -> V5: change format and clock flags and adjust the patch series as suggested by Jerome.
V3 -> V4: change format and clock flags.
V2 -> V3: Use two clock controller.
V1 -> V2: Change format as discussed in the email.

 .../clock/amlogic,s4-peripherals-clkc.yaml    |   96 +
 .../bindings/clock/amlogic,s4-pll-clkc.yaml   |   49 +
 drivers/clk/meson/Kconfig                     |   23 +
 drivers/clk/meson/Makefile                    |    2 +
 drivers/clk/meson/s4-peripherals.c            | 3813 +++++++++++++++++
 drivers/clk/meson/s4-peripherals.h            |   57 +
 drivers/clk/meson/s4-pll.c                    |  867 ++++
 drivers/clk/meson/s4-pll.h                    |   38 +
 .../clock/amlogic,s4-peripherals-clkc.h       |  236 +
 .../dt-bindings/clock/amlogic,s4-pll-clkc.h   |   43 +
 10 files changed, 5224 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/amlogic,s4-peripherals-clkc.yaml
 create mode 100644 Documentation/devicetree/bindings/clock/amlogic,s4-pll-clkc.yaml
 create mode 100644 drivers/clk/meson/s4-peripherals.c
 create mode 100644 drivers/clk/meson/s4-peripherals.h
 create mode 100644 drivers/clk/meson/s4-pll.c
 create mode 100644 drivers/clk/meson/s4-pll.h
 create mode 100644 include/dt-bindings/clock/amlogic,s4-peripherals-clkc.h
 create mode 100644 include/dt-bindings/clock/amlogic,s4-pll-clkc.h

base-commit: 41680df0975e04b959a28bf6ab85fd6a307ae0ea

Signature · 7 lines
2.33.1


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
author
#1 lore raw

PATCH v11 1/4 dt-bindings: clock: document Amlogic S4 SoC PLL clock controller

Add the S4 PLL clock controller dt-bindings in the S4 SoC family.

---
 .../bindings/clock/amlogic,s4-pll-clkc.yaml   | 49 +++++++++++++++++++
 .../dt-bindings/clock/amlogic,s4-pll-clkc.h   | 43 ++++++++++++++++
 2 files changed, 92 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/amlogic,s4-pll-clkc.yaml
 create mode 100644 include/dt-bindings/clock/amlogic,s4-pll-clkc.h
Documentation/devicetree/bindings/clock/amlogic,s4-pll-clkc.yaml new file +49 -0
new file mode 100644
index 000000000000..d8932ec26ca8
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2022-2023 Amlogic, Inc. All rights reserved
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/amlogic,s4-pll-clkc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic S4 PLL Clock Controller
+
+maintainers:
+  - Yu Tu <[email protected]>
+
+properties:
+  compatible:
+    const: amlogic,s4-pll-clkc
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    items:
+      - const: xtal
+
+  "#clock-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - "#clock-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    clkc_pll: clock-controller@fe008000 {
+      compatible = "amlogic,s4-pll-clkc";
+      reg = <0xfe008000 0x1e8>;
+      clocks = <&xtal>;
+      clock-names = "xtal";
+      #clock-cells = <1>;
+    };
+
+...
include/dt-bindings/clock/amlogic,s4-pll-clkc.h new file +43 -0

43 lines not on this page · raw message

Signature · 1 line
2.33.1
author
#2 lore raw

PATCH v11 2/4 dt-bindings: clock: document Amlogic S4 SoC peripherals clock controller

In reply to Yu Tu

Add the S4 peripherals clock controller dt-bindings in the S4 SoC family.

---
 .../clock/amlogic,s4-peripherals-clkc.yaml    |  96 +++++++
 .../clock/amlogic,s4-peripherals-clkc.h       | 236 ++++++++++++++++++
 2 files changed, 332 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/amlogic,s4-peripherals-clkc.yaml
 create mode 100644 include/dt-bindings/clock/amlogic,s4-peripherals-clkc.h
Documentation/devicetree/bindings/clock/amlogic,s4-peripherals-clkc.yaml new file +96 -0
new file mode 100644
index 000000000000..c229e4f0c1d9
@@ -0,0 +1,96 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2022-2023 Amlogic, Inc. All rights reserved
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/amlogic,s4-peripherals-clkc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic S4 Peripherals Clock Controller
+
+maintainers:
+  - Yu Tu <[email protected]>
+
+properties:
+  compatible:
+    const: amlogic,s4-peripherals-clkc
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    minItems: 14
+    items:
+      - description: input fixed pll div2
+      - description: input fixed pll div2p5
+      - description: input fixed pll div3
+      - description: input fixed pll div4
+      - description: input fixed pll div5
+      - description: input fixed pll div7
+      - description: input hifi pll
+      - description: input gp0 pll
+      - description: input mpll0
+      - description: input mpll1
+      - description: input mpll2
+      - description: input mpll3
+      - description: input hdmi pll
+      - description: input oscillator (usually at 24MHz)
+      - description: input external 32kHz reference (optional)
+
+  clock-names:
+    minItems: 14
+    items:
+      - const: fclk_div2
+      - const: fclk_div2p5
+      - const: fclk_div3
+      - const: fclk_div4
+      - const: fclk_div5
+      - const: fclk_div7
+      - const: hifi_pll
+      - const: gp0_pll
+      - const: mpll0
+      - const: mpll1
+      - const: mpll2
+      - const: mpll3
+      - const: hdmi_pll
+      - const: xtal
+      - const: ext_32k
+
+  "#clock-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - "#clock-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/amlogic,s4-peripherals-clkc.h>
+
+    clkc_periphs: clock-controller@fe000000 {
+      compatible = "amlogic,s4-peripherals-clkc";
+      reg = <0xfe000000 0x49c>;
+      clocks = <&clkc_pll 3>,
+              <&clkc_pll 13>,
+              <&clkc_pll 5>,
+              <&clkc_pll 7>,
+              <&clkc_pll 9>,
+              <&clkc_pll 11>,
+              <&clkc_pll 17>,
+              <&clkc_pll 15>,
+              <&clkc_pll 25>,
+              <&clkc_pll 27>,
+              <&clkc_pll 29>,
+              <&clkc_pll 31>,
+              <&clkc_pll 20>,
+              <&xtal>;
+      clock-names = "fclk_div2", "fclk_div2p5", "fclk_div3", "fclk_div4",
+                    "fclk_div5", "fclk_div7", "hifi_pll", "gp0_pll",
+                    "mpll0", "mpll1", "mpll2", "mpll3", "hdmi_pll", "xtal";
+      #clock-cells = <1>;
+    };
+...
include/dt-bindings/clock/amlogic,s4-peripherals-clkc.h new file +236 -0

236 lines not on this page · raw message

Signature · 7 lines
2.33.1


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
author
#3 lore raw

PATCH v11 3/4 clk: meson: S4: add support for Amlogic S4 SoC PLL clock driver

In reply to Yu Tu

Add the S4 PLL clock controller driver in the S4 SoC family.

---
 drivers/clk/meson/Kconfig  |  12 +
 drivers/clk/meson/Makefile |   1 +
 drivers/clk/meson/s4-pll.c | 867 +++++++++++++++++++++++++++++++++++++
 drivers/clk/meson/s4-pll.h |  38 ++
 4 files changed, 918 insertions(+)
 create mode 100644 drivers/clk/meson/s4-pll.c
 create mode 100644 drivers/clk/meson/s4-pll.h
drivers/clk/meson/Kconfig +12 -0
index 135da8f2d0b1..e90982d77598 100644
@@ -144,4 +144,16 @@ config COMMON_CLK_G12A
 	help
 	  Support for the clock controller on Amlogic S905D2, S905X2 and S905Y2
 	  devices, aka g12a. Say Y if you want peripherals to work.
+
+config COMMON_CLK_S4_PLL
+	tristate "S4 SoC PLL clock controllers support"
+	depends on ARM64
+	default y
+	select COMMON_CLK_MESON_MPLL
+	select COMMON_CLK_MESON_PLL
+	select COMMON_CLK_MESON_REGMAP
+	help
+	  Support for the PLL clock controller on Amlogic S805X2 and S905Y4 devices,
+	  AKA S4. Say Y if you want the board to work, because PLLs are the parent of
+	  most peripherals.
 endmenu
drivers/clk/meson/Makefile +1 -0
index cd961cc4f4db..612cee923890 100644
@@ -22,3 +22,4 @@ obj-$(CONFIG_COMMON_CLK_A1_PERIPHERALS) += a1-peripherals.o
 obj-$(CONFIG_COMMON_CLK_GXBB) += gxbb.o gxbb-aoclk.o
 obj-$(CONFIG_COMMON_CLK_G12A) += g12a.o g12a-aoclk.o
 obj-$(CONFIG_COMMON_CLK_MESON8B) += meson8b.o meson8-ddr.o
+obj-$(CONFIG_COMMON_CLK_S4_PLL) += s4-pll.o
drivers/clk/meson/s4-pll.c new file +867 -0

867 lines not on this page · raw message

drivers/clk/meson/s4-pll.h new file +38 -0
new file mode 100644
index 000000000000..ff7d58302f2a
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+/*
+ * Copyright (c) 2022-2023 Amlogic, inc. All rights reserved
+ * Author: Yu Tu <[email protected]>
+ */
+
+#ifndef __MESON_S4_PLL_H__
+#define __MESON_S4_PLL_H__
+
+#define ANACTRL_FIXPLL_CTRL0                       0x040
+#define ANACTRL_FIXPLL_CTRL1                       0x044
+#define ANACTRL_FIXPLL_CTRL3                       0x04c
+#define ANACTRL_GP0PLL_CTRL0                       0x080
+#define ANACTRL_GP0PLL_CTRL1                       0x084
+#define ANACTRL_GP0PLL_CTRL2                       0x088
+#define ANACTRL_GP0PLL_CTRL3                       0x08c
+#define ANACTRL_GP0PLL_CTRL4                       0x090
+#define ANACTRL_GP0PLL_CTRL5                       0x094
+#define ANACTRL_GP0PLL_CTRL6                       0x098
+#define ANACTRL_HIFIPLL_CTRL0                      0x100
+#define ANACTRL_HIFIPLL_CTRL1                      0x104
+#define ANACTRL_HIFIPLL_CTRL2                      0x108
+#define ANACTRL_HIFIPLL_CTRL3                      0x10c
+#define ANACTRL_HIFIPLL_CTRL4                      0x110
+#define ANACTRL_HIFIPLL_CTRL5                      0x114
+#define ANACTRL_HIFIPLL_CTRL6                      0x118
+#define ANACTRL_MPLL_CTRL0                         0x180
+#define ANACTRL_MPLL_CTRL1                         0x184
+#define ANACTRL_MPLL_CTRL2                         0x188
+#define ANACTRL_MPLL_CTRL3                         0x18c
+#define ANACTRL_MPLL_CTRL4                         0x190
+#define ANACTRL_MPLL_CTRL5                         0x194
+#define ANACTRL_MPLL_CTRL6                         0x198
+#define ANACTRL_MPLL_CTRL7                         0x19c
+#define ANACTRL_MPLL_CTRL8                         0x1a0
+#define ANACTRL_HDMIPLL_CTRL0                      0x1c0
+
+#endif /* __MESON_S4_PLL_H__ */
Signature · 7 lines
2.33.1


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
author
#4 lore raw

PATCH v11 4/4 clk: meson: S4: add support for Amlogic S4 SoC peripheral clock controller

In reply to Yu Tu

Add the peripherals clock controller driver in the S4 SoC family.

---
 drivers/clk/meson/Kconfig          |   11 +
 drivers/clk/meson/Makefile         |    1 +
 drivers/clk/meson/s4-peripherals.c | 3813 ++++++++++++++++++++++++++++
 drivers/clk/meson/s4-peripherals.h |   57 +
 4 files changed, 3882 insertions(+)
 create mode 100644 drivers/clk/meson/s4-peripherals.c
 create mode 100644 drivers/clk/meson/s4-peripherals.h
drivers/clk/meson/Kconfig +11 -0
index e90982d77598..c5303e4c1604 100644
@@ -156,4 +156,15 @@ config COMMON_CLK_S4_PLL
 	  Support for the PLL clock controller on Amlogic S805X2 and S905Y4 devices,
 	  AKA S4. Say Y if you want the board to work, because PLLs are the parent of
 	  most peripherals.
+
+config COMMON_CLK_S4_PERIPHERALS
+	tristate "S4 SoC peripherals clock controllers support"
+	depends on ARM64
+	default y
+	select COMMON_CLK_MESON_REGMAP
+	select COMMON_CLK_MESON_DUALDIV
+	select COMMON_CLK_MESON_VID_PLL_DIV
+	help
+	  Support for the peripherals clock controller on Amlogic S805X2 and S905Y4
+	  devices, AKA S4. Say Y if you want S4 peripherals clock controller to work.
 endmenu
drivers/clk/meson/Makefile +1 -0
index 612cee923890..9ee4b954c896 100644
@@ -23,3 +23,4 @@ obj-$(CONFIG_COMMON_CLK_GXBB) += gxbb.o gxbb-aoclk.o
 obj-$(CONFIG_COMMON_CLK_G12A) += g12a.o g12a-aoclk.o
 obj-$(CONFIG_COMMON_CLK_MESON8B) += meson8b.o meson8-ddr.o
 obj-$(CONFIG_COMMON_CLK_S4_PLL) += s4-pll.o
+obj-$(CONFIG_COMMON_CLK_S4_PERIPHERALS) += s4-peripherals.o
drivers/clk/meson/s4-peripherals.c new file +3813 -0

2,981 lines not on this page · raw message

drivers/clk/meson/s4-peripherals.h new file +57 -0

57 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.33.1

Part of the diff is not shown here. View the raw message.

maintainer Applied
#5 lore raw
In reply to Yu Tu
Quoted 61 lines · Yu Tu

1. Add S4 SoC PLLs and Peripheral clock controller dt-bindings.
2. Add PLLs and Peripheral clock controller driver for S4 SOC.

Yu Tu (4):
dt-bindings: clock: document Amlogic S4 SoC PLL clock controller
dt-bindings: clock: document Amlogic S4 SoC peripherals clock
controller
clk: meson: S4: add support for Amlogic S4 SoC PLL clock driver
clk: meson: S4: add support for Amlogic S4 SoC peripheral clock
controller

V10 -> V11:
1. Change patch 0001/0002 dt-bindings tag. Suggested by Krzysztof.
2. Change patch 0002 dt-bindings added minItems. Suggested by Jerome.
3. Change patch 0004 added clock ".flags = 0" and comment. Suggested by Jerome.

V9 -> V10:
1. Change the relevant S4 CLK patch based on Neil's recently modified patch.
2. Change patch 0003/0004 clocks comment, format and clock flags suggested by Jerome.

V8 -> V9: Add patch 0001/0002 dt-bindings tag. Suggested by Krzysztof. V7 -> V8:
1. Change patch 0001/0002 dt-bindings title description, remove "meson". Suggested by Dmitry, Neil.
2. Change patch 0003/0004 clocks comment, format and clock flags suggested by Dmitry, Neil, Jerome.

V6 -> V7: Change send patch series as well change format and clock flags suggested by Jerome. Change dt-bindings suggested by Krzysztof. V5 -> V6: Change send patch series, as well change format and clock flags. V4 -> V5: change format and clock flags and adjust the patch series as suggested by Jerome.
V3 -> V4: change format and clock flags.
V2 -> V3: Use two clock controller.
V1 -> V2: Change format as discussed in the email.

 .../clock/amlogic,s4-peripherals-clkc.yaml    |   96 +
 .../bindings/clock/amlogic,s4-pll-clkc.yaml   |   49 +
 drivers/clk/meson/Kconfig                     |   23 +
 drivers/clk/meson/Makefile                    |    2 +
 drivers/clk/meson/s4-peripherals.c            | 3813 +++++++++++++++++
 drivers/clk/meson/s4-peripherals.h            |   57 +
 drivers/clk/meson/s4-pll.c                    |  867 ++++
 drivers/clk/meson/s4-pll.h                    |   38 +
 .../clock/amlogic,s4-peripherals-clkc.h       |  236 +
 .../dt-bindings/clock/amlogic,s4-pll-clkc.h   |   43 +
 10 files changed, 5224 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/amlogic,s4-peripherals-clkc.yaml
 create mode 100644 Documentation/devicetree/bindings/clock/amlogic,s4-pll-clkc.yaml
 create mode 100644 drivers/clk/meson/s4-peripherals.c
 create mode 100644 drivers/clk/meson/s4-peripherals.h
 create mode 100644 drivers/clk/meson/s4-pll.c
 create mode 100644 drivers/clk/meson/s4-pll.h
 create mode 100644 include/dt-bindings/clock/amlogic,s4-peripherals-clkc.h
 create mode 100644 include/dt-bindings/clock/amlogic,s4-pll-clkc.h
Quoted 1 line

base-commit: 41680df0975e04b959a28bf6ab85fd6a307ae0ea

Applied.
Thx.