2008-03-18 08:22:06 +00:00
|
|
|
/*
|
|
|
|
* linux/arch/arm/mach-omap2/clock.h
|
|
|
|
*
|
2009-12-08 23:21:29 +00:00
|
|
|
* Copyright (C) 2005-2009 Texas Instruments, Inc.
|
2011-02-25 22:39:28 +00:00
|
|
|
* Copyright (C) 2004-2011 Nokia Corporation
|
2008-03-18 08:22:06 +00:00
|
|
|
*
|
2008-03-18 09:56:39 +00:00
|
|
|
* Contacts:
|
|
|
|
* Richard Woodruff <r-woodruff2@ti.com>
|
2008-03-18 08:22:06 +00:00
|
|
|
* Paul Walmsley
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK_H
|
|
|
|
#define __ARCH_ARM_MACH_OMAP2_CLOCK_H
|
|
|
|
|
2011-07-10 11:57:06 +00:00
|
|
|
#include <linux/kernel.h>
|
2012-09-27 16:33:34 +00:00
|
|
|
#include <linux/list.h>
|
|
|
|
|
2012-09-27 16:33:35 +00:00
|
|
|
#include <linux/clkdev.h>
|
2012-11-07 21:14:47 +00:00
|
|
|
#include <linux/clk-provider.h>
|
2013-06-12 13:04:34 +00:00
|
|
|
#include <linux/clk/ti.h>
|
2012-09-27 16:33:35 +00:00
|
|
|
|
2012-09-27 16:33:34 +00:00
|
|
|
/* struct clksel_rate.flags possibilities */
|
|
|
|
#define RATE_IN_242X (1 << 0)
|
|
|
|
#define RATE_IN_243X (1 << 1)
|
|
|
|
#define RATE_IN_3430ES1 (1 << 2) /* 3430ES1 rates only */
|
|
|
|
#define RATE_IN_3430ES2PLUS (1 << 3) /* 3430 ES >= 2 rates only */
|
|
|
|
#define RATE_IN_36XX (1 << 4)
|
|
|
|
#define RATE_IN_4430 (1 << 5)
|
|
|
|
#define RATE_IN_TI816X (1 << 6)
|
|
|
|
#define RATE_IN_4460 (1 << 7)
|
|
|
|
#define RATE_IN_AM33XX (1 << 8)
|
|
|
|
#define RATE_IN_TI814X (1 << 9)
|
|
|
|
|
|
|
|
#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
|
|
|
|
#define RATE_IN_34XX (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
|
|
|
|
#define RATE_IN_3XXX (RATE_IN_34XX | RATE_IN_36XX)
|
|
|
|
#define RATE_IN_44XX (RATE_IN_4430 | RATE_IN_4460)
|
|
|
|
|
|
|
|
/* RATE_IN_3430ES2PLUS_36XX includes 34xx/35xx with ES >=2, and all 36xx/37xx */
|
|
|
|
#define RATE_IN_3430ES2PLUS_36XX (RATE_IN_3430ES2PLUS | RATE_IN_36XX)
|
|
|
|
|
[ARM] omap: add support for bypassing DPLLs
This roughly corresponds with OMAP commits: 7d06c48, 3241b19,
88b5d9b, 18a5500, 9c909ac, 5c6497b, 8b1f0bd, 2ac1da8.
For both OMAP2 and OMAP3, we note the reference and bypass clocks in
the DPLL data structure. Whenever we modify the DPLL rate, we first
ensure that both the reference and bypass clocks are enabled. Then,
we decide whether to use the reference and DPLL, or the bypass clock
if the desired rate is identical to the bypass rate, and program the
DPLL appropriately. Finally, we update the clock's parent, and then
disable the unused clocks.
This keeps the parents correctly balanced, and more importantly ensures
that the bypass clock is running whenever we reprogram the DPLL. This
is especially important because the procedure for reprogramming the DPLL
involves switching to the bypass clock.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-19 13:29:22 +00:00
|
|
|
/* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */
|
|
|
|
#define CORE_CLK_SRC_32K 0x0
|
|
|
|
#define CORE_CLK_SRC_DPLL 0x1
|
|
|
|
#define CORE_CLK_SRC_DPLL_X2 0x2
|
|
|
|
|
|
|
|
/* OMAP2xxx CM_CLKEN_PLL.EN_DPLL bits - for omap2_get_dpll_rate() */
|
|
|
|
#define OMAP2XXX_EN_DPLL_LPBYPASS 0x1
|
|
|
|
#define OMAP2XXX_EN_DPLL_FRBYPASS 0x2
|
|
|
|
#define OMAP2XXX_EN_DPLL_LOCKED 0x3
|
|
|
|
|
|
|
|
/* OMAP3xxx CM_CLKEN_PLL*.EN_*_DPLL bits - for omap2_get_dpll_rate() */
|
|
|
|
#define OMAP3XXX_EN_DPLL_LPBYPASS 0x5
|
|
|
|
#define OMAP3XXX_EN_DPLL_FRBYPASS 0x6
|
|
|
|
#define OMAP3XXX_EN_DPLL_LOCKED 0x7
|
|
|
|
|
2009-12-09 01:47:16 +00:00
|
|
|
/* OMAP4xxx CM_CLKMODE_DPLL*.EN_*_DPLL bits - for omap2_get_dpll_rate() */
|
|
|
|
#define OMAP4XXX_EN_DPLL_MNBYPASS 0x4
|
|
|
|
#define OMAP4XXX_EN_DPLL_LPBYPASS 0x5
|
|
|
|
#define OMAP4XXX_EN_DPLL_FRBYPASS 0x6
|
|
|
|
#define OMAP4XXX_EN_DPLL_LOCKED 0x7
|
|
|
|
|
2010-02-23 05:09:36 +00:00
|
|
|
void omap2_clk_print_new_rates(const char *hfclkin_ck_name,
|
|
|
|
const char *core_ck_name,
|
|
|
|
const char *mpu_ck_name);
|
2008-03-18 08:22:06 +00:00
|
|
|
|
2011-12-13 18:46:43 +00:00
|
|
|
extern u16 cpu_mask;
|
2009-12-08 23:21:29 +00:00
|
|
|
|
2008-11-04 17:59:52 +00:00
|
|
|
extern const struct clkops clkops_omap2_dflt_wait;
|
2008-11-04 18:59:32 +00:00
|
|
|
extern const struct clkops clkops_omap2_dflt;
|
2008-11-04 17:59:52 +00:00
|
|
|
|
2009-12-08 23:18:47 +00:00
|
|
|
extern struct clk_functions omap2_clk_functions;
|
|
|
|
|
2015-04-27 18:55:42 +00:00
|
|
|
int __init omap2_clk_setup_ll_ops(void);
|
2014-10-22 12:15:36 +00:00
|
|
|
|
2014-07-02 08:47:39 +00:00
|
|
|
void __init ti_clk_init_features(void);
|
2008-03-18 08:22:06 +00:00
|
|
|
#endif
|