clk: qcom: Add support for IPQ8064's global clock controller (GCC)
Subsystems (5)
PATCH v2 1/1 clk: qcom: Add support for IPQ8064's global clock controller (GCC)
Add a driver for the global clock controller found on IPQ8064 based platforms. This should allow most non-multimedia device drivers to probe and control their clocks.
This is currently missing clocks for SATA, USB, and networking devices.
---
v2:
* dropped audio clock from commit message
* changed Kconfig symbol to IPQ_GCC_806X
* Fixed PXO/CXO clk freq to 25Mhz
.../devicetree/bindings/clock/qcom,gcc.txt | 1 + drivers/clk/qcom/Kconfig | 8 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/gcc-ipq806x.c | 1957 ++++++++++++++++++++ include/dt-bindings/clock/qcom,gcc-ipq806x.h | 297 +++ include/dt-bindings/reset/qcom,gcc-ipq806x.h | 124 ++ 6 files changed, 2388 insertions(+) create mode 100644 drivers/clk/qcom/gcc-ipq806x.c create mode 100644 include/dt-bindings/clock/qcom,gcc-ipq806x.h create mode 100644 include/dt-bindings/reset/qcom,gcc-ipq806x.h
Documentation/devicetree/bindings/clock/qcom,gcc.txt +1 -0
@@ -4,6 +4,7 @@ Qualcomm Global Clock & Reset Controller Binding Required properties : - compatible : shall contain only one of the following: + "qcom,gcc-ipq8064" "qcom,gcc-msm8660" "qcom,gcc-msm8960" "qcom,gcc-msm8974"
drivers/clk/qcom/Kconfig +8 -0
@@ -4,6 +4,14 @@ config COMMON_CLK_QCOM select REGMAP_MMIO select RESET_CONTROLLER +config IPQ_GCC_806X + tristate "IPQ806x Global Clock Controller" + depends on COMMON_CLK_QCOM + help + Support for the global clock controller on ipq806x devices. + Say Y if you want to use peripheral devices such as UART, SPI, + i2c, USB, SD/eMMC, etc. + config MSM_GCC_8660 tristate "MSM8660 Global Clock Controller" depends on COMMON_CLK_QCOM
drivers/clk/qcom/Makefile +1 -0
@@ -8,6 +8,7 @@ clk-qcom-y += clk-rcg2.o clk-qcom-y += clk-branch.o clk-qcom-y += reset.o +obj-$(CONFIG_IPQ_GCC_806X) += gcc-ipq806x.o obj-$(CONFIG_MSM_GCC_8660) += gcc-msm8660.o obj-$(CONFIG_MSM_GCC_8960) += gcc-msm8960.o obj-$(CONFIG_MSM_GCC_8974) += gcc-msm8974.o
drivers/clk/qcom/gcc-ipq806x.c new file +1957 -0
1,957 lines not on this page · raw message
include/dt-bindings/clock/qcom,gcc-ipq806x.h new file +297 -0
297 lines not on this page · raw message
include/dt-bindings/reset/qcom,gcc-ipq806x.h new file +124 -0
124 lines not on this page · raw message
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Hi Kumar,
Quoted 13 lines · Kumar Gala
Add a driver for the global clock controller found on IPQ8064 based platforms. This should allow most non-multimedia device drivers to probe and control their clocks.
This is currently missing clocks for SATA, USB, and networking devices.
Signed-off-by Kumar Gala <[email protected]>---
v2:
* dropped audio clock from commit message
* changedKconfigsymbol toIPQ_GCC_806X
* Fixed PXO/CXO clk freq to 25Mhz
<snip>
Quoted 21 lines
drivers/clk/qcom/gcc-ipq806x.c new file +18
-0@@ -0,0 +1,1957 @@ +/* +* Copyright (c) 2014, The Linux Foundation. All rights reserved. +* +* This software is licensed under the terms of the GNU General Public +* License version 2, as published by the Free Software Foundation, and +* may be copied, distributed, and modified under those terms. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#include <linux/kernel.h> +#include <linux/bitops.h> +#include <linux/err.h> +#include <linux/platform_device.h> +#include <linux/module.h>
drivers/clk/qcom/gcc-ipq806x.c line 28
Quoted 10 lines
drivers/clk/qcom/gcc-ipq806x.c new file +10
-0+#include <linux/of.h> +#include <linux/of_device.h> +#include <linux/clk-provider.h> +#include <linux/regmap.h> +#include <linux/reset-controller.h> + +#include <dt-bindings/clock/qcom,gcc-ipq806x.h> +#include <dt-bindings/reset/qcom,gcc-ipq806x.h> + +#include "common.h"
Do I miss something or this file is not available?
Regards,
Ivan
Quoted 44 lines · Ivan T. Ivanov
Hi Kumar,
Quoted 13 lines · Kumar Gala
Add a driver for the global clock controller found on IPQ8064 based platforms. This should allow most non-multimedia device drivers to probe and control their clocks.
This is currently missing clocks for SATA, USB, and networking devices.
Signed-off-by Kumar Gala <[email protected]>---
v2:
* dropped audio clock from commit message
* changedKconfigsymbol toIPQ_GCC_806X
* Fixed PXO/CXO clk freq to 25Mhz<snip>
Quoted 25 lines
drivers/clk/qcom/gcc-ipq806x.c new file +22
-0@@ -0,0 +1,1957 @@ +/* +* Copyright (c) 2014, The Linux Foundation. All rights reserved. +* +* This software is licensed under the terms of the GNU General Public +* License version 2, as published by the Free Software Foundation, and +* may be copied, distributed, and modified under those terms. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#include <linux/kernel.h> +#include <linux/bitops.h> +#include <linux/err.h> +#include <linux/platform_device.h> +#include <linux/module.h> +#include <linux/of.h> +#include <linux/of_device.h> +#include <linux/clk-provider.h> +#include <linux/regmap.h>
Quoted 8 lines
drivers/clk/qcom/gcc-ipq806x.c line 28
Quoted 6 lines
drivers/clk/qcom/gcc-ipq806x.c new file +6
-0+#include <linux/reset-controller.h> + +#include <dt-bindings/clock/qcom,gcc-ipq806x.h> +#include <dt-bindings/reset/qcom,gcc-ipq806x.h> + +#include "common.h" Do I miss something or this file is not available?
Its based on Stephen?s refactoring patch:
https://patchwork.kernel.org/patch/3876761/
- k
Signature · 2 lines
Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Quoted 3 lines · Kumar Gala
Quoted 1 line · Ivan T. Ivanov
Hi Kumar,
<snip>
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
drivers/clk/qcom/gcc-ipq806x.c new file +1
-0@@ -0,0 +1,1957 @@ +/*
<snip>
Quoted 11 lines
Quoted 6 lines
drivers/clk/qcom/gcc-ipq806x.c line 28
Quoted 4 lines
drivers/clk/qcom/gcc-ipq806x.c new file +4
-0+#include <dt-bindings/clock/qcom,gcc-ipq806x.h> +#include <dt-bindings/reset/qcom,gcc-ipq806x.h> + +#include "common.h" Do I miss something or this file is not available?
Its based on Stephen?s refactoring patch:
Thanks,
Ivan
Quoted 2 lines
- k
Quoted 7 lines · Kumar Gala
Add a driver for the global clock controller found on IPQ8064 based platforms. This should allow most non-multimedia device drivers to probe and control their clocks.
This is currently missing clocks for SATA, USB, and networking devices.
Signed-off-by Kumar Gala <[email protected]>
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
drivers/clk/qcom/gcc-ipq806x.c line 108
Quoted 5 lines · Kumar Gala
drivers/clk/qcom/gcc-ipq806x.c new file +5
-0+ +#define P_PXO 0 +#define P_PLL8 1 +#define P_CXO 2 +#define P_PLL3 3
This #define needs to be 1. Unfortunately the way we do this mapping requires that they match the parents string array. If you have a better idea I'm all for it.
Quoted 33 lines
drivers/clk/qcom/gcc-ipq806x.c new file +33
-0+ +static const u8 gcc_pxo_pll8_map[] = { + [P_PXO ] =0 , + [P_PLL8 ] =3 , +}; + +static const char *gcc_pxo_pll8[] = { +"pxo" , +"pll8_vote" , +}; + +static const u8 gcc_pxo_pll8_cxo_map[] = { + [P_PXO ] =0 , + [P_PLL8 ] =3 , + [P_CXO ] =5 , +}; + +static const char *gcc_pxo_pll8_cxo[] = { +"pxo" , +"pll8_vote" , +"cxo" , +}; + +static const u8 gcc_pxo_pll3_map[] = { + [P_PXO ] =0 , + [P_PLL3 ] =1 , +}; + +static const char *gcc_pxo_pll3[] = { +"pxo" , +"pll3" , +}; +
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation