Home | History | Annotate | Line # | Download | only in hd64461
hd64461videoreg.h revision 1.1
      1  1.1  uch /*	$NetBSD: hd64461videoreg.h,v 1.1 2001/06/04 17:08:36 uch Exp $	*/
      2  1.1  uch 
      3  1.1  uch /*-
      4  1.1  uch  * Copyright (c) 2001 The NetBSD Foundation, Inc.
      5  1.1  uch  * All rights reserved.
      6  1.1  uch  *
      7  1.1  uch  * This code is derived from software contributed to The NetBSD Foundation
      8  1.1  uch  * by UCHIYAMA Yasushi.
      9  1.1  uch  *
     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.1  uch  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1  uch  *    notice, this list of conditions and the following disclaimer in the
     17  1.1  uch  *    documentation and/or other materials provided with the distribution.
     18  1.1  uch  * 3. All advertising materials mentioning features or use of this software
     19  1.1  uch  *    must display the following acknowledgement:
     20  1.1  uch  *        This product includes software developed by the NetBSD
     21  1.1  uch  *        Foundation, Inc. and its contributors.
     22  1.1  uch  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.1  uch  *    contributors may be used to endorse or promote products derived
     24  1.1  uch  *    from this software without specific prior written permission.
     25  1.1  uch  *
     26  1.1  uch  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.1  uch  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.1  uch  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.1  uch  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.1  uch  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.1  uch  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.1  uch  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.1  uch  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.1  uch  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.1  uch  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.1  uch  * POSSIBILITY OF SUCH DAMAGE.
     37  1.1  uch  */
     38  1.1  uch 
     39  1.1  uch /*
     40  1.1  uch  * LCD Controller Control Register
     41  1.1  uch  */
     42  1.1  uch /* Base Address Register */
     43  1.1  uch #define HD64461_LCDCBAR_REG16			0xb0001000
     44  1.1  uch #define HD64461_LCDCBAR_MASK			0x3fff
     45  1.1  uch #define HD64461_LCDCBAR_SHIFT			12
     46  1.1  uch #define HD64461_LCDCBAR_BASEADDR(x)					\
     47  1.1  uch 	(((x) & HD64461_LCDCBAR_MASK) << HD64461_LCDCBAR_SHIFT)
     48  1.1  uch 
     49  1.1  uch /* Line Address Offset Register */
     50  1.1  uch #define HD64461_LCDCLOR_REG16			0xb0001002
     51  1.1  uch #define HD64461_LCDCLOR_MASK			0x07ff
     52  1.1  uch #define HD64461_LCDCLOR(x)	((x) & HD64461_LCDCLOR_MASK)
     53  1.1  uch 
     54  1.1  uch /* LCDC Control Register */
     55  1.1  uch #define HD64461_LCDCCR_REG16			0xb0001004
     56  1.1  uch #define HD64461_LCDCCR_STBAK			0x0400
     57  1.1  uch #define HD64461_LCDCCR_STREQ			0x0100
     58  1.1  uch #define HD64461_LCDCCR_MOFF			0x0080
     59  1.1  uch #define HD64461_LCDCCR_REFSEL			0x0040
     60  1.1  uch #define HD64461_LCDCCR_EPON			0x0020
     61  1.1  uch #define HD64461_LCDCCR_SPON			0x0010
     62  1.1  uch #define HD64461_LCDCCR_DSPSEL_MASK		0x7
     63  1.1  uch #define HD64461_LCDCCR_DSPSEL(x)	((x) & HD64461_LCDCCR_DSPSEL_MASK)
     64  1.1  uch #define HD64461_LCDCCR_DSPSEL_LCD_CRT		0x4
     65  1.1  uch #define HD64461_LCDCCR_DSPSEL_CRT		0x2
     66  1.1  uch #define HD64461_LCDCCR_DSPSEL_LCD		0x1
     67  1.1  uch 
     68  1.1  uch /* LCD Display Register */
     69  1.1  uch /* 1 */
     70  1.1  uch #define HD64461_LCDLDR1_REG16			0xb0001010
     71  1.1  uch #define HD64461_LCDLDR1_DINV			0x0100
     72  1.1  uch #define HD64461_LCDLDR1_DON			0x0001
     73  1.1  uch /* 2 */
     74  1.1  uch #define HD64461_LCDLDR2_REG16			0xb0001012
     75  1.1  uch #define HD64461_LCDLDR2_CC1			0x0080
     76  1.1  uch #define HD64461_LCDLDR2_CC2			0x0040
     77  1.1  uch #define HD64461_LCDLDR2_LM_MASK			0x7
     78  1.1  uch #define HD64461_LCDLDR2_LM(x)		((x) & HD64461_LCDLDR2_LM_MASK)
     79  1.1  uch #define HD64461_LCDLDR2_LM_COLOR		0x4
     80  1.1  uch #define HD64461_LCDLDR2_LM_GRAY8		0x1
     81  1.1  uch #define HD64461_LCDLDR2_LM_GRAY4		0x0
     82  1.1  uch /* 3 */
     83  1.1  uch #define HD64461_LCDLDR3_REG16			0xb000101e
     84  1.1  uch #define HD64461_LCDLDR3_CS_SHIFT		5
     85  1.1  uch #define HD64461_LCDLDR3_CS_MASK			0x1f
     86  1.1  uch #define HD64461_LCDLDR3_CS(cr)						\
     87  1.1  uch 	(((cr) >> HD64461_LCDLDR3_CS_SHIFT) &				\
     88  1.1  uch 	HD64461_LCDLDR3_CS_MASK)
     89  1.1  uch #define HD64461_LCDLDR3_CS_SET(cr, val)					\
     90  1.1  uch 	((cr) | (((val) << HD64461_LCDLDR3_CS_SHIFT) &			\
     91  1.1  uch 	(HD64461_LCDLDR3_CS_MASK << HD64461_LCDLDR3_CS_SHIFT)))
     92  1.1  uch #define HD64461_LCDLDR3_CG_MASK			0xf
     93  1.1  uch #define HD64461_LCDLDR3_CG(cr)						\
     94  1.1  uch 	((cr)  & HD64461_LCDLDR3_CG_MASK)
     95  1.1  uch #define HD64461_LCDLDR3_CG_CLR(cr)					\
     96  1.1  uch 	((cr)  & ~HD64461_LCDLDR3_CG_MASK)
     97  1.1  uch #define HD64461_LCDLDR3_CG_SET(cr, val)					\
     98  1.1  uch 	((cr) | ((val) & HD64461_LCDLDR3_CG_MASK))
     99  1.1  uch 
    100  1.1  uch /*
    101  1.1  uch  *	select CL2 frequency
    102  1.1  uch  *	0x0	15 MHz (color) 15/2 (monochrome)
    103  1.1  uch  *	0x1	2.5 MHz
    104  1.1  uch  *	0x2	3.75 Mhz
    105  1.1  uch  *	0x4	5 Mhz
    106  1.1  uch  *	0x8	7.5 Mhz
    107  1.1  uch  *	0x10	10 Mhz
    108  1.1  uch  */
    109  1.1  uch #define HD64461_LCDLDR3_CG_COLOR16	0x8
    110  1.1  uch #define HD64461_LCDLDR3_CG_COLOR8	0x4
    111  1.1  uch #define HD64461_LCDLDR3_CG_GRAY6	0x3
    112  1.1  uch #define HD64461_LCDLDR3_CG_GRAY4	0x2
    113  1.1  uch #define HD64461_LCDLDR3_CG_GRAY2	0x1
    114  1.1  uch #define HD64461_LCDLDR3_CG_GRAY1	0x0
    115  1.1  uch 
    116  1.1  uch /* LCD Number of Characters in Horizontal Register */
    117  1.1  uch #define HD64461_LCDLDHNCR_REG16			0xb0001014
    118  1.1  uch #define HD64461_LCDLDHNCR_NHD_SHIFT		8
    119  1.1  uch #define HD64461_LCDLDHNCR_NHD_MASK		0xff
    120  1.1  uch #define HD64461_LCDLDHNCR_NHD(cr)					\
    121  1.1  uch 	(((cr) >> HD64461_LCDLDHNCR_NHD_SHIFT) &			\
    122  1.1  uch 	HD64461_LCDLDHNCR_NHD_MASK)
    123  1.1  uch #define HD64461_LCDLDHNCR_NHD_SET(cr, val)				\
    124  1.1  uch 	((cr) | (((val) << HD64461_LCDLDHNCR_NHD_SHIFT) &		\
    125  1.1  uch 	(HD64461_LCDLDHNCR_NHD_MASK << HD64461_LCDLDHNCR_NHD_SHIFT)))
    126  1.1  uch #define HD64461_LCDLDHNCR_NHT_SHIFT		0
    127  1.1  uch #define HD64461_LCDLDHNCR_NHT_MASK		0xff
    128  1.1  uch #define HD64461_LCDLDHNCR_NHT(cr)					\
    129  1.1  uch 	(((cr) >> HD64461_LCDLDHNCR_NHT_SHIFT) &			\
    130  1.1  uch 	HD64461_LCDLDHNCR_NHT_MASK)
    131  1.1  uch #define HD64461_LCDLDHNCR_NHT_SET(cr, val)				\
    132  1.1  uch 	((cr) | (((val) << HD64461_LCDLDHNCR_NHT_SHIFT) &		\
    133  1.1  uch 	(HD64461_LCDLDHNCR_NHT_MASK << HD64461_LCDLDHNCR_NHT_SHIFT)))
    134  1.1  uch 
    135  1.1  uch /* Start Position of Horizontal Register */
    136  1.1  uch #define HD64461_LCDLDHNSR_REG16			0xb0001016
    137  1.1  uch #define HD64461_LCDLDHNSR_HSW_SHIFT		8
    138  1.1  uch #define HD64461_LCDLDHNSR_HSW_MASK		0xf
    139  1.1  uch #define HD64461_LCDLDHNSR_HSW(cr)					\
    140  1.1  uch 	(((cr) >> HD64461_LCDLDHNSR_HSW_SHIFT) &			\
    141  1.1  uch 	HD64461_LCDLDHNSR_HSW_MASK)
    142  1.1  uch #define HD64461_LCDLDHNSR_HSW_SET(cr, val)				\
    143  1.1  uch 	((cr) | (((val) << HD64461_LCDLDHNSR_HSW_SHIFT) &		\
    144  1.1  uch 	(HD64461_LCDLDHNSR_HSW_MASK << HD64461_LCDLDHNSR_HSW_SHIFT)))
    145  1.1  uch #define HD64461_LCDLDHNSR_HSP_SHIFT		0
    146  1.1  uch #define HD64461_LCDLDHNSR_HSP_MASK		0xff
    147  1.1  uch #define HD64461_LCDLDHNSR_HSP(cr)					\
    148  1.1  uch 	(((cr) >> HD64461_LCDLDHNSR_HSP_SHIFT) &			\
    149  1.1  uch 	HD64461_LCDLDHNSR_HSP_MASK)
    150  1.1  uch #define HD64461_LCDLDHNSR_HSP_SET(cr, val)				\
    151  1.1  uch 	((cr) | (((val) << HD64461_LCDLDHNSR_HSP_SHIFT) &		\
    152  1.1  uch 	(HD64461_LCDLDHNSR_HSP_MASK << HD64461_LCDLDHNSR_HSP_SHIFT)))
    153  1.1  uch 
    154  1.1  uch /* Total Vertical Lines Register */
    155  1.1  uch #define HD64461_LCDLDVNTR_REG16			0xb0001018
    156  1.1  uch #define HD64461_LCDLDVNTR_VTL_SHIFT		0
    157  1.1  uch #define HD64461_LCDLDVNTR_VTL_MASK		0x3ff
    158  1.1  uch #define HD64461_LCDLDVNTR_VTL(cr)					\
    159  1.1  uch 	(((cr) >> HD64461_LCDLDVNTR_VTL_SHIFT) &			\
    160  1.1  uch 	HD64461_LCDLDVNTR_VTL_MASK)
    161  1.1  uch #define HD64461_LCDLDVNTR_VTL_SET(cr, val)				\
    162  1.1  uch 	((cr) | (((val) << HD64461_LCDLDVNTR_VTL_SHIFT) &		\
    163  1.1  uch 	(HD64461_LCDLDVNTR_VTL_MASK << HD64461_LCDLDVNTR_VTL_SHIFT)))
    164  1.1  uch 
    165  1.1  uch /* Display Vertical Lines Register */
    166  1.1  uch #define HD64461_LCDLDVNDR_REG16			0xb000101a
    167  1.1  uch #define HD64461_LCDLDVNDR_VDL_SHIFT		0
    168  1.1  uch #define HD64461_LCDLDVNDR_VDL_MASK		0x3ff
    169  1.1  uch #define HD64461_LCDLDVNDR_VDL(cr)					\
    170  1.1  uch 	(((cr) >> HD64461_LCDLDVNDR_VDL_SHIFT) &			\
    171  1.1  uch 	HD64461_LCDLDVNDR_VDL_MASK)
    172  1.1  uch #define HD64461_LCDLDVNDR_VDL_SET(cr, val)				\
    173  1.1  uch 	((cr) | (((val) << HD64461_LCDLDVNDR_VDL_SHIFT) &		\
    174  1.1  uch 	(HD64461_LCDLDVNDR_VDL_MASK << HD64461_LCDLDVNDR_VDL_SHIFT)))
    175  1.1  uch 
    176  1.1  uch /* Vertical Synchronization Position Register */
    177  1.1  uch #define HD64461_LCDLDVSPR_REG16			0xb000101c
    178  1.1  uch #define HD64461_LCDLDVSPR_VSP_SHIFT		0
    179  1.1  uch #define HD64461_LCDLDVSPR_VSP_MASK		0x3ff
    180  1.1  uch #define HD64461_LCDLDVSPR_VSP(cr)					\
    181  1.1  uch 	((cr) &	HD64461_LCDLDVSPR_VSP_MASK)
    182  1.1  uch #define HD64461_LCDLDVSPR_VSP_SET(cr, val)				\
    183  1.1  uch 	((cr) | ((val) & HD64461_LCDLDVSPR_VSP_MASK))
    184  1.1  uch 
    185  1.1  uch /*
    186  1.1  uch  * CRT Control Register
    187  1.1  uch  */
    188  1.1  uch /* CRTC Total Vertical Lines Register */
    189  1.1  uch #define HD64461_LCDCRTVTR_REG16			0xb0001020
    190  1.1  uch #define HD64461_LCDCRTVTR_SHIFT		0
    191  1.1  uch #define HD64461_LCDCRTVTR_MASK		0x3ff
    192  1.1  uch #define HD64461_LCDCRTVTR(cr)						\
    193  1.1  uch 	(((cr) >> HD64461_LCDCRTVTR_SHIFT) &				\
    194  1.1  uch 	HD64461_LCDCRTVTR_MASK)
    195  1.1  uch #define HD64461_LCDCRTVTR_SET(cr, val)					\
    196  1.1  uch 	((cr) | (((val) << HD64461_LCDCRTVTR_SHIFT) &			\
    197  1.1  uch 	(HD64461_LCDCRTVTR_MASK << HD64461_LCDCRTVTR_SHIFT)))
    198  1.1  uch 
    199  1.1  uch /* CRTC Vertical Retrace Start Register */
    200  1.1  uch #define HD64461_LCDCRTVRSR_REG16		0xb0001022
    201  1.1  uch #define HD64461_LCDCRTVRSR_SHIFT	0
    202  1.1  uch #define HD64461_LCDCRTVRSR_MASK		0x3ff
    203  1.1  uch #define HD64461_LCDCRTVRSR(cr)						\
    204  1.1  uch 	(((cr) >> HD64461_LCDCRTVRSR_SHIFT) &				\
    205  1.1  uch 	HD64461_LCDCRTVRSR_MASK)
    206  1.1  uch #define HD64461_LCDCRTVRSR_SET(cr, val)					\
    207  1.1  uch 	((cr) | (((val) << HD64461_LCDCRTVRSR_SHIFT) &			\
    208  1.1  uch 	(HD64461_LCDCRTVRSR_MASK << HD64461_LCDCRTVRSR_SHIFT)))
    209  1.1  uch 
    210  1.1  uch /* CRTC Vertical Retrace End Register */
    211  1.1  uch #define HD64461_LCDCRTVRER_REG16		0xb0001024
    212  1.1  uch #define HD64461_LCDCRTVRER_SHIFT	0
    213  1.1  uch #define HD64461_LCDCRTVRER_MASK		0xf
    214  1.1  uch #define HD64461_LCDCRTVRER(cr)						\
    215  1.1  uch 	(((cr) >> HD64461_LCDCRTVRER_SHIFT) & HD64461_LCDCRTVRER_MASK)
    216  1.1  uch 
    217  1.1  uch #define HD64461_LCDCRTVRER_SET(cr, val)					\
    218  1.1  uch 	((cr) | (((val) << HD64461_LCDCRTVRER_SHIFT) &			\
    219  1.1  uch 	(HD64461_LCDCRTVRER_MASK << HD64461_LCDCRTVRER_SHIFT)))
    220  1.1  uch 
    221  1.1  uch /*
    222  1.1  uch  * Palette Register
    223  1.1  uch  */
    224  1.1  uch /* Color Palette Write Address Register */
    225  1.1  uch #define HD64461_LCDCPTWAR_REG16			0xb0001030
    226  1.1  uch #define HD64461_LCDCPTWAR_SHIFT		8
    227  1.1  uch #define HD64461_LCDCPTWAR_MASK		0xff
    228  1.1  uch #define HD64461_LCDCPTWAR_SET(cr, val)					\
    229  1.1  uch 	((cr) | (((val) << HD64461_LCDCPTWAR_SHIFT) &			\
    230  1.1  uch 	(HD64461_LCDCPTWAR_MASK << HD64461_LCDCPTWAR_SHIFT)))
    231  1.1  uch 
    232  1.1  uch /* Color Palette Write Data Register */
    233  1.1  uch #define HD64461_LCDCPTWDR_REG16			0xb0001032
    234  1.1  uch #define HD64461_LCDCPTWDR_SHIFT		0
    235  1.1  uch #define HD64461_LCDCPTWDR_MASK		0x3f
    236  1.1  uch #define HD64461_LCDCPTWDR_SET(cr, val)					\
    237  1.1  uch 	((cr) | ((val) & HD64461_LCDCPTWDR_MASK))
    238  1.1  uch 
    239  1.1  uch /* Color Palette READ Address Register */
    240  1.1  uch #define HD64461_LCDCPTRAR_REG16			0xb0001034
    241  1.1  uch #define HD64461_LCDCPTRAR_SHIFT		8
    242  1.1  uch #define HD64461_LCDCPTRAR_MASK		0xff
    243  1.1  uch #define HD64461_LCDCPTRAR_SET(cr, val)					\
    244  1.1  uch 	((cr) | (((val) << HD64461_LCDCPTRAR_SHIFT) &			\
    245  1.1  uch 	(HD64461_LCDCPTRAR_MASK << HD64461_LCDCPTRAR_SHIFT)))
    246  1.1  uch 
    247  1.1  uch /* Color Palette READ Data Register */
    248  1.1  uch #define HD64461_LCDCPTRDR_REG16			0xb0001036
    249  1.1  uch #define HD64461_LCDCPTRDR_SHIFT		0
    250  1.1  uch #define HD64461_LCDCPTRDR_MASK		0x3f
    251  1.1  uch #define HD64461_LCDCPTRDR(cr)	((cr) & HD64461_LCDCPTRDR_MASK)
    252  1.1  uch 
    253  1.1  uch /*
    254  1.1  uch  * Acceleration Common Register
    255  1.1  uch  */
    256  1.1  uch /* Display Resolution Offset Register */
    257  1.1  uch #define HD64461_LCDGRDOR_REG16			0xb0001040
    258  1.1  uch #define HD64461_LCDGRDOR_SHIFT		0
    259  1.1  uch #define HD64461_LCDGRDOR_MASK		0x7ff
    260  1.1  uch #define HD64461_LCDGRDOR(cr)						\
    261  1.1  uch 	(((cr) >> HD64461_LCDGRDOR_SHIFT) &				\
    262  1.1  uch 	HD64461_LCDGRDOR_MASK)
    263  1.1  uch #define HD64461_LCDGRDOR_SET(cr, val)					\
    264  1.1  uch 	((cr) | (((val) << HD64461_LCDGRDOR_SHIFT) &			\
    265  1.1  uch 	(HD64461_LCDGRDOR_MASK << HD64461_LCDGRDOR_SHIFT)))
    266  1.1  uch 
    267  1.1  uch /* Solid Color Register */
    268  1.1  uch #define HD64461_LCDGRSCR_REG16			0xb0001042
    269  1.1  uch 
    270  1.1  uch /* Accelerator Configuration Register */
    271  1.1  uch #define HD64461_LCDGRCFGR_REG16			0xb0001044
    272  1.1  uch #define HD64461_LCDGRCFGR_ACCSTATUS		0x0010
    273  1.1  uch #define HD64461_LCDGRCFGR_ACCRESET		0x0008
    274  1.1  uch #define HD64461_LCDGRCFGR_ACCSTART_MASK		0x6
    275  1.1  uch #define HD64461_LCDGRCFGR_ACCSTART_BITBLT	0x0006
    276  1.1  uch #define HD64461_LCDGRCFGR_ACCSTART_LINE		0x0004
    277  1.1  uch #define HD64461_LCDGRCFGR_ACCSTART_OFF		0x0000
    278  1.1  uch #define HD64461_LCDGRCFGR_COLORDEPTH_8BPP	0x0001
    279  1.1  uch 
    280  1.1  uch /*
    281  1.1  uch  * Line Drawing Register
    282  1.1  uch  */
    283  1.1  uch /* Line Start Address Register */
    284  1.1  uch #define HD64461_LCDLNSARH_REG16			0xb0001046
    285  1.1  uch #define HD64461_LCDLNSARH_MASK		0x0007
    286  1.1  uch #define HD64461_LCDLNSARL_REG16			0xb0001048
    287  1.1  uch #define HD64461_LCDLNSARL_MASK		0xffff
    288  1.1  uch 
    289  1.1  uch /* Axis Pixel Length Register */
    290  1.1  uch #define HD64461_LCDLNAXLR_REG16			0xb000104a
    291  1.1  uch #define HD64461_LCDLNAXLR_MASK		0x07ff
    292  1.1  uch 
    293  1.1  uch /* Diagonal Regsiter */
    294  1.1  uch #define HD64461_LCDLNDGR_REG16			0xb000104c
    295  1.1  uch #define HD64461_LCDLNDGR_LNDGR_SIGN		0x8000
    296  1.1  uch #define HD64461_LCDLNDGR_LNDGR_MASK	0x07ff
    297  1.1  uch #define HD64461_LCDLNDGR_LNDGR_SET(cr, x)				\
    298  1.1  uch 	((cr) | ((x) & HD64461_LCDLNDGR_LNDGR_MASK))
    299  1.1  uch 
    300  1.1  uch /* Axial Register */
    301  1.1  uch #define HD64461_LCDLNAXR_REG16			0xb000104e
    302  1.1  uch #define HD64461_LCDLNAXR_LNAXR_MASK	0x0fff
    303  1.1  uch #define HD64461_LCDLNAXR_LNAXR_SET(cr, x)				\
    304  1.1  uch 	((cr) | ((x) & HD64461_LCDLNAXR_LNAXR_MASK))
    305  1.1  uch 
    306  1.1  uch /* Start Error Term Register */
    307  1.1  uch #define HD64461_LCDLNERTR_REG16			0xb0001050
    308  1.1  uch #define HD64461_LCDLNERTR_LNERTR_SIGN		0x8000
    309  1.1  uch #define HD64461_LCDLNERTR_LNERTR_MASK	0x07ff
    310  1.1  uch #define HD64461_LCDLNERTR_LNERTR_SET(cr, x)				\
    311  1.1  uch 	((cr) | ((x) & HD64461_LCDLNERTR_LNERTR_MASK))
    312  1.1  uch 
    313  1.1  uch /* Line Mode Register */
    314  1.1  uch #define HD64461_LCDLNMDR_REG16			0xb0001052
    315  1.1  uch #define HD64461_LCDLNMDR_MASK		0x0003
    316  1.1  uch /*
    317  1.1  uch  *    2  1
    318  1.1  uch  *  3      0
    319  1.1  uch  *  4      7
    320  1.1  uch  *    5  6
    321  1.1  uch  *
    322  1.1  uch  * 1 or 5 ... 3
    323  1.1  uch  * 2 or 6 ... 2
    324  1.1  uch  * 0 or 4 ... 1
    325  1.1  uch  * 3 or 7 ... 0
    326  1.1  uch  */
    327  1.1  uch 
    328  1.1  uch /*
    329  1.1  uch  * BitBLT Register
    330  1.1  uch  */
    331  1.1  uch /* Source Start Address Register (19 bit) */
    332  1.1  uch #define HD64461_LCDBBTSSARH_REG16		0xb0001054
    333  1.1  uch #define HD64461_LCDBBTSSARH_SHIFT	16
    334  1.1  uch #define HD64461_LCDBBTSSARH_MASK	0x0007
    335  1.1  uch #define HD64461_LCDBBTSSARL_REG16		0xb0001056
    336  1.1  uch #define HD64461_LCDBBTSSARL_MASK	0xffff
    337  1.1  uch #define HD64461_LCDBBTSSARH(x)						\
    338  1.1  uch 	(((x) >> HD64461_LCDBBTSSARH_SHIFT) & HD64461_LCDBBTSSARH_MASK)
    339  1.1  uch #define HD64461_LCDBBTSSARL(x)	((x) & HD64461_LCDBBTSSARL_MASK)
    340  1.1  uch 
    341  1.1  uch /* Destination Start Address Register (19 bit) */
    342  1.1  uch #define HD64461_LCDBBTDSARH_REG16		0xb0001058
    343  1.1  uch #define HD64461_LCDBBTDSARH_SHIFT	16
    344  1.1  uch #define HD64461_LCDBBTDSARH_MASK	0x0007
    345  1.1  uch #define HD64461_LCDBBTDSARL_REG16		0xb000105a
    346  1.1  uch #define HD64461_LCDBBTDSARL_MASK	0xffff
    347  1.1  uch #define HD64461_LCDBBTDSARH(x)						\
    348  1.1  uch 	(((x) >> HD64461_LCDBBTSSARH_SHIFT) & HD64461_LCDBBTSSARH_MASK)
    349  1.1  uch #define HD64461_LCDBBTDSARL(x)	((x) & HD64461_LCDBBTSSARL_MASK)
    350  1.1  uch 
    351  1.1  uch /* Destination Block Width Register */
    352  1.1  uch #define HD64461_LCDBBTDWR_REG16			0xb000105c
    353  1.1  uch #define HD64461_LCDBBTDWR_MASK		0x07ff
    354  1.1  uch 
    355  1.1  uch /* Destination Block Height Register */
    356  1.1  uch #define HD64461_LCDBBTDHR_REG16			0xb000105e
    357  1.1  uch #define HD64461_LCDBBTDHR_MASK		0x07ff
    358  1.1  uch 
    359  1.1  uch /* Pattern Start Address Register (19 bit) */
    360  1.1  uch #define HD64461_LCDBBTPARH_REG16		0xb0001060
    361  1.1  uch #define HD64461_LCDBBTPARH_MASK		0x0007
    362  1.1  uch #define HD64461_LCDBBTPARL_REG16		0xb0001062
    363  1.1  uch 
    364  1.1  uch /* Mask Start Address Register (19 bit) */
    365  1.1  uch #define HD64461_LCDBBTMARH_REG16		0xb0001064
    366  1.1  uch #define HD64461_LCDBBTMARH_MASK		0x0007
    367  1.1  uch #define HD64461_LCDBBTMARL_REG16		0xb0001066
    368  1.1  uch 
    369  1.1  uch /* ROP Register */
    370  1.1  uch #define HD64461_LCDBBTROPR_REG16		0xb0001068
    371  1.1  uch 
    372  1.1  uch /* BitBLT Mode Register */
    373  1.1  uch #define HD64461_LCDBBTMDR_REG16			0xb000106a
    374  1.1  uch #define HD64461_LCDBBTMDR_MASKENABLE		0x0020
    375  1.1  uch #define HD64461_LCDBBTMDR_PATSELECT_SOLIDCOLOR	0x0010
    376  1.1  uch #define HD64461_LCDBBTMDR_SHIFT		2
    377  1.1  uch #define HD64461_LCDBBTMDR_MASK		0x3
    378  1.1  uch #define HD64461_LCDBBTMDR(cr)						\
    379  1.1  uch 	(((cr) >> HD64461_LCDBBTMDR_SHIFT) & HD64461_LCDBBTMDR_MASK)
    380  1.1  uch 
    381  1.1  uch #define HD64461_LCDBBTMDR_SET(cr, val)					\
    382  1.1  uch 	((cr) | (((val) << HD64461_LCDBBTMDR_SHIFT) &			\
    383  1.1  uch 	(HD64461_LCDBBTMDR_MASK << HD64461_LCDBBTMDR_SHIFT)))
    384  1.1  uch #define HD64461_LCDBBTMDR_ON_SCREEN_TO_ON_SCREEN	0
    385  1.1  uch #define HD64461_LCDBBTMDR_ON_SCREEN_TO_OFF_SCREEN	1
    386  1.1  uch #define HD64461_LCDBBTMDR_OFF_SCREEN_TO_ON_SCREEN	3
    387  1.1  uch 
    388  1.1  uch #define HD64461_LCDBBTMDR_SCANDRCT	0x0001
    389  1.1  uch #define HD64461_LCDBBTMDR_SCANDRCT_RL_BT	0x1
    390  1.1  uch #define HD64461_LCDBBTMDR_SCANDRCT_LR_TB	0x0
    391  1.1  uch 
    392  1.1  uch /*
    393  1.1  uch  * BitBLT Function
    394  1.1  uch  */
    395  1.1  uch #define HD64461_LCDC_BITBLT_SRCAND		0x0088
    396  1.1  uch #define HD64461_LCDC_BITBLT_SRCCOPY		0x00cc
    397  1.1  uch #define HD64461_LCDC_BITBLT_SRCINVERT		0x0066
    398  1.1  uch #define HD64461_LCDC_BITBLT_SRCPAINT		0x00ee
    399  1.1  uch #define HD64461_LCDC_BITBLT_PATCOPY		0x00f0
    400  1.1  uch #define HD64461_LCDC_BITBLT_PATINVERT		0x005a
    401  1.1  uch #define HD64461_LCDC_BITBLT_DSTINVERT		0x0055
    402  1.1  uch #define HD64461_LCDC_BITBLT_BLACKNESS		0x0000
    403  1.1  uch #define HD64461_LCDC_BITBLT_WHITENESS		0x00ff
    404  1.1  uch #define HD64461_LCDC_BITBLT_MASKEDSRCCOPY	0xccaa
    405