Skip to contentSkip to conversation

clk: keystone: Add sci-clk driver support

PATCH New Tero Kristo 2 participants 2 messages Jun 13, 2017 – Jun 14, 2017

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

PATCH v5 2/2 clk: keystone: Add sci-clk driver support

In K2G, the clock handling is done through firmware executing on a separate core. Linux kernel needs to communicate to the firmware through TI system control interface to access any power management related resources, including clocks.

The keystone sci-clk driver does this, by communicating to the firmware through the TI SCI driver. The driver adds support for registering clocks through DT, and basic required clock operations like prepare/get_rate, etc.

---
Just sending out patch #2 of the series, patch #1 is the same from v4.

Changes in v5:
- moved the sci_clk_data->clocks array under the provider
- enforced const type on sci_clk_data

 MAINTAINERS                    |   1 +
 drivers/clk/Kconfig            |   8 +-
 drivers/clk/Makefile           |   2 +-
 drivers/clk/keystone/Kconfig   |  15 +
 drivers/clk/keystone/Makefile  |   3 +-
 drivers/clk/keystone/sci-clk.c | 724 +++++++++++++++++++++++++++++++++++++++++
 6 files changed, 744 insertions(+), 9 deletions(-)
 create mode 100644 drivers/clk/keystone/Kconfig
 create mode 100644 drivers/clk/keystone/sci-clk.c
MAINTAINERS +1 -0
index 880a23d..1ba72e6 100644
@@ -12631,6 +12631,7 @@ F:	Documentation/devicetree/bindings/soc/ti/sci-pm-domain.txt
 F:	include/dt-bindings/genpd/k2g.h
 F:	drivers/soc/ti/ti_sci_pm_domains.c
 F:	Documentation/devicetree/bindings/clock/ti,sci-clk.txt
+F:	drivers/clk/keystone/sci-clk.c
 
 THANKO'S RAREMONO AM/FM/SW RADIO RECEIVER USB DRIVER
 M:	Hans Verkuil <[email protected]>
drivers/clk/Kconfig +1 -7
index 36cfea3..10fef77 100644
@@ -164,13 +164,6 @@ config COMMON_CLK_XGENE
 	---help---
 	  Sypport for the APM X-Gene SoC reference, PLL, and device clocks.
 
-config COMMON_CLK_KEYSTONE
-	tristate "Clock drivers for Keystone based SOCs"
-	depends on (ARCH_KEYSTONE || COMPILE_TEST) && OF
-	---help---
-          Supports clock drivers for Keystone based SOCs. These SOCs have local
-	  a power sleep control module that gate the clock to the IPs and PLLs.
-
 config COMMON_CLK_NXP
 	def_bool COMMON_CLK && (ARCH_LPC18XX || ARCH_LPC32XX)
 	select REGMAP_MMIO if ARCH_LPC32XX
@@ -219,6 +212,7 @@ config COMMON_CLK_VC5
 
 source "drivers/clk/bcm/Kconfig"
 source "drivers/clk/hisilicon/Kconfig"
+source "drivers/clk/keystone/Kconfig"
 source "drivers/clk/mediatek/Kconfig"
 source "drivers/clk/meson/Kconfig"
 source "drivers/clk/mvebu/Kconfig"
drivers/clk/Makefile +1 -1
index c19983a..40694e6 100644
@@ -61,7 +61,7 @@ obj-$(CONFIG_H8300)			+= h8300/
 obj-$(CONFIG_ARCH_HISI)			+= hisilicon/
 obj-$(CONFIG_ARCH_MXC)			+= imx/
 obj-$(CONFIG_MACH_INGENIC)		+= ingenic/
-obj-$(CONFIG_COMMON_CLK_KEYSTONE)	+= keystone/
+obj-$(CONFIG_ARCH_KEYSTONE)		+= keystone/
 obj-$(CONFIG_MACH_LOONGSON32)		+= loongson1/
 obj-$(CONFIG_ARCH_MEDIATEK)		+= mediatek/
 obj-$(CONFIG_COMMON_CLK_AMLOGIC)	+= meson/
drivers/clk/keystone/Kconfig new file +15 -0
new file mode 100644
index 0000000..1fea328
@@ -0,0 +1,15 @@
+config COMMON_CLK_KEYSTONE
+	tristate "Clock drivers for Keystone based SOCs"
+	depends on (ARCH_KEYSTONE || COMPILE_TEST) && OF
+	---help---
+	  Supports clock drivers for Keystone based SOCs. These SOCs have local
+	  a power sleep control module that gate the clock to the IPs and PLLs.
+
+config TI_SCI_CLK
+	tristate "TI System Control Interface clock drivers"
+	depends on (ARCH_KEYSTONE || COMPILE_TEST) && OF
+	default TI_SCI_PROTOCOL
+	---help---
+	  This adds the clock driver support over TI System Control Interface.
+	  If you wish to use clock resources from the PMMC firmware, say Y.
+	  Otherwise, say N.
drivers/clk/keystone/Makefile +2 -1
index 0477cf6..c125939 100644
@@ -1 +1,2 @@
-obj-y			+= pll.o gate.o
+obj-$(CONFIG_COMMON_CLK_KEYSTONE)	+= pll.o gate.o
+obj-$(CONFIG_TI_SCI_CLK)		+= sci-clk.o
drivers/clk/keystone/sci-clk.c new file +724 -0

724 lines not on this page · raw message

Signature · 1 line
1.9.1
Applied
#1 lore raw

PATCH v5 2/2 clk: keystone: Add sci-clk driver support

Quoted 5 lines · Tero Kristo

In K2G, the clock handling is done through firmware executing on a separate core. Linux kernel needs to communicate to the firmware through TI system control interface to access any power management related resources, including clocks.

Quoted 7 lines

The keystone sci-clk driver does this, by communicating to the firmware through the TI SCI driver. The driver adds support for registering clocks through DT, and basic required clock operations like prepare/get_rate, etc.

---

Applied to clk-next + made ti_sci_init_clocks() static

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