pcmcia: fix Alchemy warnings
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / pcmcia / au1000_generic.h
blobc62437df175e4bf2f384c92e7b5262d7663e9e17
1 /*
2 * Alchemy Semi Au1000 pcmcia driver include file
4 * Copyright 2001 MontaVista Software Inc.
5 * Author: MontaVista Software, Inc.
6 * ppopov@mvista.com or source@mvista.com
8 * This program is free software; you can distribute it and/or modify it
9 * under the terms of the GNU General Public License (Version 2) as
10 * published by the Free Software Foundation.
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 #ifndef __ASM_AU1000_PCMCIA_H
22 #define __ASM_AU1000_PCMCIA_H
24 /* include the world */
26 #include <pcmcia/cs_types.h>
27 #include <pcmcia/cs.h>
28 #include <pcmcia/ss.h>
29 #include <pcmcia/bulkmem.h>
30 #include <pcmcia/cistpl.h>
31 #include "cs_internal.h"
33 #define AU1000_PCMCIA_POLL_PERIOD (2*HZ)
34 #define AU1000_PCMCIA_IO_SPEED (255)
35 #define AU1000_PCMCIA_MEM_SPEED (300)
37 #define AU1X_SOCK0_IO 0xF00000000ULL
38 #define AU1X_SOCK0_PHYS_ATTR 0xF40000000ULL
39 #define AU1X_SOCK0_PHYS_MEM 0xF80000000ULL
40 /* pseudo 32 bit phys addresses, which get fixed up to the
41 * real 36 bit address in fixup_bigphys_addr() */
42 #define AU1X_SOCK0_PSEUDO_PHYS_ATTR 0xF4000000
43 #define AU1X_SOCK0_PSEUDO_PHYS_MEM 0xF8000000
45 /* pcmcia socket 1 needs external glue logic so the memory map
46 * differs from board to board.
48 #if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_PB1100) || \
49 defined(CONFIG_MIPS_PB1500) || defined(CONFIG_MIPS_PB1550) || \
50 defined(CONFIG_MIPS_PB1200)
51 #define AU1X_SOCK1_IO 0xF08000000ULL
52 #define AU1X_SOCK1_PHYS_ATTR 0xF48000000ULL
53 #define AU1X_SOCK1_PHYS_MEM 0xF88000000ULL
54 #define AU1X_SOCK1_PSEUDO_PHYS_ATTR 0xF4800000
55 #define AU1X_SOCK1_PSEUDO_PHYS_MEM 0xF8800000
56 #elif defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100) || \
57 defined(CONFIG_MIPS_DB1500) || defined(CONFIG_MIPS_DB1550) || \
58 defined(CONFIG_MIPS_DB1200)
59 #define AU1X_SOCK1_IO 0xF04000000ULL
60 #define AU1X_SOCK1_PHYS_ATTR 0xF44000000ULL
61 #define AU1X_SOCK1_PHYS_MEM 0xF84000000ULL
62 #define AU1X_SOCK1_PSEUDO_PHYS_ATTR 0xF4400000
63 #define AU1X_SOCK1_PSEUDO_PHYS_MEM 0xF8400000
64 #endif
66 struct pcmcia_state {
67 unsigned detect: 1,
68 ready: 1,
69 wrprot: 1,
70 bvd1: 1,
71 bvd2: 1,
72 vs_3v: 1,
73 vs_Xv: 1;
76 struct pcmcia_configure {
77 unsigned sock: 8,
78 vcc: 8,
79 vpp: 8,
80 output: 1,
81 speaker: 1,
82 reset: 1;
85 struct pcmcia_irqs {
86 int sock;
87 int irq;
88 const char *str;
92 struct au1000_pcmcia_socket {
93 struct pcmcia_socket socket;
96 * Info from low level handler
98 struct device *dev;
99 unsigned int nr;
100 unsigned int irq;
103 * Core PCMCIA state
105 struct pcmcia_low_level *ops;
107 unsigned int status;
108 socket_state_t cs_state;
110 unsigned short spd_io[MAX_IO_WIN];
111 unsigned short spd_mem[MAX_WIN];
112 unsigned short spd_attr[MAX_WIN];
114 struct resource res_skt;
115 struct resource res_io;
116 struct resource res_mem;
117 struct resource res_attr;
119 void * virt_io;
120 ioaddr_t phys_io;
121 unsigned int phys_attr;
122 unsigned int phys_mem;
123 unsigned short speed_io, speed_attr, speed_mem;
125 unsigned int irq_state;
127 struct timer_list poll_timer;
130 struct pcmcia_low_level {
131 struct module *owner;
133 int (*hw_init)(struct au1000_pcmcia_socket *);
134 void (*hw_shutdown)(struct au1000_pcmcia_socket *);
136 void (*socket_state)(struct au1000_pcmcia_socket *, struct pcmcia_state *);
137 int (*configure_socket)(struct au1000_pcmcia_socket *, struct socket_state_t *);
140 * Enable card status IRQs on (re-)initialisation. This can
141 * be called at initialisation, power management event, or
142 * pcmcia event.
144 void (*socket_init)(struct au1000_pcmcia_socket *);
147 * Disable card status IRQs and PCMCIA bus on suspend.
149 void (*socket_suspend)(struct au1000_pcmcia_socket *);
152 extern int au1x_board_init(struct device *dev);
154 #endif /* __ASM_AU1000_PCMCIA_H */