2 * Clock driver for the ARM Integrator/AP and Integrator/CP boards
3 * Copyright (C) 2012 Linus Walleij
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 #include <linux/clk-provider.h>
10 #include <linux/clk.h>
11 #include <linux/clkdev.h>
12 #include <linux/err.h>
13 #include <linux/platform_data/clk-integrator.h>
15 #include <mach/hardware.h>
16 #include <mach/platform.h>
21 * Implementation of the ARM Integrator/AP and Integrator/CP clock tree.
22 * Inspired by portions of:
23 * plat-versatile/clock.c and plat-versatile/include/plat/clock.h
26 static const struct icst_params cp_auxvco_params = {
28 .vco_max = ICST525_VCO_MAX_5V,
29 .vco_min = ICST525_VCO_MIN,
34 .s2div = icst525_s2div,
35 .idx2s = icst525_idx2s,
38 static const struct clk_icst_desc __initdata cp_icst_desc = {
39 .params = &cp_auxvco_params,
41 .lock_offset = INTEGRATOR_HDR_LOCK_OFFSET,
45 * integrator_clk_init() - set up the integrator clock tree
46 * @is_cp: pass true if it's the Integrator/CP else AP is assumed
48 void __init integrator_clk_init(bool is_cp)
53 clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, CLK_IS_ROOT, 0);
54 clk_register_clkdev(clk, "apb_pclk", NULL);
56 /* UART reference clock */
57 clk = clk_register_fixed_rate(NULL, "uartclk", NULL, CLK_IS_ROOT,
59 clk_register_clkdev(clk, NULL, "uart0");
60 clk_register_clkdev(clk, NULL, "uart1");
62 clk_register_clkdev(clk, NULL, "mmci");
65 clk = clk_register_fixed_rate(NULL, "clk24mhz", NULL, CLK_IS_ROOT,
67 clk_register_clkdev(clk, NULL, "kmi0");
68 clk_register_clkdev(clk, NULL, "kmi1");
70 clk_register_clkdev(clk, NULL, "ap_timer");
76 clk = clk_register_fixed_rate(NULL, "clk1mhz", NULL, CLK_IS_ROOT,
78 clk_register_clkdev(clk, NULL, "sp804");
80 /* ICST VCO clock used on the Integrator/CP CLCD */
81 clk = icst_clk_register(NULL, &cp_icst_desc,
82 __io_address(INTEGRATOR_HDR_BASE));
83 clk_register_clkdev(clk, NULL, "clcd");