Home | History | Annotate | Line # | Download | only in tx
      1 /*	$NetBSD: tx39powerreg.h,v 1.5 2008/04/28 20:23:21 martin Exp $ */
      2 
      3 /*-
      4  * Copyright (c) 1999 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  *
     19  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29  * POSSIBILITY OF SUCH DAMAGE.
     30  */
     31 
     32 /*
     33  * TOSHIBA TX3912/3922 Power module
     34  */
     35 
     36 #define	TX39_POWERCTRL_REG	0x1c4
     37 
     38 /*
     39  *	Power Control Register
     40  */
     41 /* R */
     42 #define	TX39_POWERCTRL_ONBUTN		0x80000000
     43 #define	TX39_POWERCTRL_PWRINT		0x40000000
     44 #define	TX39_POWERCTRL_PWROK		0x20000000
     45 #ifdef TX391X
     46 /* R/W */
     47 #define TX39_POWERCTRL_VIDRF_SHIFT	27
     48 #define TX39_POWERCTRL_VIDRF_MASK	0x3
     49 #define TX39_POWERCTRL_VIDRF(cr)					\
     50 	(((cr) >> TX39_POWERCTRL_VIDRF_SHIFT) &				\
     51 	TX39_POWERCTRL_VIDRF_MASK)
     52 #define TX39_POWERCTRL_VIDRF_SET(cr, val)				\
     53 	((cr) | (((val) << TX39_POWERCTRL_VIDRF_SHIFT) &		\
     54 	(TX39_POWERCTRL_VIDRF_MASK << TX39_POWERCTRL_VIDRF_SHIFT)))
     55 #endif /* TX391X */
     56 #ifdef TX392X
     57 #define	TX39_POWERCTRL_PWROKNMI		0x10000000
     58 #endif /* TX392X */
     59 
     60 #define	TX39_POWERCTRL_SLOWBUS		0x04000000
     61 #ifdef TX391X
     62 #define	TX39_POWERCTRL_DIVMOD		0x02000000
     63 #endif /* TX391X */
     64 
     65 #define TX39_POWERCTRL_STPTIMERVAL_SHIFT	12
     66 #define TX39_POWERCTRL_STPTIMERVAL_MASK		0xf
     67 #define TX39_POWERCTRL_STPTIMERVAL(cr)					\
     68 	(((cr) >> TX39_POWERCTRL_STPTIMERVAL_SHIFT) &			\
     69 	TX39_POWERCTRL_STPTIMERVAL_MASK)
     70 #define TX39_POWERCTRL_STPTIMERVAL_SET(cr, val)				\
     71 	((cr) | (((val) << TX39_POWERCTRL_STPTIMERVAL_SHIFT) &		\
     72 	(TX39_POWERCTRL_STPTIMERVAL_MASK << TX39_POWERCTRL_STPTIMERVAL_SHIFT)))
     73 #define TX39_POWERCTRL_STPTIMERVAL_MIN		0x0
     74 #define TX39_POWERCTRL_STPTIMERVAL_MAX		0xf
     75 
     76 #define	TX39_POWERCTRL_ENSTPTIMER	0x00000800
     77 #define	TX39_POWERCTRL_ENFORCESHUTDWN	0x00000400
     78 #define	TX39_POWERCTRL_FORCESHUTDWN	0x00000200
     79 #define	TX39_POWERCTRL_FORCESHUTDWNOCC	0x00000100
     80 #define	TX39_POWERCTRL_SELC2MS		0x00000080
     81 #ifdef TX392X
     82 #define	TX39_POWERCTRL_WARMSTART	0x00000040
     83 #endif /* TX392X */
     84 #define	TX39_POWERCTRL_BPDBVCC3		0x00000020
     85 #define	TX39_POWERCTRL_STOPCPU		0x00000010
     86 #define	TX39_POWERCTRL_DBNCONBUTN	0x00000008
     87 #define	TX39_POWERCTRL_COLDSTART	0x00000004
     88 #define	TX39_POWERCTRL_PWRCS		0x00000002
     89 #define	TX39_POWERCTRL_VCCON		0x00000001
     90