Home | History | Annotate | Line # | Download | only in tx
tx39clockreg.h revision 1.2.2.2
      1 /*	$NetBSD: tx39clockreg.h,v 1.2.2.2 2000/11/20 20:47:18 bouyer Exp $ */
      2 
      3 /*-
      4  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
      5  * All rights reserved.
      6  *
      7  * This code is derived from software contributed to The NetBSD Foundation
      8  * by UCHIYAMA Yasushi.
      9  *
     10  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  * 3. All advertising materials mentioning features or use of this software
     19  *    must display the following acknowledgement:
     20  *        This product includes software developed by the NetBSD
     21  *        Foundation, Inc. and its contributors.
     22  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  *    contributors may be used to endorse or promote products derived
     24  *    from this software without specific prior written permission.
     25  *
     26  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  * POSSIBILITY OF SUCH DAMAGE.
     37  */
     38 
     39 /*
     40  * Toshiba TX3912/3922 Clock module
     41  */
     42 
     43 #define TX39_CLOCKCTRL_REG		0x1c0
     44 
     45 /*
     46  *	Clock Control Register
     47  */
     48 /* R/W */
     49 #define TX39_CLOCK_CHICLKDIV_SHIFT	24
     50 #define TX39_CLOCK_CHICLKDIV_MASK	0xff
     51 #define TX39_CLOCK_CHICLKDIV(cr)				\
     52 	(((cr) >> TX39_CLOCK_CHICLKDIV_SHIFT) &			\
     53 	TX39_CLOCK_CHICLKDIV_MASK)
     54 #define TX39_CLOCK_CHICLKDIV_SET(cr, val)			\
     55 	((cr) | (((val) << TX39_CLOCK_CHICLKDIV_SHIFT) &	\
     56 	(TX39_CLOCK_CHICLKDIV_MASK << TX39_CLOCK_CHICLKDIV_SHIFT)))
     57 
     58 #define TX39_CLOCK_ENCLKTEST		0x00800000
     59 #define TX39_CLOCK_CCLKTESTSELSIB	0x00400000
     60 #define TX39_CLOCK_CHIMCLKSEL		0x00200000
     61 #define TX39_CLOCK_CHICLKDIR		0x00100000
     62 #define TX39_CLOCK_ENCHIMCLK		0x00080000
     63 #ifdef TX391X
     64 #define TX39_CLOCK_ENVIDCLK		0x00040000
     65 #define TX39_CLOCK_ENMBUSCLK		0x00020000
     66 #endif /* TX391X */
     67 #ifdef TX392X
     68 #define TX39_CLOCK_SPICLKDIR		0x00040000
     69 #define TX39_CLOCK_ENIRDACLK		0x00020000
     70 #endif /* TX392X */
     71 #define TX39_CLOCK_ENSPICLK		0x00010000
     72 #define TX39_CLOCK_ENTIMERCLK		0x00008000
     73 #define TX39_CLOCK_ENFASTTIMERCLK	0x00004000
     74 #define TX39_CLOCK_SIBCLKDIR		0x00002000
     75 #ifdef TX392X
     76 #define TX39_CLOCK_ENC48MOUTCLK		0x00001000
     77 #endif /* TX392X */
     78 #define TX39_CLOCK_ENSIBMCLK		0x00000800
     79 
     80 #define TX39_CLOCK_SIBMCLKDIV_SHIFT	8
     81 #define TX39_CLOCK_SIBMCLKDIV_MASK	0x7
     82 #define TX39_CLOCK_SIBMCLKDIV(cr)				\
     83 	(((cr) >> TX39_CLOCK_SIBMCLKDIV_SHIFT) &		\
     84 	TX39_CLOCK_SIBMCLKDIV_MASK)
     85 #define TX39_CLOCK_SIBMCLKDIV_SET(cr, val)			\
     86 	((cr) | (((val) << TX39_CLOCK_SIBMCLKDIV_SHIFT) &	\
     87 	(TX39_CLOCK_SIBMCLKDIV_MASK << TX39_CLOCK_SIBMCLKDIV_SHIFT)))
     88 
     89 #define TX39_CLOCK_CSERSEL	    0x00000080
     90 
     91 #define TX39_CLOCK_CSERDIV_SHIFT	4
     92 #define TX39_CLOCK_CSERDIV_MASK		0x7
     93 #define TX39_CLOCK_CSERDIV(cr)					\
     94 	(((cr) >> TX39_CLOCK_CSERDIV_SHIFT) &			\
     95 	TX39_CLOCK_CSERDIV_MASK)
     96 #define TX39_CLOCK_CSERDIV_SET(cr, val)				\
     97 	((cr) | (((val) << TX39_CLOCK_CSERDIV_SHIFT) &		\
     98 	(TX39_CLOCK_CSERDIV_MASK << TX39_CLOCK_CSERDIV_SHIFT)))
     99 
    100 #define TX39_CLOCK_ENCSERCLK		0x00000008
    101 #define TX39_CLOCK_ENIRCLK		0x00000004
    102 #define TX39_CLOCK_ENUARTACLK		0x00000002
    103 #define TX39_CLOCK_ENUARTBCLK		0x00000001
    104