1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (c) 2008 Michael Sevakis
12 * Clock control functions for IMX31 processor
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
22 ****************************************************************************/
75 CGM_OFF
= 0x0, /* Always off */
76 CGM_ON_RUN
= 0x1, /* On in run mode, off in wait and doze */
77 CGM_ON_RUN_WAIT
= 0x2, /* On in run and wait modes, off in doze */
78 CGM_ON_ALL
= 0x3, /* Always on */
81 #define CG_MASK 0x3 /* bitmask */
83 /* Enable or disable module clocks independently - module must _not_ be
85 void ccm_module_clock_gating(enum IMX31_CG_LIST cg
,
86 enum IMX31_CG_MODES mode
);
97 /* Return the current source pll for MCU */
98 enum IMX31_PLLS
ccm_get_src_pll(void);
100 /* Decode PLL output frequency from register value */
101 unsigned int ccm_calc_pll_rate(unsigned int infreq
, unsigned long regval
);
103 /* Get the PLL reference clock frequency in HZ */
104 unsigned int ccm_get_pll_ref_clk_rate(void);
106 /* Return PLL frequency in HZ */
107 unsigned int ccm_get_pll_rate(enum IMX31_PLLS pll
);
109 /* Return MCU frequency in HZ */
110 unsigned int ccm_get_mcu_clk(void);
112 /* Return ipg_clk in HZ */
113 unsigned int ccm_get_ipg_clk(void);
115 /* Return ahb_clk in HZ */
116 unsigned int ccm_get_ahb_clk(void);
118 /* Return the ATA frequency in HZ */
119 unsigned int ccm_get_ata_clk(void);
121 /* Write new values to the current PLL and post-dividers */
122 void ccm_set_mcupll_and_pdr(unsigned long pllctl
, unsigned long pdr
);
124 #endif /* _CCM_IMX31_H_ */