blob: bbe4b32891bb62935ce1fd637fc558a2061efb18 [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Paul Walmsley543d9372008-03-18 10:22:06 +02002/*
3 * linux/arch/arm/mach-omap2/clock.h
4 *
Paul Walmsleyd8a94452009-12-08 16:21:29 -07005 * Copyright (C) 2005-2009 Texas Instruments, Inc.
Paul Walmsley530e5442011-02-25 15:39:28 -07006 * Copyright (C) 2004-2011 Nokia Corporation
Tony Lindgrena16e9702008-03-18 11:56:39 +02007 *
8 * Contacts:
Paul Walmsley543d9372008-03-18 10:22:06 +02009 * Richard Woodruff <r-woodruff2@ti.com>
Paul Walmsley543d9372008-03-18 10:22:06 +020010 * Paul Walmsley
Paul Walmsley543d9372008-03-18 10:22:06 +020011 */
12
13#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK_H
14#define __ARCH_ARM_MACH_OMAP2_CLOCK_H
15
Paul Walmsley12706c52011-07-10 05:57:06 -060016#include <linux/kernel.h>
Paul Walmsleya135eaa2012-09-27 10:33:34 -060017#include <linux/list.h>
Paul Walmsley12706c52011-07-10 05:57:06 -060018
Paul Walmsleye10dd622012-09-27 10:33:35 -060019#include <linux/clkdev.h>
Mike Turquettef9ae32a2012-11-07 13:14:47 -080020#include <linux/clk-provider.h>
Tero Kristof38b0dd2013-06-12 16:04:34 +030021#include <linux/clk/ti.h>
Paul Walmsleye10dd622012-09-27 10:33:35 -060022
Paul Walmsleya135eaa2012-09-27 10:33:34 -060023/* struct clksel_rate.flags possibilities */
24#define RATE_IN_242X (1 << 0)
25#define RATE_IN_243X (1 << 1)
26#define RATE_IN_3430ES1 (1 << 2) /* 3430ES1 rates only */
27#define RATE_IN_3430ES2PLUS (1 << 3) /* 3430 ES >= 2 rates only */
28#define RATE_IN_36XX (1 << 4)
29#define RATE_IN_4430 (1 << 5)
30#define RATE_IN_TI816X (1 << 6)
31#define RATE_IN_4460 (1 << 7)
32#define RATE_IN_AM33XX (1 << 8)
33#define RATE_IN_TI814X (1 << 9)
34
35#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
36#define RATE_IN_34XX (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
37#define RATE_IN_3XXX (RATE_IN_34XX | RATE_IN_36XX)
38#define RATE_IN_44XX (RATE_IN_4430 | RATE_IN_4460)
39
40/* RATE_IN_3430ES2PLUS_36XX includes 34xx/35xx with ES >=2, and all 36xx/37xx */
41#define RATE_IN_3430ES2PLUS_36XX (RATE_IN_3430ES2PLUS | RATE_IN_36XX)
42
Russell Kingc0bf3132009-02-19 13:29:22 +000043/* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */
44#define CORE_CLK_SRC_32K 0x0
45#define CORE_CLK_SRC_DPLL 0x1
46#define CORE_CLK_SRC_DPLL_X2 0x2
47
48/* OMAP2xxx CM_CLKEN_PLL.EN_DPLL bits - for omap2_get_dpll_rate() */
49#define OMAP2XXX_EN_DPLL_LPBYPASS 0x1
50#define OMAP2XXX_EN_DPLL_FRBYPASS 0x2
51#define OMAP2XXX_EN_DPLL_LOCKED 0x3
52
53/* OMAP3xxx CM_CLKEN_PLL*.EN_*_DPLL bits - for omap2_get_dpll_rate() */
54#define OMAP3XXX_EN_DPLL_LPBYPASS 0x5
55#define OMAP3XXX_EN_DPLL_FRBYPASS 0x6
56#define OMAP3XXX_EN_DPLL_LOCKED 0x7
57
Rajendra Nayak16975a72009-12-08 18:47:16 -070058/* OMAP4xxx CM_CLKMODE_DPLL*.EN_*_DPLL bits - for omap2_get_dpll_rate() */
59#define OMAP4XXX_EN_DPLL_MNBYPASS 0x4
60#define OMAP4XXX_EN_DPLL_LPBYPASS 0x5
61#define OMAP4XXX_EN_DPLL_FRBYPASS 0x6
62#define OMAP4XXX_EN_DPLL_LOCKED 0x7
63
Tero Kristo6c0afb52017-02-09 11:24:37 +020064extern struct ti_clk_ll_ops omap_clk_ll_ops;
65
Afzal Mohammed99541192011-12-13 10:46:43 -080066extern u16 cpu_mask;
Paul Walmsleyd8a94452009-12-08 16:21:29 -070067
Russell Kingb36ee722008-11-04 17:59:52 +000068extern const struct clkops clkops_omap2_dflt_wait;
Russell Kingbc51da42008-11-04 18:59:32 +000069extern const struct clkops clkops_omap2_dflt;
Russell Kingb36ee722008-11-04 17:59:52 +000070
Paul Walmsley82e9bd52009-12-08 16:18:47 -070071extern struct clk_functions omap2_clk_functions;
72
Tero Kristoe9e63082015-04-27 21:55:42 +030073int __init omap2_clk_setup_ll_ops(void);
Tero Kristo9f029b12014-10-22 15:15:36 +030074
Tero Kristo8111e012014-07-02 11:47:39 +030075void __init ti_clk_init_features(void);
Paul Walmsley543d9372008-03-18 10:22:06 +020076#endif