1248557Sray/*	$NetBSD: imx51_dpllreg.h,v 1.1 2012/04/17 09:33:31 bsh Exp $	*/
2331722Seadler/*
3248557Sray * Copyright (c) 2012  Genetec Corporation.  All rights reserved.
4248557Sray * Written by Hashimoto Kenichi for Genetec Corporation.
5248557Sray *
6248557Sray * Redistribution and use in source and binary forms, with or without
7248557Sray * modification, are permitted provided that the following conditions
8248557Sray * are met:
9248557Sray * 1. Redistributions of source code must retain the above copyright
10248557Sray *    notice, this list of conditions and the following disclaimer.
11248557Sray * 2. Redistributions in binary form must reproduce the above copyright
12248557Sray *    notice, this list of conditions and the following disclaimer in the
13248557Sray *    documentation and/or other materials provided with the distribution.
14248557Sray *
15248557Sray * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
16248557Sray * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17248557Sray * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18248557Sray * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL GENETEC CORPORATION
19248557Sray * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20248557Sray * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21248557Sray * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22248557Sray * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23248557Sray * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24248557Sray * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25248557Sray * POSSIBILITY OF SUCH DAMAGE.
26248557Sray */
27248557Sray
28248557Sray/*-
29250357Sray * Copyright (c) 2012, 2013 The FreeBSD Foundation
30248557Sray * All rights reserved.
31248557Sray *
32248557Sray * Portions of this software were developed by Oleksandr Rybalko
33248557Sray * under sponsorship from the FreeBSD Foundation.
34248557Sray *
35248557Sray * Redistribution and use in source and binary forms, with or without
36248557Sray * modification, are permitted provided that the following conditions
37248557Sray * are met:
38248557Sray * 1.	Redistributions of source code must retain the above copyright
39248557Sray *	notice, this list of conditions and the following disclaimer.
40248557Sray * 2.	Redistributions in binary form must reproduce the above copyright
41248557Sray *	notice, this list of conditions and the following disclaimer in the
42248557Sray *	documentation and/or other materials provided with the distribution.
43248557Sray *
44248557Sray * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
45248557Sray * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
46248557Sray * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
47248557Sray * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
48248557Sray * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
49248557Sray * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
50248557Sray * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
51248557Sray * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
52248557Sray * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
53248557Sray * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54248557Sray * SUCH DAMAGE.
55248557Sray *
56248557Sray * $FreeBSD$
57248557Sray */
58248557Sray
59248557Sray#ifndef	_IMX51_DPLLREG_H
60248557Sray#define	_IMX51_DPLLREG_H
61248557Sray
62248557Sray#include <sys/cdefs.h>
63248557Sray
64248557Sray/* register offset address */
65248557Sray
66248557Sray#define	IMX51_N_DPLLS		3		/* 1..3 */
67248557Sray
68248557Sray#define	DPLL_BASE(n)	      	(0x83F80000 + (0x4000 * ((n)-1)))
69248557Sray#define	DPLL_SIZE		0x100
70248557Sray
71248557Sray#define	DPLL_DP_CTL		0x0000		/* 0x1223 */
72248557Sray#define	 DP_CTL_LRF		0x00000001
73248557Sray#define	 DP_CTL_BRM		0x00000002
74248557Sray#define	 DP_CTL_PLM		0x00000004
75248557Sray#define	 DP_CTL_RCP		0x00000008
76248557Sray#define	 DP_CTL_RST		0x00000010
77248557Sray#define	 DP_CTL_UPEN		0x00000020
78248557Sray#define	 DP_CTL_PRE		0x00000040
79248557Sray#define	 DP_CTL_HFSM		0x00000080
80248557Sray#define	 DP_CTL_REF_CLK_SEL_MASK	0x00000300
81248557Sray#define	 DP_CTL_REF_CLK_SEL_COSC	0x00000200
82248557Sray#define	 DP_CTL_REF_CLK_SEL_FPM 	0x00000300
83248557Sray#define	 DP_CTL_REF_CLK_DIV	0x00000400
84248557Sray#define	 DP_CTL_DPDCK0_2_EN	0x00001000
85248557Sray#define	 DP_CTL_HIGHCLK_EN	DP_CTL_DPDCK0_2_EN
86248557Sray#define	 DP_CTL_MULCTRL		0x00002000
87248557Sray#define	DPLL_DP_CONFIG		0x0004		/* 2 */
88248557Sray#define	 DPLL_DP_CONFIG_APEN	0x00000002
89248557Sray#define	 DPLL_DP_CONFIG_LDREQ	0x00000001
90248557Sray#define	DPLL_DP_OP		0x0008		/* 0x80 */
91248557Sray#define	 DP_OP_PDF_SHIFT	0
92248557Sray#define	 DP_OP_PDF_MASK		(0xf << DP_OP_PDF_SHIFT)
93248557Sray#define	 DP_OP_MFI_SHIFT	4
94248557Sray#define	 DP_OP_MFI_MASK		(0xf << DP_OP_MFI_SHIFT)
95248557Sray#define	DPLL_DP_MFD		0x000C		/* 2 */
96248557Sray#define	DPLL_DP_MFN		0x0010		/* 1 */
97248557Sray#define	DPLL_DP_MFNMINUS	0x0014		/* 0 */
98248557Sray#define	DPLL_DP_MFNPLUS		0x0018		/* 0 */
99248557Sray#define	DPLL_DP_HFS_OP		0x001C		/* 0x80 */
100248557Sray#define	DPLL_DP_HFS_MFD		0x0020		/* 2 */
101248557Sray#define	DPLL_DP_HFS_MFN		0x0024		/* 1 */
102248557Sray#define	DPLL_DP_TOGC		0x0028		/* 0x20000 */
103248557Sray#define	DPLL_DP_DESTAT		0x002C		/* 1 */
104248557Sray
105248557Sray#endif /* _IMX51_DPLLREG_H */
106