Skip to contentSkip to conversation

clk: meson: Add G12A AO Clock + Reset Controller

PATCH In review Neil Armstrong 3 participants 6 messages Feb 12, 2019 – Feb 18, 2019

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

v2 cover clk: meson: Add G12A AO Clock + Reset Controller

This patchset add support for the Amlogic G12A SoC family Always-On clock and reset controller.

This adds support for clocks on the Always-On domain like :
- Always-On UARTS & I2C Controllers
- CEC Controllers
- SARADC source and bus clock
- Infrared Decoder/Encoder bus clock
- USB 32K reference clock

This also adds resets lines for :
- Always-On UARTS & I2C Controllers
- SARADC, Infrared Decoder/Encoder

This patchset depends on the ("clk: meson: rework drivers dependencies") from Jerome Brunet at [1].

Changes from v1 at [2]:
- Moved unused bindings ID out of the dt-bindings header
- Added comment about CLK_IGNORE_UNUSED

[1] https://lkml.kernel.org/r/[email protected]
[2] https://lkml.kernel.org/r/[email protected]

Neil Armstrong (2):
dt-bindings: clk: add G12A AO Clock and Reset Bindings
clk: meson: Add G12A AO Clock + Reset Controller

 .../bindings/clock/amlogic,gxbb-aoclkc.txt    |   1 +
 drivers/clk/meson/Kconfig                     |   2 +
 drivers/clk/meson/Makefile                    |   2 +-
 drivers/clk/meson/g12a-aoclk.c                | 454 ++++++++++++++++++
 drivers/clk/meson/g12a-aoclk.h                |  34 ++
 include/dt-bindings/clock/g12a-aoclkc.h       |  34 ++
 include/dt-bindings/reset/g12a-aoclkc.h       |  18 +
 7 files changed, 544 insertions(+), 1 deletion(-)
 create mode 100644 drivers/clk/meson/g12a-aoclk.c
 create mode 100644 drivers/clk/meson/g12a-aoclk.h
 create mode 100644 include/dt-bindings/clock/g12a-aoclkc.h
 create mode 100644 include/dt-bindings/reset/g12a-aoclkc.h
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/2 dt-bindings: clk: add G12A AO Clock and Reset Bindings

Add bindings for the Amlogic G12A AO Clock and Reset controllers.

---
 .../bindings/clock/amlogic,gxbb-aoclkc.txt    |  1 +
 include/dt-bindings/clock/g12a-aoclkc.h       | 34 +++++++++++++++++++
 include/dt-bindings/reset/g12a-aoclkc.h       | 18 ++++++++++
 3 files changed, 53 insertions(+)
 create mode 100644 include/dt-bindings/clock/g12a-aoclkc.h
 create mode 100644 include/dt-bindings/reset/g12a-aoclkc.h
Documentation/devicetree/bindings/clock/amlogic,gxbb-aoclkc.txt +1 -0
index 79511d7bb321..c41f0be5d438 100644
@@ -10,6 +10,7 @@ Required Properties:
 	- GXL (S905X, S905D) : "amlogic,meson-gxl-aoclkc"
 	- GXM (S912) : "amlogic,meson-gxm-aoclkc"
 	- AXG (A113D, A113X) : "amlogic,meson-axg-aoclkc"
+	- G12A (S905X2, S905D2, S905Y2) : "amlogic,meson-g12a-aoclkc"
 	followed by the common "amlogic,meson-gx-aoclkc"
 - clocks: list of clock phandle, one for each entry clock-names.
 - clock-names: should contain the following:
include/dt-bindings/clock/g12a-aoclkc.h new file +34 -0
new file mode 100644
index 000000000000..8db01ffbeb06
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
+/*
+ * Copyright (c) 2016 BayLibre, SAS
+ * Author: Neil Armstrong <[email protected]>
+ *
+ * Copyright (c) 2018 Amlogic, inc.
+ * Author: Qiufang Dai <[email protected]>
+ */
+
+#ifndef DT_BINDINGS_CLOCK_AMLOGIC_MESON_G12A_AOCLK
+#define DT_BINDINGS_CLOCK_AMLOGIC_MESON_G12A_AOCLK
+
+#define CLKID_AO_AHB		0
+#define CLKID_AO_IR_IN		1
+#define CLKID_AO_I2C_M0		2
+#define CLKID_AO_I2C_S0		3
+#define CLKID_AO_UART		4
+#define CLKID_AO_PROD_I2C	5
+#define CLKID_AO_UART2		6
+#define CLKID_AO_IR_OUT		7
+#define CLKID_AO_SAR_ADC	8
+#define CLKID_AO_MAILBOX	9
+#define CLKID_AO_M3		10
+#define CLKID_AO_AHB_SRAM	11
+#define CLKID_AO_RTI		12
+#define CLKID_AO_M4_FCLK	13
+#define CLKID_AO_M4_HCLK	14
+#define CLKID_AO_CLK81		15
+#define CLKID_AO_SAR_ADC_CLK	18
+#define CLKID_AO_32K		23
+#define CLKID_AO_CEC		27
+#define CLKID_AO_CTS_RTC_OSCIN	28
+
+#endif
include/dt-bindings/reset/g12a-aoclkc.h new file +18 -0
new file mode 100644
index 000000000000..bd2e2337135c
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
+/*
+ * Copyright (c) 2016 BayLibre, SAS
+ * Author: Neil Armstrong <[email protected]>
+ */
+
+#ifndef DT_BINDINGS_RESET_AMLOGIC_MESON_G12A_AOCLK
+#define DT_BINDINGS_RESET_AMLOGIC_MESON_G12A_AOCLK
+
+#define RESET_AO_IR_IN		0
+#define RESET_AO_UART		1
+#define RESET_AO_I2C_M		2
+#define RESET_AO_I2C_S		3
+#define RESET_AO_SAR_ADC	4
+#define RESET_AO_UART2		5
+#define RESET_AO_IR_OUT		6
+
+#endif
Signature · 1 line
2.20.1
maintainer Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: clk: add G12A AO Clock and Reset Bindings

