it8368reg.h revision 1.4 1 1.4 uch /* $NetBSD: it8368reg.h,v 1.4 2001/09/15 12:47:05 uch Exp $ */
2 1.1 uch
3 1.4 uch /*-
4 1.4 uch * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
5 1.1 uch * All rights reserved.
6 1.1 uch *
7 1.4 uch * This code is derived from software contributed to The NetBSD Foundation
8 1.4 uch * by UCHIYAMA Yasushi.
9 1.4 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.4 uch * 2. Redistributions in binary form must reproduce the above copyright
16 1.4 uch * notice, this list of conditions and the following disclaimer in the
17 1.4 uch * documentation and/or other materials provided with the distribution.
18 1.4 uch * 3. All advertising materials mentioning features or use of this software
19 1.4 uch * must display the following acknowledgement:
20 1.4 uch * This product includes software developed by the NetBSD
21 1.4 uch * Foundation, Inc. and its contributors.
22 1.4 uch * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.4 uch * contributors may be used to endorse or promote products derived
24 1.4 uch * from this software without specific prior written permission.
25 1.1 uch *
26 1.4 uch * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.4 uch * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.4 uch * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.4 uch * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.4 uch * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.4 uch * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.4 uch * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.4 uch * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.4 uch * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.4 uch * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.4 uch * POSSIBILITY OF SUCH DAMAGE.
37 1.1 uch */
38 1.1 uch
39 1.1 uch /*
40 1.1 uch * ITE IT8368E PCMCIA/GPIO Buffer Chip
41 1.1 uch * http://www.ite.com/tw/mobile/it8368v07.pdf
42 1.1 uch */
43 1.1 uch #define IT8368_GPIODATAOUT_REG 0x00
44 1.1 uch #define IT8368_MFIODATAOUT_REG 0x02
45 1.1 uch #define IT8368_GPIODIR_REG 0x04
46 1.1 uch #define IT8368_MFIODIR_REG 0x06
47 1.1 uch #define IT8368_MFIOSEL_REG 0x0a
48 1.1 uch #define IT8368_GPIODATAIN_REG 0x0c
49 1.1 uch #define IT8368_MFIODATAIN_REG 0x0e
50 1.1 uch #define IT8368_GPIOPOSINTEN_REG 0x10
51 1.1 uch #define IT8368_MFIOPOSINTEN_REG 0x12
52 1.1 uch #define IT8368_GPIONEGINTEN_REG 0x14
53 1.1 uch #define IT8368_MFIONEGINTEN_REG 0x16
54 1.1 uch #define IT8368_GPIOPOSINTSTAT_REG 0x18
55 1.1 uch #define IT8368_MFIOPOSINTSTAT_REG 0x1a
56 1.1 uch #define IT8368_GPIONEGINTSTAT_REG 0x1c
57 1.1 uch #define IT8368_MFIONEGINTSTAT_REG 0x1e
58 1.1 uch #define IT8368_CTRL_REG 0x20
59 1.2 uch
60 1.3 uch #define IT8368_GPIO_MAX 12
61 1.3 uch #define IT8368_MFIO_MAX 10
62 1.1 uch
63 1.1 uch #define IT8368_GPIODATAOUT_MASK 0x1fff
64 1.1 uch #define IT8368_MFIODATAOUT_MASK 0x07ff
65 1.1 uch #define IT8368_GPIODIR_MASK 0x1fff
66 1.1 uch #define IT8368_MFIODIR_MASK 0x07ff
67 1.1 uch
68 1.1 uch #define IT8368_MFIOSEL_VGAEN 0x0800
69 1.1 uch #define IT8368_MFIOSEL_MASK 0x07ff
70 1.1 uch #define IT8368_GPIODATAIN_MASK 0x1fff
71 1.1 uch #define IT8368_MFIODATAIN_MASK 0x07ff
72 1.1 uch #define IT8368_GPIOPOSINTEN_MASK 0x1fff
73 1.1 uch #define IT8368_MFIOPOSINTEN_MASK 0x07ff
74 1.1 uch #define IT8368_GPIONEGINTEN_MASK 0x1fff
75 1.1 uch #define IT8368_MFIONEGINTEN_MASK 0x07ff
76 1.1 uch #define IT8368_GPIOPOSINTSTAT_MASK 0x1fff
77 1.1 uch #define IT8368_MFIOPOSINTSTAT_MASK 0x07ff
78 1.1 uch #define IT8368_GPIONEGINTSTAT_MASK 0x1fff
79 1.1 uch #define IT8368_MFIONEGINTSTAT_MASK 0x07ff
80 1.1 uch
81 1.1 uch
82 1.1 uch #define IT8368_CTRL_FIXATTRIO 0x8000
83 1.1 uch #define IT8368_FIXATTR_OFFSET 0x02000000
84 1.1 uch #define IT8368_FIXIO_OFFSET 0x0
85 1.1 uch #define IT8368_FIXIOATTR_SIZE 0x02000000
86 1.1 uch
87 1.1 uch #define IT8368_CTRL_ADDRSEL 0x0010
88 1.1 uch #define IT8368_CTRL_BYTESWAP 0x0008
89 1.1 uch #define IT8368_CTRL_CARDEN 0x0004
90 1.1 uch #define IT8368_CTRL_GLOBALEN 0x0002
91 1.1 uch #define IT8368_CTRL_INTTRIEN 0x0001
92 1.1 uch
93 1.1 uch #define IT8368_PIN_CRDSW 0x1000
94 1.1 uch #define IT8368_PIN_CRDDET2 0x0800
95 1.1 uch #define IT8368_PIN_CRDDET1 0x0400
96 1.1 uch #define IT8368_PIN_CRDSENSE2 0x0200
97 1.1 uch #define IT8368_PIN_CRDSENSE1 0x0100
98 1.1 uch #define IT8368_PIN_CRDVCCON1 0x0080
99 1.1 uch #define IT8368_PIN_CRDVCCON0 0x0040
100 1.1 uch #define IT8368_PIN_CRDVPPON1 0x0020
101 1.1 uch #define IT8368_PIN_CRDVPPON0 0x0010
102 1.1 uch #define IT8368_PIN_BCRDWP 0x0008
103 1.1 uch #define IT8368_PIN_BCRDRDY 0x0004
104 1.1 uch #define IT8368_PIN_BCRBVD2 0x0002
105 1.1 uch #define IT8368_PIN_BCRDRST 0x0001
106 1.1 uch
107 1.1 uch #define IT8368_PIN_CRDVCCMASK 0x00c0
108 1.1 uch #define IT8368_PIN_CRDVPPMASK 0x0030
109 1.1 uch #define IT8368_PIN_CRDVCC_0V 0x0000
110 1.1 uch #define IT8368_PIN_CRDVCC_3V IT8368_PIN_CRDVCCON0
111 1.1 uch #define IT8368_PIN_CRDVCC_5V IT8368_PIN_CRDVCCON1
112 1.1 uch #define IT8368_PIN_CRDVPP_0V 0x0000
113 1.1 uch #define IT8368_PIN_CRDVPP_CRDVCC IT8368_PIN_CRDVPPON0
114 1.1 uch #define IT8368_PIN_CRDVCC_12V IT8368_PIN_CRDVPPON1
115 1.3 uch #define IT8368_PIN_CRDVCC_HIZ (IT8368_PIN_CRDVPPON0 | \
116 1.3 uch IT8368_PIN_CRDVPPON1)
117