xref: /netbsd-src/sys/dev/marvell/gtbrgreg.h (revision 33ff1f692a451d0ced339d5965b8f71c416fa6d1)
1 /*	$NetBSD: gtbrgreg.h,v 1.3 2016/01/15 12:09:15 joerg Exp $	*/
2 
3 /*
4  * Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. All advertising materials mentioning features or use of this software
16  *    must display the following acknowledgement:
17  *      This product includes software developed for the NetBSD Project by
18  *      Allegro Networks, Inc., and Wasabi Systems, Inc.
19  * 4. The name of Allegro Networks, Inc. may not be used to endorse
20  *    or promote products derived from this software without specific prior
21  *    written permission.
22  * 5. The name of Wasabi Systems, Inc. may not be used to endorse
23  *    or promote products derived from this software without specific prior
24  *    written permission.
25  *
26  * THIS SOFTWARE IS PROVIDED BY ALLEGRO NETWORKS, INC. AND
27  * WASABI SYSTEMS, INC. ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
28  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
29  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
30  * IN NO EVENT SHALL EITHER ALLEGRO NETWORKS, INC. OR WASABI SYSTEMS, INC.
31  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37  * POSSIBILITY OF SUCH DAMAGE.
38  */
39 
40 /*
41  * gtbrgreg.h - register defines for GT-64260 Baud Rate Generator
42  *
43  * creation	Thu Apr 12 21:47:54 PDT 2001	cliff
44  */
45 
46 #ifndef _GTBRGREG_H
47 #define _GTBRGREG_H
48 
49 #define GTBRG_NCHAN	3               /* Number of MPSC channels */
50 
51 /*******************************************************************************
52  *
53  * BRG register address offsets relative to the base mapping
54  */
55 #define BRG_BCR(c)	(0xb200 + ((c) << 3))	/* Baud Config Register */
56 #define BRG_BTR(c)	(0xb204 + ((c) << 3))	/* Baud Tuning Register */
57 #define BRG_CAUSE	0xb834			/* BRG Cause Register */
58 #define BRG_MASK	0xb8b4			/* BRG Cause Register */
59 
60 /*******************************************************************************
61  *
62  * BRG register values & bit defines
63  */
64 /*
65  * BRG Configuration Register bits
66  */
67 #define BRG_BCR_CDV		__BITS(15,0)	/* Count Down Value */
68 #define BRG_BCR_EN		__BIT(16)	/* Enable BRG */
69 #define BRG_BCR_RST		__BIT(17)	/* Reset BRG */
70 #define BRG_BCR_CLKS_MASK	__BITS(22,18)	/* Clock Source */
71 #define BRG_BCR_CLKS_BCLKIN	(0 << 18)	/* from MPP */
72 #define BRG_BCR_CLKS_SCLK0	(2 << 18)	/* from S0 port */
73 #define BRG_BCR_CLKS_TSCLK0	(3 << 18)	/* from S0 port */
74 #define BRG_BCR_CLKS_SCLK1	(6 << 18)	/* from S1 port */
75 #define BRG_BCR_CLKS_TSCLK1	(7 << 18)	/* from S1 port */
76 #define BRG_BCR_CLKS_TCLK	(8 << 18)	/* "Tclk" ??? */
77 						/* all other values resvd. */
78 #define BRG_BCR_RES		__BITS(31,23)
79 /*
80  * BRG Baud Tuning Register bits
81  */
82 #define BRG_BTR_CUV		__BITS(15,0)	/* Count Up Value */
83 #define BRG_BTR_RES		__BITS(31,16)
84 /*
85  * BRG Cause and Mask interrupt Register bits
86  */
87 #define BRG_INTR_BTR0		__BIT(0)	/* Baud Tuning 0 irpt. */
88 #define BRG_INTR_BTR1		__BIT(1)	/* Baud Tuning 1 irpt. */
89 #define BRG_INTR_BTR2		__BIT(2)	/* Baud Tuning 2 irpt. */
90 #define BRG_INTR_RES		__BITS(31,3)
91 
92 #endif	/* _GTBRGREG_H */
93