Home | History | Annotate | Line # | Download | only in tx
tx39sibreg.h revision 1.2.8.1
      1  1.2.8.1  nathanw /*	$NetBSD: tx39sibreg.h,v 1.2.8.1 2001/06/21 19:24:33 nathanw Exp $ */
      2      1.1      uch 
      3  1.2.8.1  nathanw /*-
      4  1.2.8.1  nathanw  * Copyright (c) 2000 The NetBSD Foundation, Inc.
      5      1.1      uch  * All rights reserved.
      6      1.1      uch  *
      7  1.2.8.1  nathanw  * This code is derived from software contributed to The NetBSD Foundation
      8  1.2.8.1  nathanw  * by UCHIYAMA Yasushi.
      9  1.2.8.1  nathanw  *
     10      1.1      uch  * Redistribution and use in source and binary forms, with or without
     11      1.1      uch  * modification, are permitted provided that the following conditions
     12      1.1      uch  * are met:
     13      1.1      uch  * 1. Redistributions of source code must retain the above copyright
     14      1.1      uch  *    notice, this list of conditions and the following disclaimer.
     15  1.2.8.1  nathanw  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.2.8.1  nathanw  *    notice, this list of conditions and the following disclaimer in the
     17  1.2.8.1  nathanw  *    documentation and/or other materials provided with the distribution.
     18  1.2.8.1  nathanw  * 3. All advertising materials mentioning features or use of this software
     19  1.2.8.1  nathanw  *    must display the following acknowledgement:
     20  1.2.8.1  nathanw  *        This product includes software developed by the NetBSD
     21  1.2.8.1  nathanw  *        Foundation, Inc. and its contributors.
     22  1.2.8.1  nathanw  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.2.8.1  nathanw  *    contributors may be used to endorse or promote products derived
     24  1.2.8.1  nathanw  *    from this software without specific prior written permission.
     25      1.1      uch  *
     26  1.2.8.1  nathanw  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.2.8.1  nathanw  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.2.8.1  nathanw  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.2.8.1  nathanw  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.2.8.1  nathanw  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.2.8.1  nathanw  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.2.8.1  nathanw  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.2.8.1  nathanw  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.2.8.1  nathanw  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.2.8.1  nathanw  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.2.8.1  nathanw  * POSSIBILITY OF SUCH DAMAGE.
     37      1.1      uch  */
     38      1.1      uch /*
     39      1.1      uch  * Toshiba TX3912 SIB module
     40      1.1      uch  */
     41      1.1      uch 
     42      1.1      uch #define	TX39_SIBSIZE_REG	0x060 /* W */
     43      1.1      uch #define	TX39_SIBSNDRXSTART_REG	0x064 /* W */
     44      1.1      uch #define	TX39_SIBSNDTXSTART_REG	0x068 /* W */
     45      1.1      uch #define	TX39_SIBTELRXSTART_REG	0x06c /* W */
     46      1.1      uch #define	TX39_SIBTELTXSTART_REG	0x070 /* W */
     47      1.1      uch #define	TX39_SIBCTRL_REG	0x074 /* R/W */
     48      1.1      uch #define	TX39_SIBSNDHOLD_REG	0x078 /* R/W */
     49      1.1      uch #define	TX39_SIBTELHOLD_REG	0x07c /* R/W */
     50      1.1      uch #define	TX39_SIBSF0CTRL_REG	0x080 /* R/W */
     51      1.1      uch #define	TX39_SIBSF1CTRL_REG	0x084 /* R/W */
     52      1.1      uch #define	TX39_SIBSF0STAT_REG	0x088 /* R */
     53      1.1      uch #define	TX39_SIBSF1STAT_REG	0x08c /* R */
     54      1.1      uch #define	TX39_SIBDMACTRL_REG	0x090 /* R/W */
     55      1.1      uch 
     56      1.1      uch /*
     57      1.2      uch  *	SIB DMA
     58      1.2      uch  */
     59      1.2      uch #define TX39_SIBDMA_SIZE	16384
     60      1.2      uch 
     61      1.2      uch /*
     62      1.1      uch  *	SIB Size Register
     63      1.1      uch  */
     64      1.1      uch #define TX39_SIBSIZE_SND_SHIFT	18
     65      1.1      uch #define TX39_SIBSIZE_TEL_SHIFT	2
     66      1.1      uch #define TX39_SIBSIZE_MASK	0xfff
     67      1.1      uch 
     68      1.2      uch #define TX39_SIBSIZE_SNDSIZE_SET(cr, val)				\
     69      1.2      uch 	((cr) | (((((val) >> 2) - 1) << TX39_SIBSIZE_SND_SHIFT) &	\
     70      1.2      uch 	(TX39_SIBSIZE_MASK << TX39_SIBSIZE_SND_SHIFT)))
     71      1.2      uch #define TX39_SIBSIZE_TELSIZE_SET(cr, val)				\
     72      1.2      uch 	((cr) | (((((val) >> 2) - 1) << TX39_SIBSIZE_TEL_SHIFT) &	\
     73      1.2      uch 	(TX39_SIBSIZE_MASK << TX39_SIBSIZE_TEL_SHIFT)))
     74      1.1      uch 
     75      1.1      uch /*
     76      1.1      uch  *	SIB Sound RX Start Register
     77      1.1      uch  *	 [1:0] reserved
     78      1.1      uch  */
     79      1.1      uch /*
     80      1.1      uch  *	SIB Sound TX Start Register
     81      1.1      uch  *	 [1:0] reserved
     82      1.1      uch  */
     83      1.1      uch /*
     84      1.1      uch  *	SIB Telecom RX Start Register
     85      1.1      uch  *	 [1:0] reserved
     86      1.1      uch  */
     87      1.1      uch /*
     88      1.1      uch  *	SIB Telecom TX Start Register
     89      1.1      uch  *	 [1:0] reserved
     90      1.1      uch  */
     91      1.1      uch /*
     92      1.1      uch  *	SIB Control Register
     93      1.1      uch  */
     94      1.1      uch #define	TX39_SIBCTRL_SIBIRQ	0x80000000
     95      1.1      uch #define	TX39_SIBCTRL_ENCNTTEST	0x40000000 /* Don't set */
     96      1.1      uch #define	TX39_SIBCTRL_ENDMATEST	0x20000000 /* Don't set */
     97      1.1      uch #define	TX39_SIBCTRL_SNDMONO	0x10000000
     98      1.1      uch #define	TX39_SIBCTRL_RMONOSNDIN	0x08000000
     99      1.1      uch 
    100      1.1      uch #define TX39_SIBCTRL_SCLKDIV_SHIFT	24
    101      1.1      uch #define TX39_SIBCTRL_SCLKDIV_MASK	0x7
    102  1.2.8.1  nathanw #define TX39_SIBCTRL_SCLKDIV(cr)					\
    103  1.2.8.1  nathanw 	(((cr) >> TX39_SIBCTRL_SCLKDIV_SHIFT) &				\
    104      1.1      uch 	TX39_SIBCTRL_SCLKDIV_MASK)
    105  1.2.8.1  nathanw #define TX39_SIBCTRL_SCLKDIV_SET(cr, val)				\
    106  1.2.8.1  nathanw 	((cr) | (((val) << TX39_SIBCTRL_SCLKDIV_SHIFT) &		\
    107      1.1      uch 	(TX39_SIBCTRL_SCLKDIV_MASK << TX39_SIBCTRL_SCLKDIV_SHIFT)))
    108      1.1      uch 
    109      1.1      uch #define	TX39_SIBCTRL_TEL16	0x00800000
    110      1.1      uch 
    111      1.1      uch #define TX39_SIBCTRL_TELFSDIV_SHIFT	16
    112      1.1      uch #define TX39_SIBCTRL_TELFSDIV_MASK	0x7f
    113  1.2.8.1  nathanw #define TX39_SIBCTRL_TELFSDIV(cr)					\
    114  1.2.8.1  nathanw 	(((cr) >> TX39_SIBCTRL_TELFSDIV_SHIFT) &			\
    115      1.1      uch 	TX39_SIBCTRL_TELFSDIV_MASK)
    116  1.2.8.1  nathanw #define TX39_SIBCTRL_TELFSDIV_SET(cr, val)				\
    117  1.2.8.1  nathanw 	((cr) | (((val) << TX39_SIBCTRL_TELFSDIV_SHIFT) &		\
    118      1.1      uch 	(TX39_SIBCTRL_TELFSDIV_MASK << TX39_SIBCTRL_TELFSDIV_SHIFT)))
    119      1.1      uch 
    120      1.1      uch #define	TX39_SIBCTRL_SND16	0x00008000
    121      1.1      uch 
    122      1.1      uch #define TX39_SIBCTRL_SNDFSDIV_SHIFT	8
    123      1.1      uch #define TX39_SIBCTRL_SNDFSDIV_MASK	0x7f
    124  1.2.8.1  nathanw #define TX39_SIBCTRL_SNDFSDIV(cr)					\
    125  1.2.8.1  nathanw 	(((cr) >> TX39_SIBCTRL_SNDFSDIV_SHIFT) &			\
    126      1.1      uch 	TX39_SIBCTRL_SNDFSDIV_MASK)
    127  1.2.8.1  nathanw #define TX39_SIBCTRL_SNDFSDIV_SET(cr, val)				\
    128  1.2.8.1  nathanw 	((cr) | (((val) << TX39_SIBCTRL_SNDFSDIV_SHIFT) &		\
    129      1.1      uch 	(TX39_SIBCTRL_SNDFSDIV_MASK << TX39_SIBCTRL_SNDFSDIV_SHIFT)))
    130      1.1      uch 
    131      1.1      uch #define	TX39_SIBCTRL_SELTELSF1	0x00000080
    132      1.1      uch #define	TX39_SIBCTRL_SELSNDSF1	0x00000040
    133      1.1      uch #define	TX39_SIBCTRL_ENTEL	0x00000020
    134      1.1      uch #define	TX39_SIBCTRL_ENSND	0x00000010
    135      1.1      uch #define	TX39_SIBCTRL_SIBLOOP	0x00000008
    136      1.1      uch #define	TX39_SIBCTRL_ENSF1	0x00000004
    137      1.1      uch #define	TX39_SIBCTRL_ENSF0	0x00000002
    138      1.1      uch #define	TX39_SIBCTRL_ENSIB	0x00000001
    139      1.1      uch 
    140      1.1      uch /*
    141      1.1      uch  *	SIB Sound RX/TX Holding Register
    142      1.1      uch  */
    143      1.1      uch /*
    144      1.1      uch  *	SIB Telecom RX/TX Holding Register
    145      1.1      uch  */
    146      1.1      uch 
    147      1.1      uch /*
    148      1.1      uch  *	SIB Subframe 0 Control Register
    149      1.1      uch  *	SIB Subframe 0 Status Register
    150      1.1      uch  */
    151      1.1      uch /* Control/Status bit, field definition (See also UCB1200) */
    152      1.1      uch #define TX39_SIBSF0_REGADDR_SHIFT	27
    153      1.1      uch #define TX39_SIBSF0_REGADDR_MASK	0xf
    154  1.2.8.1  nathanw #define TX39_SIBSF0_REGADDR(cr)						\
    155  1.2.8.1  nathanw 	(((cr) >> TX39_SIBSF0_REGADDR_SHIFT) &				\
    156      1.1      uch 	TX39_SIBSF0_REGADDR_MASK)
    157  1.2.8.1  nathanw #define TX39_SIBSF0_REGADDR_SET(cr, val)				\
    158  1.2.8.1  nathanw 	((cr) | (((val) << TX39_SIBSF0_REGADDR_SHIFT) &			\
    159      1.1      uch 	(TX39_SIBSF0_REGADDR_MASK << TX39_SIBSF0_REGADDR_SHIFT)))
    160      1.1      uch 
    161      1.1      uch #define	TX39_SIBSF0_WRITE	0x04000000
    162      1.1      uch #define	TX39_SIBSF0_SNDVALID	0x00020000
    163      1.1      uch #define	TX39_SIBSF0_TELVALID	0x00010000
    164      1.1      uch 
    165      1.1      uch #define TX39_SIBSF0_REGDATA_SHIFT	0
    166      1.1      uch #define TX39_SIBSF0_REGDATA_MASK	0xffff
    167  1.2.8.1  nathanw #define TX39_SIBSF0_REGDATA(cr)						\
    168  1.2.8.1  nathanw 	(((cr) >> TX39_SIBSF0_REGDATA_SHIFT) &				\
    169      1.1      uch 	TX39_SIBSF0_REGDATA_MASK)
    170  1.2.8.1  nathanw #define TX39_SIBSF0_REGDATA_SET(cr, val)				\
    171  1.2.8.1  nathanw 	((cr) | (((val) << TX39_SIBSF0_REGDATA_SHIFT) &			\
    172      1.1      uch 	(TX39_SIBSF0_REGDATA_MASK << TX39_SIBSF0_REGDATA_SHIFT)))
    173  1.2.8.1  nathanw #define TX39_SIBSF0_REGDATA_CLR(cr)					\
    174      1.1      uch 	((cr) &= ~(TX39_SIBSF0_REGDATA_MASK << TX39_SIBSF0_REGDATA_SHIFT))
    175      1.1      uch 
    176      1.1      uch /*
    177      1.1      uch  *	SIB Subframe 1 Control Register
    178      1.1      uch  */
    179      1.1      uch #define	TX39_SIBSF1CTRL_MUTE	0x04000000
    180      1.1      uch #define	TX39_SIBSF1CTRL_MUXL	0x02000000
    181      1.1      uch #define	TX39_SIBSF1CTRL_MUXR	0x01000000
    182      1.1      uch 
    183      1.1      uch #define TX39_SIBSF1CTRL_ADCGAINL_SHIFT	20
    184      1.1      uch #define TX39_SIBSF1CTRL_ADCGAINL_MASK	0xf
    185  1.2.8.1  nathanw #define TX39_SIBSF1CTRL_ADCGAINL_SET(cr, val)				\
    186  1.2.8.1  nathanw 	((cr) | (((val) << TX39_SIBSF1CTRL_ADCGAINL_SHIFT) &		\
    187      1.1      uch 	(TX39_SIBSF1CTRL_ADCGAINL_MASK << TX39_SIBSF1CTRL_ADCGAINL_SHIFT)))
    188      1.1      uch 
    189      1.1      uch #define TX39_SIBSF1CTRL_ADCGAINR_SHIFT	16
    190      1.1      uch #define TX39_SIBSF1CTRL_ADCGAINR_MASK	0xf
    191  1.2.8.1  nathanw #define TX39_SIBSF1CTRL_ADCGAINR_SET(cr, val)				\
    192  1.2.8.1  nathanw 	((cr) | (((val) << TX39_SIBSF1CTRL_ADCGAINR_SHIFT) &		\
    193      1.1      uch 	(TX39_SIBSF1CTRL_ADCGAINR_MASK << TX39_SIBSF1CTRL_ADCGAINR_SHIFT)))
    194      1.1      uch 
    195      1.1      uch #define TX39_SIBSF1CTRL_DACATTNL_SHIFT	8
    196      1.1      uch #define TX39_SIBSF1CTRL_DACATTNL_MASK	0xf
    197  1.2.8.1  nathanw #define TX39_SIBSF1CTRL_DACATTNL_SET(cr, val)				\
    198  1.2.8.1  nathanw 	((cr) | (((val) << TX39_SIBSF1CTRL_DACATTNL_SHIFT) &		\
    199      1.1      uch 	(TX39_SIBSF1CTRL_DACATTNL_MASK << TX39_SIBSF1CTRL_DACATTNL_SHIFT)))
    200      1.1      uch 
    201      1.1      uch #define TX39_SIBSF1CTRL_DACATTNR_SHIFT	4
    202      1.1      uch #define TX39_SIBSF1CTRL_DACATTNR_MASK	0xf
    203  1.2.8.1  nathanw #define TX39_SIBSF1CTRL_DACATTNR_SET(cr, val)				\
    204  1.2.8.1  nathanw 	((cr) | (((val) << TX39_SIBSF1CTRL_DACATTNR_SHIFT) &		\
    205      1.1      uch 	(TX39_SIBSF1CTRL_DACATTNR_MASK << TX39_SIBSF1CTRL_DACATTNR_SHIFT)))
    206      1.1      uch 
    207      1.1      uch #define TX39_SIBSF1CTRL_DIGITALOUT_SHIFT	0
    208      1.1      uch #define TX39_SIBSF1CTRL_DIGITALOUT_MASK	0xf
    209  1.2.8.1  nathanw #define TX39_SIBSF1CTRL_DIGITALOUT_SET(cr, val)				\
    210  1.2.8.1  nathanw 	((cr) | (((val) << TX39_SIBSF1CTRL_DIGITALOUT_SHIFT) &		\
    211      1.1      uch 	(TX39_SIBSF1CTRL_DIGITALOUT_MASK << TX39_SIBSF1CTRL_DIGITALOUT_SHIFT)))
    212      1.1      uch 
    213      1.1      uch /*
    214      1.1      uch  *	SIB Subframe 1 Status Register
    215      1.1      uch  */
    216      1.1      uch #define	TX39_SIBSF1STAT_ADCVALID    0x04000000
    217      1.1      uch #define	TX39_SIBSF1STAT_ADCCLIPL    0x02000000
    218      1.1      uch #define	TX39_SIBSF1STAT_ADCCLIPR    0x01000000
    219      1.1      uch 
    220      1.1      uch #define TX39_SIBSF1STAT_ERROR_SHIFT	20
    221      1.1      uch #define TX39_SIBSF1STAT_ERROR_MASK	0xf
    222  1.2.8.1  nathanw #define TX39_SIBSF1STAT_ERROR_SET(cr, val)				\
    223  1.2.8.1  nathanw 	((cr) | (((val) << TX39_SIBSF1STAT_ERROR_SHIFT) &		\
    224      1.1      uch 	(TX39_SIBSF1STAT_ERROR_MASK << TX39_SIBSF1STAT_ERROR_SHIFT)))
    225      1.1      uch 
    226      1.1      uch #define TX39_SIBSF1STAT_REVISION_SHIFT	16
    227      1.1      uch #define TX39_SIBSF1STAT_REVISION_MASK	0xf
    228  1.2.8.1  nathanw #define TX39_SIBSF1STAT_REVISION_SET(cr, val)				\
    229  1.2.8.1  nathanw 	((cr) | (((val) << TX39_SIBSF1STAT_REVISION_SHIFT) &		\
    230      1.1      uch 	(TX39_SIBSF1STAT_REVISION_MASK << TX39_SIBSF1STAT_REVISION_SHIFT)))
    231      1.1      uch 
    232      1.1      uch #define TX39_SIBSF1STAT_DIGITALIN_SHIFT	0
    233      1.1      uch #define TX39_SIBSF1STAT_DIGITALIN_MASK	0xf
    234  1.2.8.1  nathanw #define TX39_SIBSF1STAT_DIGITALIN_SET(cr, val)				\
    235  1.2.8.1  nathanw 	((cr) | (((val) << TX39_SIBSF1STAT_DIGITALIN_SHIFT) &		\
    236      1.1      uch 	(TX39_SIBSF1STAT_DIGITALIN_MASK << TX39_SIBSF1STAT_DIGITALIN_SHIFT)))
    237      1.1      uch 
    238      1.1      uch /*
    239      1.1      uch  *	SIB DMA Control Register
    240      1.1      uch  */
    241      1.1      uch #define	TX39_SIBDMACTRL_SNDBUFF1TIME	0x80000000
    242      1.1      uch #define	TX39_SIBDMACTRL_SNDDMALOOP	0x40000000
    243      1.1      uch 
    244      1.1      uch #define TX39_SIBDMACTRL_SNDDMAPTR_SHIFT	18
    245      1.1      uch #define TX39_SIBDMACTRL_SNDDMAPTR_MASK	0xfff
    246  1.2.8.1  nathanw #define TX39_SIBDMACTRL_SNDDMAPTR(cr)					\
    247  1.2.8.1  nathanw 	(((cr) >> TX39_SIBDMACTRL_SNDDMAPTR_SHIFT) &			\
    248      1.1      uch 	TX39_SIBDMACTRL_SNDDMAPTR_MASK)
    249      1.1      uch 
    250      1.1      uch #define	TX39_SIBDMACTRL_ENDMARXSND	0x00020000
    251      1.1      uch #define	TX39_SIBDMACTRL_ENDMATXSND	0x00010000
    252      1.1      uch #define	TX39_SIBDMACTRL_TELBUFF1TIME	0x00008000
    253      1.1      uch #define	TX39_SIBDMACTRL_TELDMALOOP	0x00004000
    254      1.1      uch 
    255      1.1      uch #define TX39_SIBDMACTRL_TELDMAPTR_SHIFT	2
    256      1.1      uch #define TX39_SIBDMACTRL_TELDMAPTR_MASK	0xfff
    257  1.2.8.1  nathanw #define TX39_SIBDMACTRL_TELDMAPTR(cr)					\
    258  1.2.8.1  nathanw 	(((cr) >> TX39_SIBDMACTRL_TELDMAPTR_SHIFT) &			\
    259      1.1      uch 	TX39_SIBDMACTRL_TELDMAPTR_MASK)
    260      1.1      uch 
    261      1.1      uch #define	TX39_SIBDMACTRL_ENDMARXTEL	0x00000002
    262      1.1      uch #define	TX39_SIBDMACTRL_ENDMATXTEL	0x00000001
    263      1.1      uch 
    264