Quoted 11 lines · Neil Armstrong

Add bindings for the Amlogic G12A AO Clock and Reset controllers.

---
 .../bindings/clock/amlogic,gxbb-aoclkc.txt    |  1 +
 include/dt-bindings/clock/g12a-aoclkc.h       | 34 +++++++++++++++++++
 include/dt-bindings/reset/g12a-aoclkc.h       | 18 ++++++++++
 3 files changed, 53 insertions(+)
 create mode 100644 include/dt-bindings/clock/g12a-aoclkc.h
 create mode 100644 include/dt-bindings/reset/g12a-aoclkc.h
#3 lore raw

PATCH v2 2/2 clk: meson: Add G12A AO Clock + Reset Controller

In reply to Neil Armstrong

Add the Amlogic G12A AO Clock and Reset controller driver handling generation of Always-On clocks :
- AO Clocks and Reset for Always-On modules
- 32K Generation for USB and CEC
- SAR ADC controller clock

---
 drivers/clk/meson/Kconfig      |   2 +
 drivers/clk/meson/Makefile     |   2 +-
 drivers/clk/meson/g12a-aoclk.c | 454 +++++++++++++++++++++++++++++++++
 drivers/clk/meson/g12a-aoclk.h |  34 +++
 4 files changed, 491 insertions(+), 1 deletion(-)
 create mode 100644 drivers/clk/meson/g12a-aoclk.c
 create mode 100644 drivers/clk/meson/g12a-aoclk.h
drivers/clk/meson/Kconfig +2 -0
index b72439315340..3858747f5438 100644
@@ -98,8 +98,10 @@ config COMMON_CLK_G12A
 	bool
 	depends on ARCH_MESON
 	select COMMON_CLK_MESON_REGMAP
+	select COMMON_CLK_MESON_DUALDIV
 	select COMMON_CLK_MESON_MPLL
 	select COMMON_CLK_MESON_PLL
+	select COMMON_CLK_MESON_AO_CLKC
 	select COMMON_CLK_MESON_EE_CLKC
 	select MFD_SYSCON
 	help
drivers/clk/meson/Makefile +1 -1
index 32d17f18541e..021fc290e749 100644
@@ -16,5 +16,5 @@ obj-$(CONFIG_COMMON_CLK_MESON_VID_PLL_DIV) += vid-pll-div.o
 obj-$(CONFIG_COMMON_CLK_AXG) += axg.o axg-aoclk.o
 obj-$(CONFIG_COMMON_CLK_AXG_AUDIO) += axg-audio.o
 obj-$(CONFIG_COMMON_CLK_GXBB) += gxbb.o gxbb-aoclk.o
-obj-$(CONFIG_COMMON_CLK_G12A) += g12a.o
+obj-$(CONFIG_COMMON_CLK_G12A) += g12a.o g12a-aoclk.o
 obj-$(CONFIG_COMMON_CLK_MESON8B) += meson8b.o
drivers/clk/meson/g12a-aoclk.c new file +454 -0

454 lines not on this page · raw message

