1
2#ifndef __YENTA_H
3#define __YENTA_H
4
5#include <asm/io.h>
6
7#define CB_SOCKET_EVENT 0x00
8#define CB_CSTSEVENT 0x00000001
9#define CB_CD1EVENT 0x00000002
10#define CB_CD2EVENT 0x00000004
11#define CB_PWREVENT 0x00000008
12
13#define CB_SOCKET_MASK 0x04
14#define CB_CSTSMASK 0x00000001
15#define CB_CDMASK 0x00000006
16#define CB_PWRMASK 0x00000008
17
18#define CB_SOCKET_STATE 0x08
19#define CB_CARDSTS 0x00000001
20#define CB_CDETECT1 0x00000002
21#define CB_CDETECT2 0x00000004
22#define CB_PWRCYCLE 0x00000008
23#define CB_16BITCARD 0x00000010
24#define CB_CBCARD 0x00000020
25#define CB_IREQCINT 0x00000040
26#define CB_NOTACARD 0x00000080
27#define CB_DATALOST 0x00000100
28#define CB_BADVCCREQ 0x00000200
29#define CB_5VCARD 0x00000400
30#define CB_3VCARD 0x00000800
31#define CB_XVCARD 0x00001000
32#define CB_YVCARD 0x00002000
33#define CB_5VSOCKET 0x10000000
34#define CB_3VSOCKET 0x20000000
35#define CB_XVSOCKET 0x40000000
36#define CB_YVSOCKET 0x80000000
37
38#define CB_SOCKET_FORCE 0x0C
39#define CB_FCARDSTS 0x00000001
40#define CB_FCDETECT1 0x00000002
41#define CB_FCDETECT2 0x00000004
42#define CB_FPWRCYCLE 0x00000008
43#define CB_F16BITCARD 0x00000010
44#define CB_FCBCARD 0x00000020
45#define CB_FNOTACARD 0x00000080
46#define CB_FDATALOST 0x00000100
47#define CB_FBADVCCREQ 0x00000200
48#define CB_F5VCARD 0x00000400
49#define CB_F3VCARD 0x00000800
50#define CB_FXVCARD 0x00001000
51#define CB_FYVCARD 0x00002000
52#define CB_CVSTEST 0x00004000
53
54#define CB_SOCKET_CONTROL 0x10
55#define CB_SC_VPP_MASK 0x00000007
56#define CB_SC_VPP_OFF 0x00000000
57#define CB_SC_VPP_12V 0x00000001
58#define CB_SC_VPP_5V 0x00000002
59#define CB_SC_VPP_3V 0x00000003
60#define CB_SC_VPP_XV 0x00000004
61#define CB_SC_VPP_YV 0x00000005
62#define CB_SC_VCC_MASK 0x00000070
63#define CB_SC_VCC_OFF 0x00000000
64#define CB_SC_VCC_5V 0x00000020
65#define CB_SC_VCC_3V 0x00000030
66#define CB_SC_VCC_XV 0x00000040
67#define CB_SC_VCC_YV 0x00000050
68#define CB_SC_CCLK_STOP 0x00000080
69
70#define CB_SOCKET_POWER 0x20
71#define CB_SKTACCES 0x02000000
72#define CB_SKTMODE 0x01000000
73#define CB_CLKCTRLEN 0x00010000
74#define CB_CLKCTRL 0x00000001
75
76
77
78
79#define CB_BRIDGE_BASE(m) (0x1c + 8*(m))
80#define CB_BRIDGE_LIMIT(m) (0x20 + 8*(m))
81#define CB_BRIDGE_CONTROL 0x3e
82#define CB_BRIDGE_CPERREN 0x00000001
83#define CB_BRIDGE_CSERREN 0x00000002
84#define CB_BRIDGE_ISAEN 0x00000004
85#define CB_BRIDGE_VGAEN 0x00000008
86#define CB_BRIDGE_MABTMODE 0x00000020
87#define CB_BRIDGE_CRST 0x00000040
88#define CB_BRIDGE_INTR 0x00000080
89#define CB_BRIDGE_PREFETCH0 0x00000100
90#define CB_BRIDGE_PREFETCH1 0x00000200
91#define CB_BRIDGE_POSTEN 0x00000400
92#define CB_LEGACY_MODE_BASE 0x44
93
94
95
96
97#define CB_MEM_PAGE(map) (0x40 + (map))
98
99
100
101#define YENTA_16BIT_POWER_EXCA 0x00000001
102#define YENTA_16BIT_POWER_DF 0x00000002
103
104
105struct yenta_socket;
106
107struct cardbus_type {
108 int (*override)(struct yenta_socket *);
109 void (*save_state)(struct yenta_socket *);
110 void (*restore_state)(struct yenta_socket *);
111 int (*sock_init)(struct yenta_socket *);
112};
113
114struct yenta_socket {
115 struct pci_dev *dev;
116 int cb_irq, io_irq;
117 void __iomem *base;
118 struct timer_list poll_timer;
119
120 struct pcmcia_socket socket;
121 struct cardbus_type *type;
122
123 u32 flags;
124
125
126 unsigned int probe_status;
127
128
129 unsigned int private[8];
130
131
132 u32 saved_state[2];
133};
134
135
136#endif
137