Skip to contentSkip to conversation

clk: Add Meson GXBB Always-On Reset + Clocks

PATCH Applied Neil Armstrong 4 participants 10 messages Aug 18, 2016 – Sep 2, 2016

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

v2 cover clk: Add Meson GXBB Always-On Reset + Clocks

The Amlogic Meson GXBB SoC has an Always-On part that contains pairs on clocks and reset controls in a single memory mapped control register. Add a separate clocks and reset node with the corresponding driver exporting clock nodes and a reset controller.

Changes since v1 at http://lkml.kernel.org/r/1470734008-18849-1-git-send-email-narmstrong at baylibre.com :
- Make non-modular
- Remove clk.h and include init.h instead of module.h
- Use devm_ioremap_resource instead of of_iomap
- Rename driver spinlock

Neil Armstrong (3):
clk: meson: Add GXBB AO Clock and Reset controller driver
dt-bindings: clock: reset: Add GXBB AO Clock and Reset Bindings
ARM64: dts: meson-gxbb: Add GXBB AO Clock and Reset node

 .../bindings/clock/amlogic,gxbb-aoclkc.txt         |  45 +++++
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi        |   9 +
 drivers/clk/meson/Makefile                         |   2 +-
 drivers/clk/meson/gxbb-aoclk.c                     | 192 +++++++++++++++++++++
 include/dt-bindings/clock/gxbb-aoclkc.h            |  66 +++++++
 include/dt-bindings/reset/gxbb-aoclkc.h            |  66 +++++++
 6 files changed, 379 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/clock/amlogic,gxbb-aoclkc.txt
 create mode 100644 drivers/clk/meson/gxbb-aoclk.c
 create mode 100644 include/dt-bindings/clock/gxbb-aoclkc.h
 create mode 100644 include/dt-bindings/reset/gxbb-aoclkc.h
Signature · 1 line
2.7.0
#1 lore raw

PATCH v2 1/3 clk: meson: Add GXBB AO Clock and Reset controller driver

Adds a Clock and Reset controller driver for the Always-On part of the Amlogic Meson GXBB SoC.

It exports paired Clocks and Resets lines that will be used by peripherals in the Always-On subsystem.

---
 drivers/clk/meson/Makefile     |   2 +-
 drivers/clk/meson/gxbb-aoclk.c | 192 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 193 insertions(+), 1 deletion(-)
 create mode 100644 drivers/clk/meson/gxbb-aoclk.c
drivers/clk/meson/Makefile +1 -1
index 197e401..d4cd4a3 100644
@@ -4,4 +4,4 @@
 
 obj-$(CONFIG_COMMON_CLK_AMLOGIC) += clk-pll.o clk-cpu.o clk-mpll.o
 obj-$(CONFIG_COMMON_CLK_MESON8B) += meson8b-clkc.o
-obj-$(CONFIG_COMMON_CLK_GXBB)	 += gxbb.o
+obj-$(CONFIG_COMMON_CLK_GXBB)	 += gxbb.o gxbb-aoclk.o
drivers/clk/meson/gxbb-aoclk.c new file +192 -0

192 lines not on this page · raw message

Signature · 1 line
2.7.0
#3 lore raw

PATCH v2 2/3 dt-bindings: clock: reset: Add GXBB AO Clock and Reset Bindings

In reply to Neil Armstrong

Add documentations and dt-bindings headers for the AO clock and reset controller.

---
 .../bindings/clock/amlogic,gxbb-aoclkc.txt         | 45 +++++++++++++++
 include/dt-bindings/clock/gxbb-aoclkc.h            | 66 ++++++++++++++++++++++
 include/dt-bindings/reset/gxbb-aoclkc.h            | 66 ++++++++++++++++++++++
 3 files changed, 177 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/amlogic,gxbb-aoclkc.txt
 create mode 100644 include/dt-bindings/clock/gxbb-aoclkc.h
 create mode 100644 include/dt-bindings/reset/gxbb-aoclkc.h
Documentation/devicetree/bindings/clock/amlogic,gxbb-aoclkc.txt new file +45 -0
new file mode 100644
index 0000000..a55d31b
@@ -0,0 +1,45 @@
+* Amlogic GXBB AO Clock and Reset Unit
+
+The Amlogic GXBB AO clock controller generates and supplies clock to various
+controllers within the Always-On part of the SoC.
+
+Required Properties:
+
+- compatible: should be "amlogic,gxbb-aoclkc"
+- reg: physical base address of the clock controller and length of memory
+       mapped region.
+
+- #clock-cells: should be 1.
+
+Each clock is assigned an identifier and client nodes can use this identifier
+to specify the clock which they consume. All available clocks are defined as
+preprocessor macros in the dt-bindings/clock/gxbb-aoclkc.h header and can be
+used in device tree sources.
+
+- #reset-cells: should be 1.
+
+Each reset is assigned an identifier and client nodes can use this identifier
+to specify the reset which they consume. All available resets are defined as
+preprocessor macros in the dt-bindings/reset/gxbb-aoclkc.h header and can be
+used in device tree sources.
+
+Example: AO Clock controller node:
+
+	clkc_AO: clock-controller at 040 {
+		compatible = "amlogic,gxbb-aoclkc";
+		reg = <0x0 0x040 0x0 0x4>;
+		#clock-cells = <1>;
+		#reset-cells = <1>;
+	};
+
+Example: UART controller node that consumes the clock and reset generated
+  by the clock controller:
+
+	uart_AO: serial at 4c0 {
+		compatible = "amlogic,meson-uart";
+		reg = <0x4c0 0x14>;
+		interrupts = <0 90 1>;
+		clocks = <&clkc_AO CLKID_AO_UART1>;
+		resets = <&clkc_AO RESET_AO_UART1>;
+		status = "disabled";
+	};
include/dt-bindings/clock/gxbb-aoclkc.h new file +66 -0

