Home | History | Annotate | Line # | Download | only in tx
tx39clockreg.h revision 1.1
      1 /*	$NetBSD: tx39clockreg.h,v 1.1 1999/11/20 19:56:33 uch Exp $ */
      2 
      3 /*
      4  * Copyright (c) 1999, by UCHIYAMA Yasushi
      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. The name of the developer may NOT be used to endorse or promote products
     13  *    derived from this software without specific prior written permission.
     14  *
     15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     18  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     19  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     25  * SUCH DAMAGE.
     26  *
     27  */
     28 /*
     29  * Toshiba TX3912/3922 Clock module
     30  */
     31 
     32 #define TX39_CLOCKCTRL_REG	0x1c0
     33 
     34 /*
     35  *	Clock Control Register
     36  */
     37 /* R/W */
     38 #define TX39_CLOCK_CHICLKDIV_SHIFT	24
     39 #define TX39_CLOCK_CHICLKDIV_MASK	0xff
     40 #define TX39_CLOCK_CHICLKDIV(cr) \
     41 	(((cr) >> TX39_CLOCK_CHICLKDIV_SHIFT) & \
     42 	TX39_CLOCK_CHICLKDIV_MASK)
     43 #define TX39_CLOCK_CHICLKDIV_SET(cr, val) \
     44 	((cr) | (((val) << TX39_CLOCK_CHICLKDIV_SHIFT) & \
     45 	(TX39_CLOCK_CHICLKDIV_MASK << TX39_CLOCK_CHICLKDIV_SHIFT)))
     46 
     47 #define TX39_CLOCK_ENCLKTEST	    0x00800000
     48 #define TX39_CLOCK_CCLKTESTSELSIB   0x00400000
     49 #define TX39_CLOCK_CHIMCLKSEL	    0x00200000
     50 #define TX39_CLOCK_CHICLKDIR	    0x00100000
     51 #define TX39_CLOCK_ENCHIMCLK	    0x00080000
     52 #ifdef TX391X
     53 #define TX39_CLOCK_ENVIDCLK	    0x00040000
     54 #define TX39_CLOCK_ENMBUSCLK	    0x00020000
     55 #endif /* TX391X */
     56 #ifdef TX392X
     57 #define TX39_CLOCK_SPICLKDIR	    0x00040000
     58 #define TX39_CLOCK_ENIRDACLK	    0x00020000
     59 #endif /* TX392X */
     60 #define TX39_CLOCK_ENSPICLK	    0x00010000
     61 #define TX39_CLOCK_ENTIMERCLK	    0x00008000
     62 #define TX39_CLOCK_ENFASTTIMERCLK   0x00004000
     63 #define TX39_CLOCK_SIBCLKDIR	    0x00002000
     64 #ifdef TX392X
     65 #define TX39_CLOCK_ENC48MOUTCLK	    0x00001000
     66 #endif /* TX392X */
     67 #define TX39_CLOCK_ENSIBMCLK	    0x00000800
     68 
     69 #define TX39_CLOCK_SIBMCLKDIV_SHIFT	8
     70 #define TX39_CLOCK_SIBMCLKDIV_MASK	0x7
     71 #define TX39_CLOCK_SIBMCLKDIV(cr) \
     72 	(((cr) >> TX39_CLOCK_SIBMCLKDIV_SHIFT) & \
     73 	TX39_CLOCK_SIBMCLKDIV_MASK)
     74 #define TX39_CLOCK_SIBMCLKDIV_SET(cr, val) \
     75 	((cr) | (((val) << TX39_CLOCK_SIBMCLKDIV_SHIFT) & \
     76 	(TX39_CLOCK_SIBMCLKDIV_MASK << TX39_CLOCK_SIBMCLKDIV_SHIFT)))
     77 
     78 #define TX39_CLOCK_CSERSEL	    0x00000080
     79 
     80 #define TX39_CLOCK_CSERDIV_SHIFT	4
     81 #define TX39_CLOCK_CSERDIV_MASK		0x7
     82 #define TX39_CLOCK_CSERDIV(cr) \
     83 	(((cr) >> TX39_CLOCK_CSERDIV_SHIFT) & \
     84 	TX39_CLOCK_CSERDIV_MASK)
     85 #define TX39_CLOCK_CSERDIV_SET(cr, val) \
     86 	((cr) | (((val) << TX39_CLOCK_CSERDIV_SHIFT) & \
     87 	(TX39_CLOCK_CSERDIV_MASK << TX39_CLOCK_CSERDIV_SHIFT)))
     88 
     89 #define TX39_CLOCK_ENCSERCLK	    0x00000008
     90 #define TX39_CLOCK_ENIRCLK	    0x00000004
     91 #define TX39_CLOCK_ENUARTACLK	    0x00000002
     92 #define TX39_CLOCK_ENUARTBCLK	    0x00000001
     93