Commit 3b0f4ae3 authored by Michael Turquette's avatar Michael Turquette

Merge branch 'clk-ti' into clk-next

Conflicts:
	drivers/clk/Kconfig
parents 811a498e 8a8b6eb7
Binding for Texas Instruments ADPLL clock.
Binding status: Unstable - ABI compatibility may be broken in the future
This binding uses the common clock binding[1]. It assumes a
register-mapped ADPLL with two to three selectable input clocks
and three to four children.
[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
Required properties:
- compatible : shall be one of "ti,dm814-adpll-s-clock" or
"ti,dm814-adpll-lj-clock" depending on the type of the ADPLL
- #clock-cells : from common clock binding; shall be set to 1.
- clocks : link phandles of parent clocks clkinp and clkinpulow, note
that the adpll-s-clock also has an optional clkinphif
- reg : address and length of the register set for controlling the ADPLL.
Examples:
adpll_mpu_ck: adpll@40 {
#clock-cells = <1>;
compatible = "ti,dm814-adpll-s-clock";
reg = <0x40 0x40>;
clocks = <&devosc_ck &devosc_ck &devosc_ck>;
clock-names = "clkinp", "clkinpulow", "clkinphif";
clock-output-names = "481c5040.adpll.dcoclkldo",
"481c5040.adpll.clkout",
"481c5040.adpll.clkoutx2",
"481c5040.adpll.clkouthif";
};
adpll_dsp_ck: adpll@80 {
#clock-cells = <1>;
compatible = "ti,dm814-adpll-lj-clock";
reg = <0x80 0x30>;
clocks = <&devosc_ck &devosc_ck>;
clock-names = "clkinp", "clkinpulow";
clock-output-names = "481c5080.adpll.dcoclkldo",
"481c5080.adpll.clkout",
"481c5080.adpll.clkoutldo";
};
......@@ -203,5 +203,6 @@ source "drivers/clk/mvebu/Kconfig"
source "drivers/clk/qcom/Kconfig"
source "drivers/clk/samsung/Kconfig"
source "drivers/clk/tegra/Kconfig"
source "drivers/clk/ti/Kconfig"
endmenu
......@@ -77,7 +77,7 @@ obj-$(CONFIG_PLAT_SPEAR) += spear/
obj-$(CONFIG_ARCH_STI) += st/
obj-$(CONFIG_ARCH_SUNXI) += sunxi/
obj-$(CONFIG_ARCH_TEGRA) += tegra/
obj-$(CONFIG_ARCH_OMAP2PLUS) += ti/
obj-y += ti/
obj-$(CONFIG_ARCH_U8500) += ux500/
obj-$(CONFIG_COMMON_CLK_VERSATILE) += versatile/
obj-$(CONFIG_X86) += x86/
......
config COMMON_CLK_TI_ADPLL
tristate "Clock driver for dm814x ADPLL"
depends on ARCH_OMAP2PLUS || COMPILE_TEST
default y if SOC_TI81XX
---help---
ADPLL clock driver for the dm814x SoC using common clock framework.
ifeq ($(CONFIG_ARCH_OMAP2PLUS), y)
obj-y += clk.o autoidle.o clockdomain.o
clk-common = dpll.o composite.o divider.o gate.o \
fixed-factor.o mux.o apll.o \
......@@ -18,3 +20,7 @@ obj-$(CONFIG_SOC_AM43XX) += $(clk-common) dpll3xxx.o clk-43xx.o
ifdef CONFIG_ATAGS
obj-$(CONFIG_ARCH_OMAP3) += clk-3xxx-legacy.o
endif
endif # CONFIG_ARCH_OMAP2PLUS
obj-$(CONFIG_COMMON_CLK_TI_ADPLL) += adpll.o
This diff is collapsed.
......@@ -5,8 +5,10 @@
*/
#include <linux/kernel.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/clk/ti.h>
#include <linux/of_platform.h>
#include "clock.h"
......@@ -27,11 +29,62 @@ static struct ti_dt_clk dm814_clks[] = {
{ .node_name = NULL },
};
static bool timer_clocks_initialized;
static int __init dm814x_adpll_early_init(void)
{
struct device_node *np;
if (!timer_clocks_initialized)
return -ENODEV;
np = of_find_node_by_name(NULL, "pllss");
if (!np) {
pr_err("Could not find node for plls\n");
return -ENODEV;
}
of_platform_populate(np, NULL, NULL, NULL);
return 0;
}
core_initcall(dm814x_adpll_early_init);
static const char * const init_clocks[] = {
"pll040clkout", /* MPU 481c5040.adpll.clkout */
"pll290clkout", /* DDR 481c5290.adpll.clkout */
};
static int __init dm814x_adpll_enable_init_clocks(void)
{
int i, err;
if (!timer_clocks_initialized)
return -ENODEV;
for (i = 0; i < ARRAY_SIZE(init_clocks); i++) {
struct clk *clock;
clock = clk_get(NULL, init_clocks[i]);
if (WARN(IS_ERR(clock), "could not find init clock %s\n",
init_clocks[i]))
continue;
err = clk_prepare_enable(clock);
if (WARN(err, "could not enable init clock %s\n",
init_clocks[i]))
continue;
}
return 0;
}
postcore_initcall(dm814x_adpll_enable_init_clocks);
int __init dm814x_dt_clk_init(void)
{
ti_dt_clocks_register(dm814_clks);
omap2_clk_disable_autoidle_all();
omap2_clk_enable_init_clocks(NULL, 0);
timer_clocks_initialized = true;
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment