Skip to contentSkip to conversation

add clk controller driver for Meson-AXG SoC

PATCH Applied Yixun Lan 3 participants 18 messages Dec 11, 2017 – Dec 15, 2017

Subsystems (5)
lore
Share & tools
lore

Yixun Lan

author
#0 lore raw

v7 cover add clk controller driver for Meson-AXG SoC

Add driver for the clk controller which found in Meson AXG SoC

Note, we deliberately create a seperate source file for the Meson AXG
series, instead of sharing code with previous GXBB/GXL - the file axg.c It would help us maintaining the code more easily.

Changes since v6 [6]:
- move the spinlock' change patch as first as the dependency
- drop unnecessary flag CLK_GET_RATE_NOCACHE, CLK_SET_RATE_NO_REPARENT
- drop useless comments
- fix checkpatch issue, over 80 characters

Changes since v5 [5]:
- add Rob's Ack for patch 2, add Neil's Ack for patch 3
- include spinlock' name change patch, patch 4
- include uart_ao clock DTS patch

Changes since v4 [4]:
- use devm_ioremap instead of devm_ioremap_resource
- rename DT node using generic name 'bus'

Changes since v3 [3]:
- separate dt-bindings header file
- adjust license note as standard way
- replace of_iomap with platform/devm API
- add Rob's Ack to Patch 1,4

Changes since v2 [2]:
- drop register offset calculation
- update dt-bindings for new compatible variant

Changes since v1 [1]:
- rework register definion, use '(offset << 2)' to better match the description from data sheet
- drop "#include dt-bindings/clock/gxbb-aoclkc.h" from dts
- rebase code to v4.15-rc1

[6]
http://lists.infradead.org/pipermail/linux-amlogic/2017-December/005721.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-December/005722.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-December/005723.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-December/005724.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-December/005725.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-December/005726.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-December/005727.html

[5]
http://lists.infradead.org/pipermail/linux-amlogic/2017-December/005655.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-December/005656.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-December/005657.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-December/005658.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-December/005659.html

[4]
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005522.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005525.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005526.html

[3]
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005487.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005488.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005489.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005490.html

[2]
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005468.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005469.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005470.html

[1]
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005239.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005240.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005241.html

Qiufang Dai (3):
clk: meson-axg: add clocks dt-bindings required header
clk: meson-axg: add clock controller drivers
arm64: dts: meson-axg: add clock DT info for Meson AXG SoC

Yixun Lan (3):
clk: meson: make the spinlock naming more specific
dt-bindings: clock: add compatible variant for the Meson-AXG
arm64: dts: meson-axg: switch uart_ao clock to CLK81

 .../bindings/clock/amlogic,gxbb-clkc.txt           |   7 +-
 arch/arm64/Kconfig.platforms                       |   1 +
 arch/arm64/boot/dts/amlogic/meson-axg-s400.dts     |   2 +
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi         |  19 +-
 drivers/clk/meson/Kconfig                          |   8 +
 drivers/clk/meson/Makefile                         |   1 +
 drivers/clk/meson/axg.c                            | 936 +++++++++++++++++++++
 drivers/clk/meson/axg.h                            | 126 +++
 drivers/clk/meson/clkc.h                           |   2 +-
 drivers/clk/meson/gxbb.c                           | 112 +--
 drivers/clk/meson/meson8b.c                        |  24 +-
 include/dt-bindings/clock/axg-clkc.h               |  71 ++
 12 files changed, 1234 insertions(+), 75 deletions(-)
 create mode 100644 drivers/clk/meson/axg.c
 create mode 100644 drivers/clk/meson/axg.h
 create mode 100644 include/dt-bindings/clock/axg-clkc.h
Signature · 1 line
2.15.1
author
#1 lore raw

PATCH v7 1/6 clk: meson: make the spinlock naming more specific

Make the spinlock more specific, so better for lockdep debugging and ctags/grep.

---

this patch try to address the issue which bring up by Stephen at [1]
[1] http://lists.infradead.org/pipermail/linux-amlogic/2017-December/005534.html

