ARM: plat-nomadik: timer: Add support for periodic timers
[deliverable/linux.git] / arch / arm / mach-omap1 / clock.h
CommitLineData
3179a019
TL
1/*
2 * linux/arch/arm/mach-omap1/clock.h
3 *
52650505 4 * Copyright (C) 2004 - 2005, 2009 Nokia corporation
3179a019
TL
5 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
6 * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __ARCH_ARM_MACH_OMAP1_CLOCK_H
14#define __ARCH_ARM_MACH_OMAP1_CLOCK_H
15
52650505
PW
16#include <linux/clk.h>
17
18#include <plat/clock.h>
19
20extern int __init omap1_clk_init(void);
21extern int omap1_clk_enable(struct clk *clk);
22extern void omap1_clk_disable(struct clk *clk);
23extern long omap1_clk_round_rate(struct clk *clk, unsigned long rate);
24extern int omap1_clk_set_rate(struct clk *clk, unsigned long rate);
25extern unsigned long omap1_ckctl_recalc(struct clk *clk);
26extern int omap1_set_sossi_rate(struct clk *clk, unsigned long rate);
27extern unsigned long omap1_sossi_recalc(struct clk *clk);
28extern unsigned long omap1_ckctl_recalc_dsp_domain(struct clk *clk);
29extern int omap1_clk_set_rate_dsp_domain(struct clk *clk, unsigned long rate);
30extern int omap1_set_uart_rate(struct clk *clk, unsigned long rate);
31extern unsigned long omap1_uart_recalc(struct clk *clk);
32extern int omap1_set_ext_clk_rate(struct clk *clk, unsigned long rate);
33extern long omap1_round_ext_clk_rate(struct clk *clk, unsigned long rate);
34extern void omap1_init_ext_clk(struct clk *clk);
35extern int omap1_select_table_rate(struct clk *clk, unsigned long rate);
36extern long omap1_round_to_table_rate(struct clk *clk, unsigned long rate);
37extern int omap1_clk_set_rate_ckctl_arm(struct clk *clk, unsigned long rate);
38extern long omap1_clk_round_rate_ckctl_arm(struct clk *clk, unsigned long rate);
39extern unsigned long omap1_watchdog_recalc(struct clk *clk);
40
41#ifdef CONFIG_OMAP_RESET_CLOCKS
5838bb67 42extern void omap1_clk_disable_unused(struct clk *clk);
52650505
PW
43#else
44#define omap1_clk_disable_unused NULL
45#endif
3179a019
TL
46
47struct uart_clk {
48 struct clk clk;
49 unsigned long sysc_addr;
50};
51
52/* Provide a method for preventing idling some ARM IDLECT clocks */
53struct arm_idlect1_clk {
54 struct clk clk;
55 unsigned long no_idle_count;
56 __u8 idlect_shift;
57};
58
59/* ARM_CKCTL bit shifts */
60#define CKCTL_PERDIV_OFFSET 0
61#define CKCTL_LCDDIV_OFFSET 2
62#define CKCTL_ARMDIV_OFFSET 4
63#define CKCTL_DSPDIV_OFFSET 6
64#define CKCTL_TCDIV_OFFSET 8
65#define CKCTL_DSPMMUDIV_OFFSET 10
66/*#define ARM_TIMXO 12*/
67#define EN_DSPCK 13
68/*#define ARM_INTHCK_SEL 14*/ /* Divide-by-2 for mpu inth_ck */
69/* DSP_CKCTL bit shifts */
70#define CKCTL_DSPPERDIV_OFFSET 0
71
72/* ARM_IDLECT2 bit shifts */
73#define EN_WDTCK 0
74#define EN_XORPCK 1
75#define EN_PERCK 2
76#define EN_LCDCK 3
77#define EN_LBCK 4 /* Not on 1610/1710 */
78/*#define EN_HSABCK 5*/
79#define EN_APICK 6
80#define EN_TIMCK 7
81#define DMACK_REQ 8
82#define EN_GPIOCK 9 /* Not on 1610/1710 */
83/*#define EN_LBFREECK 10*/
84#define EN_CKOUT_ARM 11
85
86/* ARM_IDLECT3 bit shifts */
87#define EN_OCPI_CK 0
88#define EN_TC1_CK 2
89#define EN_TC2_CK 4
90
91/* DSP_IDLECT2 bit shifts (0,1,2 are same as for ARM_IDLECT2) */
92#define EN_DSPTIMCK 5
93
94/* Various register defines for clock controls scattered around OMAP chip */
90afd5cb 95#define SDW_MCLK_INV_BIT 2 /* In ULPD_CLKC_CTRL */
3179a019
TL
96#define USB_MCLK_EN_BIT 4 /* In ULPD_CLKC_CTRL */
97#define USB_HOST_HHC_UHOST_EN 9 /* In MOD_CONF_CTRL_0 */
98#define SWD_ULPD_PLL_CLK_REQ 1 /* In SWD_CLK_DIV_CTRL_SEL */
99#define COM_ULPD_PLL_CLK_REQ 1 /* In COM_CLK_DIV_CTRL_SEL */
100#define SWD_CLK_DIV_CTRL_SEL 0xfffe0874
101#define COM_CLK_DIV_CTRL_SEL 0xfffe0878
102#define SOFT_REQ_REG 0xfffe0834
103#define SOFT_REQ_REG2 0xfffe0880
104
52650505
PW
105extern __u32 arm_idlect1_mask;
106extern struct clk *api_ck_p, *ck_dpll1_p, *ck_ref_p;
3179a019 107
52650505
PW
108extern const struct clkops clkops_dspck;
109extern const struct clkops clkops_dummy;
fb2fc920 110extern const struct clkops clkops_uart_16xx;
52650505 111extern const struct clkops clkops_generic;
90afd5cb 112
3179a019 113#endif
This page took 0.476746 seconds and 5 git commands to generate.