ipaq_lcdreg.h revision 1.1.8.2 1 1.1.8.2 ichiro /* $NetBSD: ipaq_lcdreg.h,v 1.1.8.2 2001/07/10 18:09:34 ichiro Exp $ */
2 1.1.8.2 ichiro
3 1.1.8.2 ichiro /*-
4 1.1.8.2 ichiro * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 1.1.8.2 ichiro * All rights reserved.
6 1.1.8.2 ichiro *
7 1.1.8.2 ichiro * This code is derived from software contributed to The NetBSD Foundation
8 1.1.8.2 ichiro * by Ichiro FUKUHARA(ichiro (at) ichiro.org).
9 1.1.8.2 ichiro *
10 1.1.8.2 ichiro * Redistribution and use in source and binary forms, with or without
11 1.1.8.2 ichiro * modification, are permitted provided that the following conditions
12 1.1.8.2 ichiro * are met:
13 1.1.8.2 ichiro * 1. Redistributions of source code must retain the above copyright
14 1.1.8.2 ichiro * notice, this list of conditions and the following disclaimer.
15 1.1.8.2 ichiro * 2. Redistributions in binary form must reproduce the above copyright
16 1.1.8.2 ichiro * notice, this list of conditions and the following disclaimer in the
17 1.1.8.2 ichiro * documentation and/or other materials provided with the distribution.
18 1.1.8.2 ichiro * 3. All advertising materials mentioning features or use of this software
19 1.1.8.2 ichiro * must display the following acknowledgement:
20 1.1.8.2 ichiro * This product includes software developed by the NetBSD
21 1.1.8.2 ichiro * Foundation, Inc. and its contributors.
22 1.1.8.2 ichiro * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.1.8.2 ichiro * contributors may be used to endorse or promote products derived
24 1.1.8.2 ichiro * from this software without specific prior written permission.
25 1.1.8.2 ichiro *
26 1.1.8.2 ichiro * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.1.8.2 ichiro * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.1.8.2 ichiro * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.1.8.2 ichiro * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.1.8.2 ichiro * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.1.8.2 ichiro * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.1.8.2 ichiro * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.1.8.2 ichiro * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.1.8.2 ichiro * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.1.8.2 ichiro * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.1.8.2 ichiro * POSSIBILITY OF SUCH DAMAGE.
37 1.1.8.2 ichiro */
38 1.1.8.2 ichiro
39 1.1.8.2 ichiro /* size of I/O space */
40 1.1.8.2 ichiro #define SALCD_NPORTS 11
41 1.1.8.2 ichiro
42 1.1.8.2 ichiro /* LCD framebuffer offset */
43 1.1.8.2 ichiro #define SALCD_12_16_OFFSET 0x20 /* 12BIT - 16BIT */
44 1.1.8.2 ichiro #define SALCD_8BIT_OFFSET 0x200 /* 8BIT */
45 1.1.8.2 ichiro
46 1.1.8.2 ichiro /* LCD Control Register 0 */
47 1.1.8.2 ichiro #define SALCD_CR0 0
48 1.1.8.2 ichiro #define CR0_LEN (1<<0) /* LCD enable */
49 1.1.8.2 ichiro #define CR0_CMS (1<<1) /* color op enable */
50 1.1.8.2 ichiro #define CR0_SDS (1<<2) /* Single display or Double display */
51 1.1.8.2 ichiro #define CR0_LDM (1<<3) /* LDD status bit ignore(dont intrrupt) */
52 1.1.8.2 ichiro #define CR0_BAM (1<<4) /* Base address update does not
53 1.1.8.2 ichiro generate an intrrupt */
54 1.1.8.2 ichiro #define CR0_ERM (1<<5) /* Bus error generate an intrrupt */
55 1.1.8.2 ichiro #define CR0_PAS (1<<7) /* Passive / Active and TFT-LCD enable */
56 1.1.8.2 ichiro #define CR0_BLE (1<<8) /* endian select 0=little */
57 1.1.8.2 ichiro #define CR0_DPD (1<<9)
58 1.1.8.2 ichiro
59 1.1.8.2 ichiro /* LCD Control Register 1 */
60 1.1.8.2 ichiro #define SALCD_CR1 0x20
61 1.1.8.2 ichiro #define CR1_PPL(pixel) ((pixel) - 16) /* PPL ; Pixel per line
62 1.1.8.2 ichiro - 16 */
63 1.1.8.2 ichiro #define CR1_HSW(pixel) (((pixel) - 1) << 10) /* HSW ; */
64 1.1.8.2 ichiro #define CR1_ELW(pixel) (((pixel) - 1) << 16) /* ELW ; */
65 1.1.8.2 ichiro #define CR1_BLW(pixel) (((pixel) - 1) << 24) /* BLW ; */
66 1.1.8.2 ichiro
67 1.1.8.2 ichiro /* LCD Control Register 2 */
68 1.1.8.2 ichiro #define SALCD_CR2 0x24
69 1.1.8.2 ichiro #define CR2_LPP(line) ((line) - 1) /* LPP ; Lines per panel */
70 1.1.8.2 ichiro #define CR2_VSW(line) (((line) -1) << 10) /* VSW ; */
71 1.1.8.2 ichiro #define CR2_EFW(line) ((line) << 16) /* EFW ; */
72 1.1.8.2 ichiro #define CR2_BFW(line) ((line) << 24) /* BFW ; */
73 1.1.8.2 ichiro
74 1.1.8.2 ichiro /* LCD Control Register 3 */
75 1.1.8.2 ichiro #define SALCD_CR3 0x28
76 1.1.8.2 ichiro #define CR3_PCD(div) (((div) - 4)/2) /* PCD ; Pixel clock divisor */
77 1.1.8.2 ichiro #define CR3_ACB(div) (((div) - 2)/2) /* ACB ; */
78 1.1.8.2 ichiro #define CR3_API(div) ((div) << 16) /* API ; AC Bias */
79 1.1.8.2 ichiro #define CR3_VSPL (0 << 20) /* VSP ; Vsync = Low */
80 1.1.8.2 ichiro #define CR3_VSPH (1 << 20) /* VSP ; Vsync = High */
81 1.1.8.2 ichiro #define CR3_HSPL (0 << 21) /* HSP ; Hsync = Low */
82 1.1.8.2 ichiro #define CR3_HSPH (1 << 21) /* HSP ; Hsync = High */
83 1.1.8.2 ichiro #define CR3_PCP_RE (0 << 22) /* PCP ; Pixel clock Rising-Edge */
84 1.1.8.2 ichiro #define CR3_PCP_FE (1 << 22) /* PCP ; Pixel clock Falling-Edge */
85 1.1.8.2 ichiro #define CR3_OEPH (0 << 23) /* OEP ; Output Enable active High */
86 1.1.8.2 ichiro #define CR3_OEPL (0 << 23) /* OEP ; Output Enable active Low */
87 1.1.8.2 ichiro
88 1.1.8.2 ichiro
89 1.1.8.2 ichiro /* DMA Channel 1 Base Address Register */
90 1.1.8.2 ichiro #define SALCD_BA1 0x10
91 1.1.8.2 ichiro
92 1.1.8.2 ichiro /* DMA Channel 1 Current Address Register */
93 1.1.8.2 ichiro #define SALCD_CA1 0x14
94 1.1.8.2 ichiro
95 1.1.8.2 ichiro /* DMA Channel 1 Base Address Register */
96 1.1.8.2 ichiro #define SALCD_BA2 0x18
97 1.1.8.2 ichiro
98 1.1.8.2 ichiro /* DMA Channel 1 Current Address Register */
99 1.1.8.2 ichiro #define SALCD_CA2 0x1C
100 1.1.8.2 ichiro
101 1.1.8.2 ichiro /* LCD Status Register */
102 1.1.8.2 ichiro #define SALCD_SR 0x04
103 1.1.8.2 ichiro #define SR_LDD (1<<0)
104 1.1.8.2 ichiro #define SR_BAU (1<<1)
105 1.1.8.2 ichiro #define SR_BER (1<<2)
106 1.1.8.2 ichiro #define SR_ABC (1<<3)
107 1.1.8.2 ichiro #define SR_IOL (1<<4)
108 1.1.8.2 ichiro #define SR_IUL (1<<5)
109 1.1.8.2 ichiro #define SR_IOU (1<<6)
110 1.1.8.2 ichiro #define SR_IUU (1<<7)
111 1.1.8.2 ichiro #define SR_OOL (1<<8)
112 1.1.8.2 ichiro #define SR_OUL (1<<9)
113 1.1.8.2 ichiro #define SR_OOU (1<<10)
114 1.1.8.2 ichiro #define SR_OUU (1<<11)
115 1.1.8.2 ichiro
116 1.1.8.2 ichiro /* Products Specification */
117 1.1.8.2 ichiro #define IPAQ_LCCR0 CR0_LEN | CR0_PAS
118 1.1.8.2 ichiro #define IPAQ_LCCR1 CR1_PPL(320) | CR1_HSW(3) | \
119 1.1.8.2 ichiro CR1_ELW(17) | CR1_BLW(12)
120 1.1.8.2 ichiro #define IPAQ_LCCR2 CR2_LPP(240) | CR2_VSW(3) | \
121 1.1.8.2 ichiro CR2_EFW(1) | CR2_BFW(10)
122 1.1.8.2 ichiro #define IPAQ_LCCR3 CR3_PCD(36) | CR3_ACB(2) | \
123 1.1.8.2 ichiro CR3_VSPL | CR3_HSPL | CR3_API(0)
124 1.1.8.2 ichiro
125 1.1.8.2 ichiro /* end of ipaq_lcdreg.h */
126