aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/clk-nomadik.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-01-11 07:52:34 -0500
committerLinus Walleij <linus.walleij@linaro.org>2012-06-10 12:41:40 -0400
commit4a31bd28e86ac50eb620f6b5b36464c45b5fa38f (patch)
treedffb284d13110554c77403b306979a50187c9905 /drivers/clk/clk-nomadik.c
parentb5111d9ed4cba9a29ee454db162c4a88c6b944bf (diff)
ARM: nomadik: convert to generic clock
Remove more custom stuff by simply converting the Nomadik machine to use generic clocks and move the driver to drivers/clk. Acked-by: Arnd Bergmann <arnd@arndb.de> Cc: Mike Turquette <mturquette@ti.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/clk/clk-nomadik.c')
-rw-r--r--drivers/clk/clk-nomadik.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c
new file mode 100644
index 000000000000..517a8ff7121e
--- /dev/null
+++ b/drivers/clk/clk-nomadik.c
@@ -0,0 +1,47 @@
1#include <linux/clk.h>
2#include <linux/clkdev.h>
3#include <linux/err.h>
4#include <linux/io.h>
5#include <linux/clk-provider.h>
6
7/*
8 * The Nomadik clock tree is described in the STN8815A12 DB V4.2
9 * reference manual for the chip, page 94 ff.
10 */
11
12void __init nomadik_clk_init(void)
13{
14 struct clk *clk;
15
16 clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, CLK_IS_ROOT, 0);
17 clk_register_clkdev(clk, "apb_pclk", NULL);
18 clk_register_clkdev(clk, NULL, "gpio.0");
19 clk_register_clkdev(clk, NULL, "gpio.1");
20 clk_register_clkdev(clk, NULL, "gpio.2");
21 clk_register_clkdev(clk, NULL, "gpio.3");
22 clk_register_clkdev(clk, NULL, "rng");
23
24 /*
25 * The 2.4 MHz TIMCLK reference clock is active at boot time, this is
26 * actually the MXTALCLK @19.2 MHz divided by 8. This clock is used
27 * by the timers and watchdog. See page 105 ff.
28 */
29 clk = clk_register_fixed_rate(NULL, "TIMCLK", NULL, CLK_IS_ROOT,
30 2400000);
31 clk_register_clkdev(clk, NULL, "mtu0");
32 clk_register_clkdev(clk, NULL, "mtu1");
33
34 /*
35 * At boot time, PLL2 is set to generate a set of fixed clocks,
36 * one of them is CLK48, the 48 MHz clock, routed to the UART, MMC/SD
37 * I2C, IrDA, USB and SSP blocks.
38 */
39 clk = clk_register_fixed_rate(NULL, "CLK48", NULL, CLK_IS_ROOT,
40 48000000);
41 clk_register_clkdev(clk, NULL, "uart0");
42 clk_register_clkdev(clk, NULL, "uart1");
43 clk_register_clkdev(clk, NULL, "mmci");
44 clk_register_clkdev(clk, NULL, "ssp");
45 clk_register_clkdev(clk, NULL, "nmk-i2c.0");
46 clk_register_clkdev(clk, NULL, "nmk-i2c.1");
47}