2 * TI DaVinci clock definitions
4 * Copyright (C) 2006-2007 Texas Instruments.
5 * Copyright (C) 2008-2009 Deep Root Systems, LLC
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #ifndef __ARCH_ARM_DAVINCI_CLOCK_H
13 #define __ARCH_ARM_DAVINCI_CLOCK_H
15 #include <linux/list.h>
16 #include <asm/clkdev.h>
18 #define DAVINCI_PLL1_BASE 0x01c40800
19 #define DAVINCI_PLL2_BASE 0x01c40c00
22 /* PLL/Reset register offsets */
24 #define PLLCTL_PLLEN BIT(0)
25 #define PLLCTL_PLLPWRDN BIT(1)
26 #define PLLCTL_PLLRST BIT(3)
27 #define PLLCTL_PLLDIS BIT(4)
28 #define PLLCTL_PLLENSRC BIT(5)
29 #define PLLCTL_CLKMODE BIT(8)
32 #define PLLM_PLLM_MASK 0xff
42 #define PLLALNCTL 0x140
43 #define PLLDCHANGE 0x144
45 #define PLLCKSTAT 0x14c
46 #define PLLSYSTAT 0x150
53 #define PLLDIV_EN BIT(15)
54 #define PLLDIV_RATIO_MASK 0x1f
63 #define PLL_HAS_PREDIV 0x01
64 #define PLL_HAS_POSTDIV 0x02
67 struct list_head node;
76 struct list_head children; /* list of children */
77 struct list_head childnode; /* parent's child list node */
78 struct pll_data *pll_data;
80 unsigned long (*recalc) (struct clk *);
81 int (*set_rate) (struct clk *clk, unsigned long rate);
82 int (*round_rate) (struct clk *clk, unsigned long rate);
85 /* Clock flags: SoC-specific flags start at BIT(16) */
86 #define ALWAYS_ENABLED BIT(1)
87 #define CLK_PSC BIT(2)
88 #define PSC_DSP BIT(3) /* PSC uses DSP domain, not ARM */
89 #define CLK_PLL BIT(4) /* PLL-derived clock */
90 #define PRE_PLL BIT(5) /* source is before PLL mult/div */
96 #define CLK(dev, con, ck) \
105 int davinci_clk_init(struct davinci_clk *clocks);
106 int davinci_set_pllrate(struct pll_data *pll, unsigned int prediv,
107 unsigned int mult, unsigned int postdiv);
109 extern struct platform_device davinci_wdt_device;