drivers/clk/meson/g12a-aoclk.h new file +34 -0
new file mode 100644
index 000000000000..04b0d5506641
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
+/*
+ * Copyright (c) 2019 BayLibre, SAS
+ * Author: Neil Armstrong <[email protected]>
+ */
+
+#ifndef __G12A_AOCLKC_H
+#define __G12A_AOCLKC_H
+
+/*
+ * CLKID index values
+ *
+ * These indices are entirely contrived and do not map onto the hardware.
+ * It has now been decided to expose everything by default in the DT header:
+ * include/dt-bindings/clock/g12a-aoclkc.h. Only the clocks ids we don't want
+ * to expose, such as the internal muxes and dividers of composite clocks,
+ * will remain defined here.
+ */
+#define CLKID_AO_SAR_ADC_SEL	16
+#define CLKID_AO_SAR_ADC_DIV	17
+#define CLKID_AO_CTS_OSCIN	19
+#define CLKID_AO_32K_PRE	20
+#define CLKID_AO_32K_DIV	21
+#define CLKID_AO_32K_SEL	22
+#define CLKID_AO_CEC_PRE	24
+#define CLKID_AO_CEC_DIV	25
+#define CLKID_AO_CEC_SEL	26
+
+#define NR_CLKS	29
+
+#include <dt-bindings/clock/g12a-aoclkc.h>
+#include <dt-bindings/reset/g12a-aoclkc.h>
+
+#endif /* __G12A_AOCLKC_H */
Signature · 1 line
2.20.1
maintainer Acked-by on the v2 series
#4 lore raw
In reply to Neil Armstrong
Quoted 21 lines · Neil Armstrong

This patchset add support for the Amlogic G12A SoC family Always-On clock and reset controller.

This adds support for clocks on the Always-On domain like :
- Always-On UARTS & I2C Controllers
- CEC Controllers
- SARADC source and bus clock
- Infrared Decoder/Encoder bus clock
- USB 32K reference clock

This also adds resets lines for :
- Always-On UARTS & I2C Controllers
- SARADC, Infrared Decoder/Encoder

This patchset depends on the ("clk: meson: rework drivers dependencies") from Jerome Brunet at [1].

Changes from v1 at [2]:
- Moved unused bindings ID out of the dt-bindings header
- Added comment about CLK_IGNORE_UNUSED

Quoted 6 lines

[1] https://lkml.kernel.org/r/[email protected]
[2] https://lkml.kernel.org/r/[email protected]

Neil Armstrong (2):
dt-bindings: clk: add G12A AO Clock and Reset Bindings
clk: meson: Add G12A AO Clock + Reset Controller

Quoted 14 lines
 .../bindings/clock/amlogic,gxbb-aoclkc.txt    |   1 +
 drivers/clk/meson/Kconfig                     |   2 +
 drivers/clk/meson/Makefile                    |   2 +-
 drivers/clk/meson/g12a-aoclk.c                | 454 ++++++++++++++++++
 drivers/clk/meson/g12a-aoclk.h                |  34 ++
 include/dt-bindings/clock/g12a-aoclkc.h       |  34 ++
 include/dt-bindings/reset/g12a-aoclkc.h       |  18 +
 7 files changed, 544 insertions(+), 1 deletion(-)
 create mode 100644 drivers/clk/meson/g12a-aoclk.c
 create mode 100644 drivers/clk/meson/g12a-aoclk.h
 create mode 100644 include/dt-bindings/clock/g12a-aoclkc.h
 create mode 100644 include/dt-bindings/reset/g12a-aoclkc.h
author Applied
#5 lore raw
Quoted 22 lines · Jerome Brunet
Quoted 21 lines · Neil Armstrong

This patchset add support for the Amlogic G12A SoC family Always-On clock and reset controller.

This adds support for clocks on the Always-On domain like :
- Always-On UARTS & I2C Controllers
- CEC Controllers
- SARADC source and bus clock
- Infrared Decoder/Encoder bus clock
- USB 32K reference clock

This also adds resets lines for :
- Always-On UARTS & I2C Controllers
- SARADC, Infrared Decoder/Encoder

This patchset depends on the ("clk: meson: rework drivers dependencies") from Jerome Brunet at [1].

Changes from v1 at [2]:
- Moved unused bindings ID out of the dt-bindings header
- Added comment about CLK_IGNORE_UNUSED

Quoted 25 lines
Quoted 6 lines

[1] https://lkml.kernel.org/r/[email protected]
[2] https://lkml.kernel.org/r/[email protected]

Neil Armstrong (2):
dt-bindings: clk: add G12A AO Clock and Reset Bindings
clk: meson: Add G12A AO Clock + Reset Controller

Quoted 14 lines
 .../bindings/clock/amlogic,gxbb-aoclkc.txt    |   1 +
 drivers/clk/meson/Kconfig                     |   2 +
 drivers/clk/meson/Makefile                    |   2 +-
 drivers/clk/meson/g12a-aoclk.c                | 454 ++++++++++++++++++
 drivers/clk/meson/g12a-aoclk.h                |  34 ++
 include/dt-bindings/clock/g12a-aoclkc.h       |  34 ++
 include/dt-bindings/reset/g12a-aoclkc.h       |  18 +
 7 files changed, 544 insertions(+), 1 deletion(-)
 create mode 100644 drivers/clk/meson/g12a-aoclk.c
 create mode 100644 drivers/clk/meson/g12a-aoclk.h
 create mode 100644 include/dt-bindings/clock/g12a-aoclkc.h
 create mode 100644 include/dt-bindings/reset/g12a-aoclkc.h

Applied to next/drivers for Linux 5.1-rc1