3 * bcm47xx pcmcia driver
5 * Copyright 2004, Broadcom Corporation
8 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
9 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
10 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
11 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
13 * Based on sa1100.h and include/asm-arm/arch-sa1100/pcmica.h
14 * from www.handhelds.org,
15 * and au1000_generic.c from oss.sgi.com.
20 #if !defined(_BCM4710PCMCIA_H)
21 #define _BCM4710PCMCIA_H
23 #include <pcmcia/cs_types.h>
24 #include <pcmcia/ss.h>
25 #include <pcmcia/bulkmem.h>
26 #include <pcmcia/cistpl.h>
27 #include "cs_internal.h"
30 /* The 47xx can only support one socket */
31 #define BCM47XX_PCMCIA_MAX_SOCK 1
33 /* In the bcm947xx gpio's are used for some pcmcia functions */
34 #define BCM47XX_PCMCIA_WP 0x01 /* Bit 0 is WP input */
35 #define BCM47XX_PCMCIA_STSCHG 0x20 /* Bit 5 is STSCHG input/interrupt */
36 #define BCM47XX_PCMCIA_RESET 0x80 /* Bit 7 is RESET */
38 #define BCM47XX_PCMCIA_IRQ 2
40 /* The socket driver actually works nicely in interrupt-driven form,
41 * so the (relatively infrequent) polling is "just to be sure."
43 #define BCM47XX_PCMCIA_POLL_PERIOD (2 * HZ)
45 #define BCM47XX_PCMCIA_IO_SPEED (255)
46 #define BCM47XX_PCMCIA_MEM_SPEED (300)
60 struct pcmcia_configure
{
69 struct pcmcia_irq_info
{
74 /* This structure encapsulates per-socket state which we might need to
75 * use when responding to a Card Services query of some kind.
77 struct bcm47xx_pcmcia_socket
{
78 socket_state_t cs_state
;
79 struct pcmcia_state k_state
;
81 void (*handler
)(void *, unsigned int);
83 pccard_io_map io_map
[MAX_IO_WIN
];
84 pccard_mem_map mem_map
[MAX_WIN
];
85 ioaddr_t virt_io
, phys_attr
, phys_mem
;
86 unsigned short speed_io
, speed_attr
, speed_mem
;
90 void (*handler
)(int irq
, void *dev
, struct pt_regs
*regs
);
93 struct pcmcia_low_level
{
94 int (*init
)(struct pcmcia_init
*);
95 int (*shutdown
)(void);
96 int (*socket_state
)(unsigned sock
, struct pcmcia_state
*);
97 int (*get_irq_info
)(struct pcmcia_irq_info
*);
98 int (*configure_socket
)(const struct pcmcia_configure
*);
101 extern struct pcmcia_low_level bcm47xx_pcmcia_ops
;
103 /* I/O pins replacing memory pins
104 * (PCMCIA System Architecture, 2nd ed., by Don Anderson, p.75)
106 * These signals change meaning when going from memory-only to
107 * memory-or-I/O interface:
109 #define iostschg bvd1
114 * Declaration for implementation specific low_level operations.
116 extern struct pcmcia_low_level bcm4710_pcmcia_ops
;
118 #endif /* !defined(_BCM4710PCMCIA_H) */