---
 drivers/clk/meson/clkc.h    |   2 +-
 drivers/clk/meson/gxbb.c    | 112 ++++++++++++++++++++++----------------------
 drivers/clk/meson/meson8b.c |  24 +++++-----
 3 files changed, 69 insertions(+), 69 deletions(-)
drivers/clk/meson/clkc.h +1 -1
index 1629da9b4141..c2ff0520ce53 100644
@@ -134,7 +134,7 @@ struct meson_clk_audio_divider {
 struct clk_gate _name = { 						\
 	.reg = (void __iomem *) _reg, 					\
 	.bit_idx = (_bit), 						\
-	.lock = &clk_lock,						\
+	.lock = &meson_clk_lock,					\
 	.hw.init = &(struct clk_init_data) { 				\
 		.name = #_name,					\
 		.ops = &clk_gate_ops,					\
drivers/clk/meson/gxbb.c +56 -56

448 lines not on this page · raw message

drivers/clk/meson/meson8b.c +12 -12
index 20ab7190d328..3ffea80c1308 100644
@@ -32,7 +32,7 @@
 #include "clkc.h"
 #include "meson8b.h"
 
-static DEFINE_SPINLOCK(clk_lock);
+static DEFINE_SPINLOCK(meson_clk_lock);
 
 static void __iomem *clk_base;
 
@@ -136,7 +136,7 @@ static struct meson_clk_pll meson8b_fixed_pll = {
 		.shift   = 16,
 		.width   = 2,
 	},
-	.lock = &clk_lock,
+	.lock = &meson_clk_lock,
 	.hw.init = &(struct clk_init_data){
 		.name = "fixed_pll",
 		.ops = &meson_clk_pll_ro_ops,
@@ -162,7 +162,7 @@ static struct meson_clk_pll meson8b_vid_pll = {
 		.shift   = 16,
 		.width   = 2,
 	},
-	.lock = &clk_lock,
+	.lock = &meson_clk_lock,
 	.hw.init = &(struct clk_init_data){
 		.name = "vid_pll",
 		.ops = &meson_clk_pll_ro_ops,
@@ -190,7 +190,7 @@ static struct meson_clk_pll meson8b_sys_pll = {
 	},
 	.rate_table = sys_pll_rate_table,
 	.rate_count = ARRAY_SIZE(sys_pll_rate_table),
-	.lock = &clk_lock,
+	.lock = &meson_clk_lock,
 	.hw.init = &(struct clk_init_data){
 		.name = "sys_pll",
 		.ops = &meson_clk_pll_ops,
@@ -281,7 +281,7 @@ static struct meson_clk_mpll meson8b_mpll0 = {
 		.shift   = 25,
 		.width   = 1,
 	},
-	.lock = &clk_lock,
+	.lock = &meson_clk_lock,
 	.hw.init = &(struct clk_init_data){
 		.name = "mpll0",
 		.ops = &meson_clk_mpll_ops,
@@ -311,7 +311,7 @@ static struct meson_clk_mpll meson8b_mpll1 = {
 		.shift   = 14,
 		.width   = 1,
 	},
-	.lock = &clk_lock,
+	.lock = &meson_clk_lock,
 	.hw.init = &(struct clk_init_data){
 		.name = "mpll1",
 		.ops = &meson_clk_mpll_ops,
@@ -341,7 +341,7 @@ static struct meson_clk_mpll meson8b_mpll2 = {
 		.shift   = 14,
 		.width   = 1,
 	},
-	.lock = &clk_lock,
+	.lock = &meson_clk_lock,
 	.hw.init = &(struct clk_init_data){
 		.name = "mpll2",
 		.ops = &meson_clk_mpll_ops,
@@ -375,7 +375,7 @@ struct clk_mux meson8b_mpeg_clk_sel = {
 	.shift = 12,
 	.flags = CLK_MUX_READ_ONLY,
 	.table = mux_table_clk81,
-	.lock = &clk_lock,
+	.lock = &meson_clk_lock,
 	.hw.init = &(struct clk_init_data){
 		.name = "mpeg_clk_sel",
 		.ops = &clk_mux_ro_ops,
@@ -395,7 +395,7 @@ struct clk_divider meson8b_mpeg_clk_div = {
 	.reg = (void *)HHI_MPEG_CLK_CNTL,
 	.shift = 0,
 	.width = 7,
-	.lock = &clk_lock,
+	.lock = &meson_clk_lock,
 	.hw.init = &(struct clk_init_data){
 		.name = "mpeg_clk_div",
 		.ops = &clk_divider_ops,
@@ -408,7 +408,7 @@ struct clk_divider meson8b_mpeg_clk_div = {
 struct clk_gate meson8b_clk81 = {
 	.reg = (void *)HHI_MPEG_CLK_CNTL,
 	.bit_idx = 7,
-	.lock = &clk_lock,
+	.lock = &meson_clk_lock,
 	.hw.init = &(struct clk_init_data){
 		.name = "clk81",
 		.ops = &clk_gate_ops,
@@ -773,7 +773,7 @@ static int meson8b_clk_reset_update(struct reset_controller_dev *rcdev,
 
 	reset = &meson8b_clk_reset_bits[id];
 
-	spin_lock_irqsave(&clk_lock, flags);
+	spin_lock_irqsave(&meson_clk_lock, flags);
 
 	val = readl(meson8b_clk_reset->base + reset->reg);
 	if (assert)
@@ -782,7 +782,7 @@ static int meson8b_clk_reset_update(struct reset_controller_dev *rcdev,
 		val &= ~BIT(reset->bit_idx);
 	writel(val, meson8b_clk_reset->base + reset->reg);
 
-	spin_unlock_irqrestore(&clk_lock, flags);
+	spin_unlock_irqrestore(&meson_clk_lock, flags);
 
 	return 0;
 }
Signature · 1 line
2.15.1
maintainer Applied
#2 lore raw

Re: [PATCH v7 1/6] clk: meson: make the spinlock naming more specific

Quoted 5 lines · Yixun Lan

Make the spinlock more specific, so better for lockdep debugging and ctags/grep.

Applied to next/drivers

Thx

Quoted 10 lines

---

this patch try to address the issue which bring up by Stephen at [1]
[1] http://lists.infradead.org/pipermail/linux-amlogic/2017-December/005534.html

---
 drivers/clk/meson/clkc.h    |   2 +-
 drivers/clk/meson/gxbb.c    | 112 ++++++++++++++++++++++----------------------
 drivers/clk/meson/meson8b.c |  24 +++++-----
 3 files changed, 69 insertions(+), 69 deletions(-)
author
#3 lore raw

PATCH v7 2/6 dt-bindings: clock: add compatible variant for the Meson-AXG

In reply to Yixun Lan

Update the documentation to support clock driver for the Amlogic's Meson-AXG SoC.

---
 Documentation/devicetree/bindings/clock/amlogic,gxbb-clkc.txt | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/clock/amlogic,gxbb-clkc.txt +5 -2
index 924040769186..e2b377ed6f91 100644
@@ -5,8 +5,11 @@ controllers within the SoC.
 
 Required Properties:
 
-- compatible: should be "amlogic,gxbb-clkc" for GXBB SoC,
-	      or "amlogic,gxl-clkc" for GXL and GXM SoC.
+- compatible: should be:
+		"amlogic,gxbb-clkc" for GXBB SoC,
+		"amlogic,gxl-clkc" for GXL and GXM SoC,
+		"amlogic,axg-clkc" for AXG SoC.
+
 - reg: physical base address of the clock controller and length of memory
        mapped region.
 
Signature · 1 line
2.15.1
maintainer Applied
#4 lore raw

Re: [PATCH v7 2/6] dt-bindings: clock: add compatible variant for the Meson-AXG

Quoted 5 lines · Yixun Lan

Update the documentation to support clock driver for the Amlogic's Meson-AXG SoC.

Applied to next/dt

Thx

Quoted 3 lines
---
 Documentation/devicetree/bindings/clock/amlogic,gxbb-clkc.txt | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
author
#5 lore raw

PATCH v7 3/6 clk: meson-axg: add clocks dt-bindings required header

In reply to Yixun Lan

From: Qiufang Dai <[email protected]>

Add the required header for the clocks ID dt-bindings exported from various subsystem in the Meson-AXG SoC.

---
 include/dt-bindings/clock/axg-clkc.h | 71 ++++++++++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)
 create mode 100644 include/dt-bindings/clock/axg-clkc.h
include/dt-bindings/clock/axg-clkc.h new file +71 -0
new file mode 100644
index 000000000000..941ac70e7f30
@@ -0,0 +1,71 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
+/*
+ * Meson-AXG clock tree IDs
+ *
+ * Copyright (c) 2017 Amlogic, Inc. All rights reserved.
+ */
+
+#ifndef __AXG_CLKC_H
+#define __AXG_CLKC_H
+
+#define CLKID_SYS_PLL				0
+#define CLKID_FIXED_PLL				1
+#define CLKID_FCLK_DIV2				2
+#define CLKID_FCLK_DIV3				3
+#define CLKID_FCLK_DIV4				4
+#define CLKID_FCLK_DIV5				5
+#define CLKID_FCLK_DIV7				6
+#define CLKID_GP0_PLL				7
+#define CLKID_CLK81				10
+#define CLKID_MPLL0				11
+#define CLKID_MPLL1				12
+#define CLKID_MPLL2				13
+#define CLKID_MPLL3				14
+#define CLKID_DDR				15
+#define CLKID_AUDIO_LOCKER			16
+#define CLKID_MIPI_DSI_HOST			17
+#define CLKID_ISA				18
+#define CLKID_PL301				19
+#define CLKID_PERIPHS				20
+#define CLKID_SPICC0				21
+#define CLKID_I2C				22
+#define CLKID_RNG0				23
+#define CLKID_UART0				24
+#define CLKID_MIPI_DSI_PHY			25
+#define CLKID_SPICC1				26
+#define CLKID_PCIE_A				27
+#define CLKID_PCIE_B				28
+#define CLKID_HIU_IFACE				29
+#define CLKID_ASSIST_MISC			30
+#define CLKID_SD_EMMC_B				31
+#define CLKID_SD_EMMC_C				32
+#define CLKID_DMA				33
+#define CLKID_SPI				34
+#define CLKID_AUDIO				35
+#define CLKID_ETH				36
+#define CLKID_UART1				37
+#define CLKID_G2D				38
+#define CLKID_USB0				39
+#define CLKID_USB1				40
+#define CLKID_RESET				41
+#define CLKID_USB				42
+#define CLKID_AHB_ARB0				43
+#define CLKID_EFUSE				44
+#define CLKID_BOOT_ROM				45
+#define CLKID_AHB_DATA_BUS			46
+#define CLKID_AHB_CTRL_BUS			47
+#define CLKID_USB1_DDR_BRIDGE			48
+#define CLKID_USB0_DDR_BRIDGE			49
+#define CLKID_MMC_PCLK				50
+#define CLKID_VPU_INTR				51
+#define CLKID_SEC_AHB_AHB3_BRIDGE		52
+#define CLKID_GIC				53
+#define CLKID_AO_MEDIA_CPU			54
+#define CLKID_AO_AHB_SRAM			55
+#define CLKID_AO_AHB_BUS			56
+#define CLKID_AO_IFACE				57
+#define CLKID_AO_I2C				58
+#define CLKID_SD_EMMC_B_CLK0			59
+#define CLKID_SD_EMMC_C_CLK0			60
+
+#endif /* __AXG_CLKC_H */
Signature · 1 line
2.15.1
maintainer Applied
#6 lore raw

Re: [PATCH v7 3/6] clk: meson-axg: add clocks dt-bindings required header

Quoted 8 lines · Yixun Lan

From: Qiufang Dai <[email protected]>

Add the required header for the clocks ID dt-bindings exported from various subsystem in the Meson-AXG SoC.

Applied to next/dt

Thx

Quoted 4 lines
---
 include/dt-bindings/clock/axg-clkc.h | 71 ++++++++++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)
 create mode 100644 include/dt-bindings/clock/axg-clkc.h
author
#7 lore raw

PATCH v7 4/6 clk: meson-axg: add clock controller drivers

In reply to Yixun Lan

From: Qiufang Dai <[email protected]>

Add clock controller drivers for Amlogic Meson-AXG SoC.

---
 arch/arm64/Kconfig.platforms |   1 +
 drivers/clk/meson/Kconfig    |   8 +
 drivers/clk/meson/Makefile   |   1 +
 drivers/clk/meson/axg.c      | 936 +++++++++++++++++++++++++++++++++++++++++++
 drivers/clk/meson/axg.h      | 126 ++++++
 5 files changed, 1072 insertions(+)
 create mode 100644 drivers/clk/meson/axg.c
 create mode 100644 drivers/clk/meson/axg.h
arch/arm64/Kconfig.platforms +1 -0
index 2401373565ff..fbedbd8f619a 100644
@@ -105,6 +105,7 @@ config ARCH_MESON
 	select PINCTRL_MESON
 	select COMMON_CLK_AMLOGIC
 	select COMMON_CLK_GXBB
+	select COMMON_CLK_AXG
 	select MESON_IRQ_GPIO
 	help
 	  This enables support for the Amlogic S905 SoCs.
drivers/clk/meson/Kconfig +8 -0
index d2d0174a6eca..7694302c70a4 100644
@@ -19,3 +19,11 @@ config COMMON_CLK_GXBB
 	help
 	  Support for the clock controller on AmLogic S905 devices, aka gxbb.
 	  Say Y if you want peripherals and CPU frequency scaling to work.
+
+config COMMON_CLK_AXG
+	bool
+	depends on COMMON_CLK_AMLOGIC
+	select RESET_CONTROLLER
+	help
+	  Support for the clock controller on AmLogic A113D devices, aka axg.
+	  Say Y if you want peripherals and CPU frequency scaling to work.
drivers/clk/meson/Makefile +1 -0
index b139d41b25da..3c03ce583798 100644
@@ -5,3 +5,4 @@
 obj-$(CONFIG_COMMON_CLK_AMLOGIC) += clk-pll.o clk-cpu.o clk-mpll.o clk-audio-divider.o
 obj-$(CONFIG_COMMON_CLK_MESON8B) += meson8b.o
 obj-$(CONFIG_COMMON_CLK_GXBB)	 += gxbb.o gxbb-aoclk.o gxbb-aoclk-regmap.o gxbb-aoclk-32k.o
+obj-$(CONFIG_COMMON_CLK_AXG)	 += axg.o
drivers/clk/meson/axg.c new file +936 -0

936 lines not on this page · raw message

drivers/clk/meson/axg.h new file +126 -0

126 lines not on this page · raw message

Signature · 1 line
2.15.1
maintainer Applied
#8 lore raw

Re: [PATCH v7 4/6] clk: meson-axg: add clock controller drivers

Quoted 7 lines · Yixun Lan

From: Qiufang Dai <[email protected]>

Add clock controller drivers for Amlogic Meson-AXG SoC.

Applied to next/drivers

Thx

Quoted 9 lines
---
 arch/arm64/Kconfig.platforms |   1 +
 drivers/clk/meson/Kconfig    |   8 +
 drivers/clk/meson/Makefile   |   1 +
 drivers/clk/meson/axg.c      | 936 +++++++++++++++++++++++++++++++++++++++++++
 drivers/clk/meson/axg.h      | 126 ++++++
 5 files changed, 1072 insertions(+)
 create mode 100644 drivers/clk/meson/axg.c
 create mode 100644 drivers/clk/meson/axg.h
author
#9 lore raw

PATCH v7 5/6 arm64: dts: meson-axg: add clock DT info for Meson AXG SoC

In reply to Yixun Lan

From: Qiufang Dai <[email protected]>

Try to add Hiubus DT info, and also enable clock DT info for the Amlogic's Meson-AXG SoC.

---
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +14 -0
index b932a784b02a..6fe5ee0c144e 100644
@@ -148,6 +148,20 @@
 			#address-cells = <0>;
 		};
 
+		hiubus: bus at ff63c000 {
+			compatible = "simple-bus";
+			reg = <0x0 0xff63c000 0x0 0x1c00>;
+			#address-cells = <2>;
+			#size-cells = <2>;
+			ranges = <0x0 0x0 0x0 0xff63c000 0x0 0x1c00>;
+
+			clkc: clock-controller at 0 {
+				compatible = "amlogic,axg-clkc";
+				#clock-cells = <1>;
+				reg = <0x0 0x0 0x0 0x320>;
+			};
+		};
+
 		mailbox: mailbox at ff63dc00 {
 			compatible = "amlogic,meson-gx-mhu", "amlogic,meson-gxbb-mhu";
 			reg = <0 0xff63dc00 0 0x400>;
Signature · 1 line
2.15.1
maintainer Applied
#10 lore raw

Re: [PATCH v7 5/6] arm64: dts: meson-axg: add clock DT info for Meson AXG SoC

Quoted 8 lines · Yixun Lan

From: Qiufang Dai <[email protected]>

Try to add Hiubus DT info, and also enable clock DT info for the Amlogic's Meson-AXG SoC.

Applied to v4.16/dt64,

Thanks,

Kevin

Quoted 29 lines
---
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +14 -0
index b932a784b02a..6fe5ee0c144e 100644
@@ -148,6 +148,20 @@
 			#address-cells = <0>;
 		};
 
+		hiubus: bus at ff63c000 {
+			compatible = "simple-bus";
+			reg = <0x0 0xff63c000 0x0 0x1c00>;
+			#address-cells = <2>;
+			#size-cells = <2>;
+			ranges = <0x0 0x0 0x0 0xff63c000 0x0 0x1c00>;
+
+			clkc: clock-controller at 0 {
+				compatible = "amlogic,axg-clkc";
+				#clock-cells = <1>;
+				reg = <0x0 0x0 0x0 0x320>;
+			};
+		};
+
 		mailbox: mailbox at ff63dc00 {
 			compatible = "amlogic,meson-gx-mhu", "amlogic,meson-gxbb-mhu";
 			reg = <0 0xff63dc00 0 0x400>;
author
#11 lore raw

PATCH v7 6/6 arm64: dts: meson-axg: switch uart_ao clock to CLK81

In reply to Yixun Lan

Switch the uart_ao pclk to CLK81 since the clock driver is ready. Also move the clock info to the board.dts instead in the soc.dtsi.

---
 arch/arm64/boot/dts/amlogic/meson-axg-s400.dts | 2 ++
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi     | 5 +----
 2 files changed, 3 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +2 -0
index 70eca1f8736a..718bbebff107 100644
@@ -19,4 +19,6 @@
 
 &uart_AO {
 	status = "okay";
+	clocks = <&xtal>, <&clkc CLKID_CLK81>, <&xtal>;
+	clock-names = "xtal", "pclk", "baud";
 };
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +1 -4
index 6fe5ee0c144e..f5b496bfd4de 100644
@@ -7,6 +7,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/clock/axg-clkc.h>
 
 / {
 	compatible = "amlogic,meson-axg";
@@ -200,8 +201,6 @@
 				compatible = "amlogic,meson-gx-uart", "amlogic,meson-ao-uart";
 				reg = <0x0 0x3000 0x0 0x18>;
 				interrupts = <GIC_SPI 193 IRQ_TYPE_EDGE_RISING>;
-				clocks = <&xtal>, <&xtal>, <&xtal>;
-				clock-names = "xtal", "pclk", "baud";
 				status = "disabled";
 			};
 
@@ -209,8 +208,6 @@
 				compatible = "amlogic,meson-gx-uart", "amlogic,meson-ao-uart";
 				reg = <0x0 0x4000 0x0 0x18>;
 				interrupts = <GIC_SPI 197 IRQ_TYPE_EDGE_RISING>;
-				clocks = <&xtal>, <&xtal>, <&xtal>;
-				clock-names = "xtal", "pclk", "baud";
 				status = "disabled";
 			};
 		};
Signature · 1 line
2.15.1
maintainer
#12 lore raw

Re: [PATCH v7 6/6] arm64: dts: meson-axg: switch uart_ao clock to CLK81

Quoted 2 lines · Yixun Lan

Switch the uart_ao pclk to CLK81 since the clock driver is ready. Also move the clock info to the board.dts instead in the soc.dtsi.

Same comment as for ethmac, is it really wise ? Isn't the clock setup the same for the axg family ?

Quoted 2 lines
author
#13 lore raw

Re: [PATCH v7 6/6] arm64: dts: meson-axg: switch uart_ao clock to CLK81

Quoted 7 lines · Jerome Brunet
Quoted 2 lines · Yixun Lan

Switch the uart_ao pclk to CLK81 since the clock driver is ready. Also move the clock info to the board.dts instead in the soc.dtsi.

Same comment as for ethmac, is it really wise ? Isn't the clock setup the same for the axg family ?

HI Jerome:
yes, should be same for AXG family

HI Kevin:
could you take the patch [5/6]? then I just need to resend for this one

Yixun

maintainer
#14 lore raw

Re: [PATCH v7 6/6] arm64: dts: meson-axg: switch uart_ao clock to CLK81

Quoted 8 lines · Yixun Lan
Quoted 7 lines · Jerome Brunet
Quoted 2 lines · Yixun Lan

Switch the uart_ao pclk to CLK81 since the clock driver is ready. Also move the clock info to the board.dts instead in the soc.dtsi.

Same comment as for ethmac, is it really wise ? Isn't the clock setup the same for the axg family ?

Quoted 6 lines

HI Jerome:
yes, should be same for AXG family

HI Kevin:
could you take the patch [5/6]? then I just need to resend for this one

Yes, I've applied PATCH 5/6.

Kevin

maintainer
#15 lore raw
In reply to Yixun Lan
Quoted 10 lines · Yixun Lan

Qiufang Dai (3):
clk: meson-axg: add clocks dt-bindings required header
clk: meson-axg: add clock controller drivers
arm64: dts: meson-axg: add clock DT info for Meson AXG SoC

Yixun Lan (3):
clk: meson: make the spinlock naming more specific
dt-bindings: clock: add compatible variant for the Meson-AXG
arm64: dts: meson-axg: switch uart_ao clock to CLK81

Quoted 16 lines
 .../bindings/clock/amlogic,gxbb-clkc.txt           |   7 +-
 arch/arm64/Kconfig.platforms                       |   1 +
 arch/arm64/boot/dts/amlogic/meson-axg-s400.dts     |   2 +
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi         |  19 +-
 drivers/clk/meson/Kconfig                          |   8 +
 drivers/clk/meson/Makefile                         |   1 +
 drivers/clk/meson/axg.c                            | 936 +++++++++++++++++++++
 drivers/clk/meson/axg.h                            | 126 +++
 drivers/clk/meson/clkc.h                           |   2 +-
 drivers/clk/meson/gxbb.c                           | 112 +--
 drivers/clk/meson/meson8b.c                        |  24 +-
 include/dt-bindings/clock/axg-clkc.h               |  71 ++
 12 files changed, 1234 insertions(+), 75 deletions(-)
 create mode 100644 drivers/clk/meson/axg.c
 create mode 100644 drivers/clk/meson/axg.h
 create mode 100644 include/dt-bindings/clock/axg-clkc.h

Kevin,

I took the first 4 patches through clk-meson. I left the last 2 for you.

I have applied the DT bindings update separately.
Let me know if you have dependency on these new bindings and need a tag.

Cheers
Jerome

author
#16 lore raw

Hi Jerome & Kevin

Quoted 28 lines · Jerome Brunet
Quoted 10 lines · Yixun Lan

Qiufang Dai (3):
clk: meson-axg: add clocks dt-bindings required header
clk: meson-axg: add clock controller drivers
arm64: dts: meson-axg: add clock DT info for Meson AXG SoC

Yixun Lan (3):
clk: meson: make the spinlock naming more specific
dt-bindings: clock: add compatible variant for the Meson-AXG
arm64: dts: meson-axg: switch uart_ao clock to CLK81

Quoted 16 lines
 .../bindings/clock/amlogic,gxbb-clkc.txt           |   7 +-
 arch/arm64/Kconfig.platforms                       |   1 +
 arch/arm64/boot/dts/amlogic/meson-axg-s400.dts     |   2 +
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi         |  19 +-
 drivers/clk/meson/Kconfig                          |   8 +
 drivers/clk/meson/Makefile                         |   1 +
 drivers/clk/meson/axg.c                            | 936 +++++++++++++++++++++
 drivers/clk/meson/axg.h                            | 126 +++
 drivers/clk/meson/clkc.h                           |   2 +-
 drivers/clk/meson/gxbb.c                           | 112 +--
 drivers/clk/meson/meson8b.c                        |  24 +-
 include/dt-bindings/clock/axg-clkc.h               |  71 ++
 12 files changed, 1234 insertions(+), 75 deletions(-)
 create mode 100644 drivers/clk/meson/axg.c
 create mode 100644 drivers/clk/meson/axg.h
 create mode 100644 include/dt-bindings/clock/axg-clkc.h
Quoted 7 lines

Kevin,

I took the first 4 patches through clk-meson. I left the last 2 for you.

I have applied the DT bindings update separately.
Let me know if you have dependency on these new bindings and need a tag.

thanks for taking care of this..

I think it's a good idea to make a tag, if peripheral driver request clock, then the DT part patch will need include/dt-bindings/clock/axg-clkc.h to build successfully.

Yixun

maintainer
#17 lore raw
In reply to Jerome Brunet
Quoted 28 lines · Jerome Brunet
Quoted 10 lines · Yixun Lan

Qiufang Dai (3):
clk: meson-axg: add clocks dt-bindings required header
clk: meson-axg: add clock controller drivers
arm64: dts: meson-axg: add clock DT info for Meson AXG SoC

Yixun Lan (3):
clk: meson: make the spinlock naming more specific
dt-bindings: clock: add compatible variant for the Meson-AXG
arm64: dts: meson-axg: switch uart_ao clock to CLK81

Quoted 16 lines
 .../bindings/clock/amlogic,gxbb-clkc.txt           |   7 +-
 arch/arm64/Kconfig.platforms                       |   1 +
 arch/arm64/boot/dts/amlogic/meson-axg-s400.dts     |   2 +
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi         |  19 +-
 drivers/clk/meson/Kconfig                          |   8 +
 drivers/clk/meson/Makefile                         |   1 +
 drivers/clk/meson/axg.c                            | 936 +++++++++++++++++++++
 drivers/clk/meson/axg.h                            | 126 +++
 drivers/clk/meson/clkc.h                           |   2 +-
 drivers/clk/meson/gxbb.c                           | 112 +--
 drivers/clk/meson/meson8b.c                        |  24 +-
 include/dt-bindings/clock/axg-clkc.h               |  71 ++
 12 files changed, 1234 insertions(+), 75 deletions(-)
 create mode 100644 drivers/clk/meson/axg.c
 create mode 100644 drivers/clk/meson/axg.h
 create mode 100644 include/dt-bindings/clock/axg-clkc.h
Quoted 6 lines

Kevin,

I took the first 4 patches through clk-meson. I left the last 2 for you.

I have applied the DT bindings update separately.
Let me know if you have dependency on these new bindings and need a tag.

Yes, I will need a tag on the headers since both the "switch uart_ao" patch and a subsequent patch to add DT for SPICC are using new clock IDs.

Thanks,

Kevin