66 lines not on this page · raw message

include/dt-bindings/reset/gxbb-aoclkc.h new file +66 -0

66 lines not on this page · raw message

Signature · 1 line
2.7.0
#5 lore raw

PATCH v2 3/3 ARM64: dts: meson-gxbb: Add GXBB AO Clock and Reset node

In reply to Neil Armstrong

Add the AO clock controller node for the AmLogic GXBB SoC.

---
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +9 -0
index e502c24..c81e1ab 100644
@@ -45,6 +45,8 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/gpio/meson-gxbb-gpio.h>
 #include <dt-bindings/reset/amlogic,meson-gxbb-reset.h>
+#include <dt-bindings/clock/gxbb-aoclkc.h>
+#include <dt-bindings/reset/gxbb-aoclkc.h>
 
 / {
 	compatible = "amlogic,meson-gxbb";
@@ -205,6 +207,13 @@
 				};
 			};
 
+			clkc_AO: clock-controller at 040 {
+				compatible = "amlogic,gxbb-aoclkc";
+				reg = <0x0 0x00040 0x0 0x4>;
+				#clock-cells = <1>;
+				#reset-cells = <1>;
+			};
+
 			uart_AO: serial at 4c0 {
 				compatible = "amlogic,meson-uart";
 				reg = <0x0 0x004c0 0x0 0x14>;
Signature · 1 line
2.7.0
Applied
#2 lore raw

Re: [PATCH v2 1/3] clk: meson: Add GXBB AO Clock and Reset controller driver

In reply to Neil Armstrong
Quoted 8 lines · Neil Armstrong

Adds a Clock and Reset controller driver for the Always-On part of the Amlogic Meson GXBB SoC.

It exports paired Clocks and Resets lines that will be used by peripherals in the Always-On subsystem.

---

Applied to clk-meson-gxbb-ao and merged into clk-next. I applied this after the dt binding headers to keep things compiling.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
Applied
#4 lore raw

Re: [PATCH v2 2/3] dt-bindings: clock: reset: Add GXBB AO Clock and Reset Bindings

In reply to Neil Armstrong
Quoted 6 lines · Neil Armstrong

Add documentations and dt-bindings headers for the AO clock and reset controller.

---

Applied to clk-meson-gxbb-ao and merged into clk-next.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
maintainer
#6 lore raw

Re: [PATCH v2 3/3] ARM64: dts: meson-gxbb: Add GXBB AO Clock and Reset node

In reply to Neil Armstrong
Quoted 4 lines · Neil Armstrong

Add the AO clock controller node for the AmLogic GXBB SoC.

---

Applying this to the amlogic tree, but will need to wait a cycle due to include dependencies on the bindings, which are going through the clock tree.

Kevin

#7 lore raw

Re: [PATCH v2 3/3] ARM64: dts: meson-gxbb: Add GXBB AO Clock and Reset node

Quoting Kevin Hilman (2016-08-19 15:03:06)

Quoted 10 lines
Quoted 4 lines · Neil Armstrong

Add the AO clock controller node for the AmLogic GXBB SoC.

---

Applying this to the amlogic tree, but will need to wait a cycle due to include dependencies on the bindings, which are going through the clock tree.

FYI, for picked patches, Stephen and I create a stable branch for each platform. You can pull this into your tree if you want, just let us know so we'll be sure not to rebase:

git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-meson-gxbb-ao

Regards,
Mike

Quoted 2 lines

Kevin

maintainer
#8 lore raw

Re: [PATCH v2 3/3] ARM64: dts: meson-gxbb: Add GXBB AO Clock and Reset node

Quoted 12 lines · Michael Turquette

Quoting Kevin Hilman (2016-08-19 15:03:06)

Quoted 10 lines
Quoted 4 lines · Neil Armstrong

Add the AO clock controller node for the AmLogic GXBB SoC.

---

Applying this to the amlogic tree, but will need to wait a cycle due to include dependencies on the bindings, which are going through the clock tree.

Quoted 6 lines

FYI, for picked patches, Stephen and I create a stable branch for each platform. You can pull this into your tree if you want, just let us know so we'll be sure not to rebase:

git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-meson-gxbb-ao

OK, I'll be using clk-meson-gxb and clk-meson-gxbb-ao.

Thanks,

Kevin

#9 lore raw

PATCH v2 3/3 ARM64: dts: meson-gxbb: Add GXBB AO Clock and Reset node

Quoting Kevin Hilman (2016-08-29 10:37:37)

Quoted 22 lines

Michael Turquette <[email protected]> writes:
=

Quoted 19 lines

Quoting Kevin Hilman (2016-08-19 15:03:06)

Quoted 5 lines

Neil Armstrong <[email protected]> writes:
=

Quoted 2 lines

Add the AO clock controller node for the AmLogic GXBB SoC.

Quoted 7 lines
Quoted 2 lines

---

=

Applying this to the amlogic tree, but will need to wait a cycle due to include dependencies on the bindings, which are going through the clock tree.

FYI, for picked patches, Stephen and I create a stable branch for each platform. You can pull this into your tree if you want, just let us know so we'll be sure not to rebase:

git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-meson-g=

xbb-ao

Quoted 4 lines
Quoted 1 line

=

OK, I'll be using clk-meson-gxb and clk-meson-gxbb-ao.

Heads up, I merged clk-meson-gxbb-ao into clk-meson-gxbb yesterday to make it easier to merge the emmc clock gate patches. If you haven't pulled clk-meson-gxbb-ao already then you can just re-pull clk-meson-gxbb and you'll get it.

Regards,
Mike

Quoted 6 lines

=

Thanks,
=

Kevin