2 * Clock driver for the ARM RealView 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.
10 #include <linux/clkdev.h>
11 #include <linux/err.h>
13 #include <linux/clk-provider.h>
15 #include <mach/hardware.h>
16 #include <mach/platform.h>
21 * Implementation of the ARM RealView clock trees.
24 static const struct icst_params realview_oscvco_params
= {
26 .vco_max
= ICST307_VCO_MAX
,
27 .vco_min
= ICST307_VCO_MIN
,
32 .s2div
= icst307_s2div
,
33 .idx2s
= icst307_idx2s
,
36 static const struct clk_icst_desc __initdata realview_osc0_desc
= {
37 .params
= &realview_oscvco_params
,
38 .vco_offset
= REALVIEW_SYS_OSC0_OFFSET
,
39 .lock_offset
= REALVIEW_SYS_LOCK_OFFSET
,
42 static const struct clk_icst_desc __initdata realview_osc4_desc
= {
43 .params
= &realview_oscvco_params
,
44 .vco_offset
= REALVIEW_SYS_OSC4_OFFSET
,
45 .lock_offset
= REALVIEW_SYS_LOCK_OFFSET
,
49 * realview_clk_init() - set up the RealView clock tree
51 void __init
realview_clk_init(void __iomem
*sysbase
, bool is_pb1176
)
56 clk
= clk_register_fixed_rate(NULL
, "apb_pclk", NULL
, CLK_IS_ROOT
, 0);
57 clk_register_clkdev(clk
, "apb_pclk", NULL
);
60 clk
= clk_register_fixed_rate(NULL
, "clk24mhz", NULL
, CLK_IS_ROOT
,
62 clk_register_clkdev(clk
, NULL
, "dev:uart0");
63 clk_register_clkdev(clk
, NULL
, "dev:uart1");
64 clk_register_clkdev(clk
, NULL
, "dev:uart2");
65 clk_register_clkdev(clk
, NULL
, "fpga:kmi0");
66 clk_register_clkdev(clk
, NULL
, "fpga:kmi1");
67 clk_register_clkdev(clk
, NULL
, "fpga:mmc0");
68 clk_register_clkdev(clk
, NULL
, "dev:ssp0");
71 * UART3 is on the dev chip in PB1176
72 * UART4 only exists in PB1176
74 clk_register_clkdev(clk
, NULL
, "dev:uart3");
75 clk_register_clkdev(clk
, NULL
, "dev:uart4");
77 clk_register_clkdev(clk
, NULL
, "fpga:uart3");
81 clk
= clk_register_fixed_rate(NULL
, "clk1mhz", NULL
, CLK_IS_ROOT
,
83 clk_register_clkdev(clk
, NULL
, "sp804");
87 clk
= icst_clk_register(NULL
, &realview_osc0_desc
,
90 clk
= icst_clk_register(NULL
, &realview_osc4_desc
,
93 clk_register_clkdev(clk
, NULL
, "dev:clcd");
94 clk_register_clkdev(clk
, NULL
, "issp:clcd");