blob: 5c309533a2797e24492e4916a6930f3e0d88070b [file] [log] [blame]
Heiko Schocherf1084d62011-11-01 20:00:31 +00001/*
2 * Copyright (C) 2011
3 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
4 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
22 */
23#ifndef _DV_PLL_DEFS_H_
24#define _DV_PLL_DEFS_H_
25
26struct dv_pll_regs {
27 unsigned int pid; /* 0x00 */
28 unsigned char rsvd0[224]; /* 0x04 */
29 unsigned int rstype; /* 0xe4 */
30 unsigned char rsvd1[24]; /* 0xe8 */
31 unsigned int pllctl; /* 0x100 */
32 unsigned char rsvd2[4]; /* 0x104 */
33 unsigned int secctl; /* 0x108 */
34 unsigned int rv; /* 0x10c */
35 unsigned int pllm; /* 0x110 */
36 unsigned int prediv; /* 0x114 */
37 unsigned int plldiv1; /* 0x118 */
38 unsigned int plldiv2; /* 0x11c */
39 unsigned int plldiv3; /* 0x120 */
40 unsigned int oscdiv1; /* 0x124 */
41 unsigned int postdiv; /* 0x128 */
42 unsigned int bpdiv; /* 0x12c */
43 unsigned char rsvd5[8]; /* 0x130 */
44 unsigned int pllcmd; /* 0x138 */
45 unsigned int pllstat; /* 0x13c */
46 unsigned int alnctl; /* 0x140 */
47 unsigned int dchange; /* 0x144 */
48 unsigned int cken; /* 0x148 */
49 unsigned int ckstat; /* 0x14c */
50 unsigned int systat; /* 0x150 */
51 unsigned char rsvd6[12]; /* 0x154 */
52 unsigned int plldiv4; /* 0x160 */
53 unsigned int plldiv5; /* 0x164 */
54 unsigned int plldiv6; /* 0x168 */
55 unsigned int plldiv7; /* 0x16C */
56 unsigned int plldiv8; /* 0x170 */
57 unsigned int plldiv9; /* 0x174 */
58};
59
60#define PLLCTL_PLLEN (1 << 0)
61#define PLLCTL_PLLPWRDN (1 << 1)
62#define PLLCTL_PLLRST (1 << 3)
63#define PLLCTL_PLLENSRC (1 << 5)
64#define PLLCTL_RES_9 (1 << 8)
65
66#define PLLSECCTL_TINITZ (1 << 16)
67#define PLLSECCTL_TENABLE (1 << 17)
68#define PLLSECCTL_TENABLEDIV (1 << 18)
69#define PLLSECCTL_STOPMODE (1 << 22)
70
71#define PLLCMD_GOSET (1 << 0)
72
73#define PLL0_LOCK 0x07000000
74#define PLL1_LOCK 0x07000000
75
76#define dv_pll0_regs ((struct dv_pll_regs *)DAVINCI_PLL_CNTRL0_BASE)
77#define dv_pll1_regs ((struct dv_pll_regs *)DAVINCI_PLL_CNTRL1_BASE)
78
Heiko Schocher59214f82011-11-01 20:00:33 +000079#define ARM_PLLDIV (offsetof(struct dv_pll_regs, plldiv2))
80#define DDR_PLLDIV (offsetof(struct dv_pll_regs, plldiv7))
Heiko Schocher109f5482011-11-01 20:00:34 +000081#define SPI_PLLDIV (offsetof(struct dv_pll_regs, plldiv4))
Heiko Schocher59214f82011-11-01 20:00:33 +000082
83unsigned int davinci_clk_get(unsigned int div);
Heiko Schocherf1084d62011-11-01 20:00:31 +000084#endif /* _DV_PLL_DEFS_H_ */