aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-05-23 05:09:57 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-06-17 07:54:36 -0400
commit14c2607144c11653b27a423ead0703ffaa65d0b1 (patch)
tree7b1f7d80d388374400037b7eda93e0c37de88267 /drivers/clk
parent4cc4f6d1815133ad81de49e65da567f9a2c47cc3 (diff)
clk: move the U300 fixed and fixed-factor to DT
This converts the fixed and fixed-factor clocks in the U300 platform to register themselves from the device tree. Acked-by: Mike Turquette <mturquette@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/clk-u300.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/drivers/clk/clk-u300.c b/drivers/clk/clk-u300.c
index a41e42ec0916..bebd6c973d4b 100644
--- a/drivers/clk/clk-u300.c
+++ b/drivers/clk/clk-u300.c
@@ -11,6 +11,7 @@
11#include <linux/io.h> 11#include <linux/io.h>
12#include <linux/clk-provider.h> 12#include <linux/clk-provider.h>
13#include <linux/spinlock.h> 13#include <linux/spinlock.h>
14#include <linux/of.h>
14 15
15/* APP side SYSCON registers */ 16/* APP side SYSCON registers */
16/* CLK Control Register 16bit (R/W) */ 17/* CLK Control Register 16bit (R/W) */
@@ -931,6 +932,17 @@ mclk_clk_register(struct device *dev, const char *name,
931 return clk; 932 return clk;
932} 933}
933 934
935static const __initconst struct of_device_id u300_clk_match[] = {
936 {
937 .compatible = "fixed-clock",
938 .data = of_fixed_clk_setup,
939 },
940 {
941 .compatible = "fixed-factor-clock",
942 .data = of_fixed_factor_clk_setup,
943 },
944};
945
934void __init u300_clk_init(void __iomem *base) 946void __init u300_clk_init(void __iomem *base)
935{ 947{
936 u16 val; 948 u16 val;
@@ -951,26 +963,7 @@ void __init u300_clk_init(void __iomem *base)
951 val |= U300_SYSCON_PMCR_PWR_MGNT_ENABLE; 963 val |= U300_SYSCON_PMCR_PWR_MGNT_ENABLE;
952 writew(val, syscon_vbase + U300_SYSCON_PMCR); 964 writew(val, syscon_vbase + U300_SYSCON_PMCR);
953 965
954 /* These are always available (RTC and PLL13) */ 966 of_clk_init(u300_clk_match);
955 clk = clk_register_fixed_rate(NULL, "app_32_clk", NULL,
956 CLK_IS_ROOT, 32768);
957 /* The watchdog sits directly on the 32 kHz clock */
958 clk_register_clkdev(clk, NULL, "coh901327_wdog");
959 clk = clk_register_fixed_rate(NULL, "pll13", NULL,
960 CLK_IS_ROOT, 13000000);
961
962 /* These derive from PLL208 */
963 clk = clk_register_fixed_rate(NULL, "pll208", NULL,
964 CLK_IS_ROOT, 208000000);
965 clk = clk_register_fixed_factor(NULL, "app_208_clk", "pll208",
966 0, 1, 1);
967 clk = clk_register_fixed_factor(NULL, "app_104_clk", "pll208",
968 0, 1, 2);
969 clk = clk_register_fixed_factor(NULL, "app_52_clk", "pll208",
970 0, 1, 4);
971 /* The 52 MHz is divided down to 26 MHz */
972 clk = clk_register_fixed_factor(NULL, "app_26_clk", "app_52_clk",
973 0, 1, 2);
974 967
975 /* Directly on the AMBA interconnect */ 968 /* Directly on the AMBA interconnect */
976 clk = syscon_clk_register(NULL, "cpu_clk", "app_208_clk", 0, true, 969 clk = syscon_clk_register(NULL, "cpu_clk", "app_208_clk", 0, true,