* [PATCH v2 0/7] clk: meson-axg: Add AO Cloclk and Reset driver
@ 2018-03-23 14:38 Yixun Lan
2018-03-23 14:38 ` [PATCH v2 3/7] dt-bindings: clock: axg-aoclkc: New binding for Meson-AXG SoC Yixun Lan
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Yixun Lan @ 2018-03-23 14:38 UTC (permalink / raw)
To: Neil Armstrong, Jerome Brunet, Kevin Hilman, Carlo Caione
Cc: Yixun Lan, Rob Herring, Michael Turquette, Stephen Boyd,
Philipp Zabel, Qiufang Dai, linux-amlogic, linux-clk,
linux-arm-kernel, linux-kernel, devicetree
This patch try to add AO clock and Reset driver for Amlogic's
Meson-AXG SoC.
patch 1: it's a generic independent fix for the previous clock driver
patch 2: factor the common code into a dedicated files
patch 3-5: add the driver for AXG SoC
patch 6-7: add the DTS part
changes since v1 at [0]:
- rebase to clk-meson's branch 'next/drivers' [1]
- fix license, update to BSD-3-Clause
- drop un-used include header file
-
[0] https://lkml.kernel.org/r/<20180209070026.193879-1-yixun.lan@amlogic.com>
Qiufang Dai (2):
clk: meson-axg: Add AO Clock and Reset controller driver
arm64: dts: meson-axg: add AO clock driver DT info
Yixun Lan (5):
clk: meson: drop meson_aoclk_gate_regmap_ops
clk: meson: aoclk: refactor common code into dedicated file
dt-bindings: clock: axg-aoclkc: New binding for Meson-AXG SoC
dt-bindings: clock: reset: Add AXG AO Clock and Reset Bindings
ARM64: dts: meson-axg: add an 32K alt aoclk
.../bindings/clock/amlogic,gxbb-aoclkc.txt | 1 +
arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 19 +++
drivers/clk/meson/Makefile | 4 +-
drivers/clk/meson/axg-aoclk.c | 162 +++++++++++++++++++++
drivers/clk/meson/axg-aoclk.h | 31 ++++
drivers/clk/meson/gxbb-aoclk.c | 81 ++++-------
drivers/clk/meson/gxbb-aoclk.h | 9 +-
drivers/clk/meson/meson-aoclk.c | 76 ++++++++++
drivers/clk/meson/meson-aoclk.h | 30 ++++
include/dt-bindings/clock/axg-aoclkc.h | 26 ++++
include/dt-bindings/reset/axg-aoclkc.h | 20 +++
11 files changed, 399 insertions(+), 60 deletions(-)
create mode 100644 drivers/clk/meson/axg-aoclk.c
create mode 100644 drivers/clk/meson/axg-aoclk.h
create mode 100644 drivers/clk/meson/meson-aoclk.c
create mode 100644 drivers/clk/meson/meson-aoclk.h
create mode 100644 include/dt-bindings/clock/axg-aoclkc.h
create mode 100644 include/dt-bindings/reset/axg-aoclkc.h
--
2.15.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 3/7] dt-bindings: clock: axg-aoclkc: New binding for Meson-AXG SoC
2018-03-23 14:38 [PATCH v2 0/7] clk: meson-axg: Add AO Cloclk and Reset driver Yixun Lan
@ 2018-03-23 14:38 ` Yixun Lan
2018-03-26 22:25 ` Rob Herring
2018-03-23 14:38 ` [PATCH v2 4/7] dt-bindings: clock: reset: Add AXG AO Clock and Reset Bindings Yixun Lan
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Yixun Lan @ 2018-03-23 14:38 UTC (permalink / raw)
To: Neil Armstrong, Jerome Brunet, Kevin Hilman, Carlo Caione
Cc: Yixun Lan, Rob Herring, Michael Turquette, Stephen Boyd,
Philipp Zabel, Qiufang Dai, linux-amlogic, linux-clk,
linux-arm-kernel, linux-kernel, devicetree
Update the dt-binding documentation to support new compatible string
for the Amlogic's Meson-AXG SoC.
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
---
Documentation/devicetree/bindings/clock/amlogic,gxbb-aoclkc.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/clock/amlogic,gxbb-aoclkc.txt b/Documentation/devicetree/bindings/clock/amlogic,gxbb-aoclkc.txt
index 786dc39ca904..3a880528030e 100644
--- a/Documentation/devicetree/bindings/clock/amlogic,gxbb-aoclkc.txt
+++ b/Documentation/devicetree/bindings/clock/amlogic,gxbb-aoclkc.txt
@@ -9,6 +9,7 @@ Required Properties:
- GXBB (S905) : "amlogic,meson-gxbb-aoclkc"
- GXL (S905X, S905D) : "amlogic,meson-gxl-aoclkc"
- GXM (S912) : "amlogic,meson-gxm-aoclkc"
+ - AXG (A113D, A113X) : "amlogic,meson-axg-aoclkc"
followed by the common "amlogic,meson-gx-aoclkc"
- #clock-cells: should be 1.
--
2.15.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 4/7] dt-bindings: clock: reset: Add AXG AO Clock and Reset Bindings
2018-03-23 14:38 [PATCH v2 0/7] clk: meson-axg: Add AO Cloclk and Reset driver Yixun Lan
2018-03-23 14:38 ` [PATCH v2 3/7] dt-bindings: clock: axg-aoclkc: New binding for Meson-AXG SoC Yixun Lan
@ 2018-03-23 14:38 ` Yixun Lan
2018-03-26 22:25 ` Rob Herring
2018-03-23 14:38 ` [PATCH v2 6/7] arm64: dts: meson-axg: add AO clock driver DT info Yixun Lan
2018-03-23 14:38 ` [PATCH v2 7/7] ARM64: dts: meson-axg: add an 32K alt aoclk Yixun Lan
3 siblings, 1 reply; 8+ messages in thread
From: Yixun Lan @ 2018-03-23 14:38 UTC (permalink / raw)
To: Neil Armstrong, Jerome Brunet, Kevin Hilman, Carlo Caione
Cc: Yixun Lan, Rob Herring, Michael Turquette, Stephen Boyd,
Philipp Zabel, Qiufang Dai, linux-amlogic, linux-clk,
linux-arm-kernel, linux-kernel, devicetree
Add dt-bindings headers for the Meson-AXG's AO clock and
reset controller.
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
---
include/dt-bindings/clock/axg-aoclkc.h | 26 ++++++++++++++++++++++++++
include/dt-bindings/reset/axg-aoclkc.h | 20 ++++++++++++++++++++
2 files changed, 46 insertions(+)
create mode 100644 include/dt-bindings/clock/axg-aoclkc.h
create mode 100644 include/dt-bindings/reset/axg-aoclkc.h
diff --git a/include/dt-bindings/clock/axg-aoclkc.h b/include/dt-bindings/clock/axg-aoclkc.h
new file mode 100644
index 000000000000..61955016a55b
--- /dev/null
+++ b/include/dt-bindings/clock/axg-aoclkc.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
+/*
+ * Copyright (c) 2016 BayLibre, SAS
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ *
+ * Copyright (c) 2018 Amlogic, inc.
+ * Author: Qiufang Dai <qiufang.dai@amlogic.com>
+ */
+
+#ifndef DT_BINDINGS_CLOCK_AMLOGIC_MESON_AXG_AOCLK
+#define DT_BINDINGS_CLOCK_AMLOGIC_MESON_AXG_AOCLK
+
+#define CLKID_AO_REMOTE 0
+#define CLKID_AO_I2C_MASTER 1
+#define CLKID_AO_I2C_SLAVE 2
+#define CLKID_AO_UART1 3
+#define CLKID_AO_UART2 4
+#define CLKID_AO_IR_BLASTER 5
+#define CLKID_AO_SAR_ADC 6
+#define CLKID_AO_CLK81 7
+#define CLKID_AO_SAR_ADC_SEL 8
+#define CLKID_AO_SAR_ADC_DIV 9
+#define CLKID_AO_SAR_ADC_CLK 10
+#define CLKID_AO_ALT_XTAL 11
+
+#endif
diff --git a/include/dt-bindings/reset/axg-aoclkc.h b/include/dt-bindings/reset/axg-aoclkc.h
new file mode 100644
index 000000000000..d342c0b6b2a7
--- /dev/null
+++ b/include/dt-bindings/reset/axg-aoclkc.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
+/*
+ * Copyright (c) 2016 BayLibre, SAS
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ *
+ * Copyright (c) 2018 Amlogic, inc.
+ * Author: Qiufang Dai <qiufang.dai@amlogic.com>
+ */
+
+#ifndef DT_BINDINGS_RESET_AMLOGIC_MESON_AXG_AOCLK
+#define DT_BINDINGS_RESET_AMLOGIC_MESON_AXG_AOCLK
+
+#define RESET_AO_REMOTE 0
+#define RESET_AO_I2C_MASTER 1
+#define RESET_AO_I2C_SLAVE 2
+#define RESET_AO_UART1 3
+#define RESET_AO_UART2 4
+#define RESET_AO_IR_BLASTER 5
+
+#endif
--
2.15.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 6/7] arm64: dts: meson-axg: add AO clock driver DT info
2018-03-23 14:38 [PATCH v2 0/7] clk: meson-axg: Add AO Cloclk and Reset driver Yixun Lan
2018-03-23 14:38 ` [PATCH v2 3/7] dt-bindings: clock: axg-aoclkc: New binding for Meson-AXG SoC Yixun Lan
2018-03-23 14:38 ` [PATCH v2 4/7] dt-bindings: clock: reset: Add AXG AO Clock and Reset Bindings Yixun Lan
@ 2018-03-23 14:38 ` Yixun Lan
2018-03-23 14:38 ` [PATCH v2 7/7] ARM64: dts: meson-axg: add an 32K alt aoclk Yixun Lan
3 siblings, 0 replies; 8+ messages in thread
From: Yixun Lan @ 2018-03-23 14:38 UTC (permalink / raw)
To: Neil Armstrong, Jerome Brunet, Kevin Hilman, Carlo Caione
Cc: Qiufang Dai, Yixun Lan, Rob Herring, Michael Turquette,
Stephen Boyd, Philipp Zabel, linux-amlogic, linux-clk,
linux-arm-kernel, linux-kernel, devicetree
From: Qiufang Dai <qiufang.dai@amlogic.com>
This add the AO (Always-On part) clock DT info for Meson-AXG SoC
Signed-off-by: Qiufang Dai <qiufang.dai@amlogic.com>
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
---
arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
index a80632641b39..b3d394f5d95a 100644
--- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
@@ -8,6 +8,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/axg-clkc.h>
+#include <dt-bindings/clock/axg-aoclkc.h>
/ {
compatible = "amlogic,meson-axg";
@@ -472,6 +473,17 @@
#size-cells = <2>;
ranges = <0x0 0x0 0x0 0xff800000 0x0 0x100000>;
+ sysctrl_AO: sys-ctrl@0 {
+ compatible = "amlogic,meson-axg-ao-sysctrl", "syscon", "simple-mfd";
+ reg = <0x0 0x0 0x0 0x100>;
+
+ clkc_AO: clock-controller {
+ compatible = "amlogic,meson-axg-aoclkc";
+ #clock-cells = <1>;
+ #reset-cells = <1>;
+ };
+ };
+
pinctrl_aobus: pinctrl@14 {
compatible = "amlogic,meson-axg-aobus-pinctrl";
#address-cells = <2>;
--
2.15.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 7/7] ARM64: dts: meson-axg: add an 32K alt aoclk
2018-03-23 14:38 [PATCH v2 0/7] clk: meson-axg: Add AO Cloclk and Reset driver Yixun Lan
` (2 preceding siblings ...)
2018-03-23 14:38 ` [PATCH v2 6/7] arm64: dts: meson-axg: add AO clock driver DT info Yixun Lan
@ 2018-03-23 14:38 ` Yixun Lan
2018-03-27 9:00 ` Jerome Brunet
3 siblings, 1 reply; 8+ messages in thread
From: Yixun Lan @ 2018-03-23 14:38 UTC (permalink / raw)
To: Neil Armstrong, Jerome Brunet, Kevin Hilman, Carlo Caione
Cc: Yixun Lan, Rob Herring, Michael Turquette, Stephen Boyd,
Philipp Zabel, Qiufang Dai, linux-amlogic, linux-clk,
linux-arm-kernel, linux-kernel, devicetree
The ao_clk81 in AO domain have two clock source,
one from a 32K alt crystal we name it as ao_alt_clk,
another is the clk81 signal from EE domain.
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
---
arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
index b3d394f5d95a..48584d5a329b 100644
--- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
@@ -109,6 +109,13 @@
#clock-cells = <0>;
};
+ ao_alt_xtal: ao_alt_xtal-clk {
+ compatible = "fixed-clock";
+ clock-frequency = <32000000>;
+ clock-output-names = "ao_alt_xtal";
+ #clock-cells = <0>;
+ };
+
soc {
compatible = "simple-bus";
#address-cells = <2>;
--
2.15.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 3/7] dt-bindings: clock: axg-aoclkc: New binding for Meson-AXG SoC
2018-03-23 14:38 ` [PATCH v2 3/7] dt-bindings: clock: axg-aoclkc: New binding for Meson-AXG SoC Yixun Lan
@ 2018-03-26 22:25 ` Rob Herring
0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2018-03-26 22:25 UTC (permalink / raw)
To: Yixun Lan
Cc: Neil Armstrong, Jerome Brunet, Kevin Hilman, Carlo Caione,
Michael Turquette, Stephen Boyd, Philipp Zabel, Qiufang Dai,
linux-amlogic, linux-clk, linux-arm-kernel, linux-kernel,
devicetree
On Fri, Mar 23, 2018 at 10:38:12PM +0800, Yixun Lan wrote:
> Update the dt-binding documentation to support new compatible string
> for the Amlogic's Meson-AXG SoC.
>
> Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
> ---
> Documentation/devicetree/bindings/clock/amlogic,gxbb-aoclkc.txt | 1 +
> 1 file changed, 1 insertion(+)
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 4/7] dt-bindings: clock: reset: Add AXG AO Clock and Reset Bindings
2018-03-23 14:38 ` [PATCH v2 4/7] dt-bindings: clock: reset: Add AXG AO Clock and Reset Bindings Yixun Lan
@ 2018-03-26 22:25 ` Rob Herring
0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2018-03-26 22:25 UTC (permalink / raw)
To: Yixun Lan
Cc: Neil Armstrong, Jerome Brunet, Kevin Hilman, Carlo Caione,
Michael Turquette, Stephen Boyd, Philipp Zabel, Qiufang Dai,
linux-amlogic, linux-clk, linux-arm-kernel, linux-kernel,
devicetree
On Fri, Mar 23, 2018 at 10:38:13PM +0800, Yixun Lan wrote:
> Add dt-bindings headers for the Meson-AXG's AO clock and
> reset controller.
>
> Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
> ---
> include/dt-bindings/clock/axg-aoclkc.h | 26 ++++++++++++++++++++++++++
> include/dt-bindings/reset/axg-aoclkc.h | 20 ++++++++++++++++++++
> 2 files changed, 46 insertions(+)
> create mode 100644 include/dt-bindings/clock/axg-aoclkc.h
> create mode 100644 include/dt-bindings/reset/axg-aoclkc.h
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 7/7] ARM64: dts: meson-axg: add an 32K alt aoclk
2018-03-23 14:38 ` [PATCH v2 7/7] ARM64: dts: meson-axg: add an 32K alt aoclk Yixun Lan
@ 2018-03-27 9:00 ` Jerome Brunet
0 siblings, 0 replies; 8+ messages in thread
From: Jerome Brunet @ 2018-03-27 9:00 UTC (permalink / raw)
To: Yixun Lan, Neil Armstrong, Kevin Hilman, Carlo Caione
Cc: Rob Herring, Michael Turquette, Stephen Boyd, Philipp Zabel,
Qiufang Dai, linux-amlogic, linux-clk, linux-arm-kernel,
linux-kernel, devicetree
On Fri, 2018-03-23 at 22:38 +0800, Yixun Lan wrote:
> The ao_clk81 in AO domain have two clock source,
> one from a 32K alt crystal we name it as ao_alt_clk,
> another is the clk81 signal from EE domain.
>
> Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
> ---
> arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> index b3d394f5d95a..48584d5a329b 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> @@ -109,6 +109,13 @@
> #clock-cells = <0>;
> };
>
> + ao_alt_xtal: ao_alt_xtal-clk {
> + compatible = "fixed-clock";
> + clock-frequency = <32000000>;
> + clock-output-names = "ao_alt_xtal";
> + #clock-cells = <0>;
> + };
In DT, we seem to be using 'ao' and 'AO' to designate the Always On domain.
Maybe we should be try be consistent about this.
Anyway, this patch looks good but does not need to be part of the clkc_ao
series, it could go in independently.
Acked-by: Jerome Brunet <jbrunet@baylibre.com>
> +
> soc {
> compatible = "simple-bus";
> #address-cells = <2>;
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-03-27 9:00 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-23 14:38 [PATCH v2 0/7] clk: meson-axg: Add AO Cloclk and Reset driver Yixun Lan
2018-03-23 14:38 ` [PATCH v2 3/7] dt-bindings: clock: axg-aoclkc: New binding for Meson-AXG SoC Yixun Lan
2018-03-26 22:25 ` Rob Herring
2018-03-23 14:38 ` [PATCH v2 4/7] dt-bindings: clock: reset: Add AXG AO Clock and Reset Bindings Yixun Lan
2018-03-26 22:25 ` Rob Herring
2018-03-23 14:38 ` [PATCH v2 6/7] arm64: dts: meson-axg: add AO clock driver DT info Yixun Lan
2018-03-23 14:38 ` [PATCH v2 7/7] ARM64: dts: meson-axg: add an 32K alt aoclk Yixun Lan
2018-03-27 9:00 ` Jerome Brunet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).