1 /* SPDX-License-Identifier: GPL-2.0 */
3 * linux/drivers/pcmcia/soc_common.h
5 * Copyright (C) 2000 John G Dorsey <john+@cs.cmu.edu>
7 * This file contains definitions for the PCMCIA support code common to
8 * integrated SOCs like the SA-11x0 and PXA2xx microprocessors.
10 #ifndef _ASM_ARCH_PCMCIA
11 #define _ASM_ARCH_PCMCIA
13 /* include the world */
14 #include <linux/clk.h>
15 #include <linux/cpufreq.h>
16 #include <pcmcia/cistpl.h>
17 #include <pcmcia/soc_common.h>
21 struct pcmcia_low_level;
26 struct soc_pcmcia_socket skt[];
29 struct soc_pcmcia_timing {
35 extern void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *, struct soc_pcmcia_timing *);
37 void soc_pcmcia_init_one(struct soc_pcmcia_socket *skt,
38 const struct pcmcia_low_level *ops, struct device *dev);
39 void soc_pcmcia_remove_one(struct soc_pcmcia_socket *skt);
40 int soc_pcmcia_add_one(struct soc_pcmcia_socket *skt);
41 int soc_pcmcia_request_gpiods(struct soc_pcmcia_socket *skt);
43 void soc_common_cf_socket_state(struct soc_pcmcia_socket *skt,
44 struct pcmcia_state *state);
46 int soc_pcmcia_regulator_set(struct soc_pcmcia_socket *skt,
47 struct soc_pcmcia_regulator *r, int v);
49 #ifdef CONFIG_PCMCIA_DEBUG
51 extern void soc_pcmcia_debug(struct soc_pcmcia_socket *skt, const char *func,
52 int lvl, const char *fmt, ...);
54 #define debug(skt, lvl, fmt, arg...) \
55 soc_pcmcia_debug(skt, __func__, lvl, fmt , ## arg)
58 #define debug(skt, lvl, fmt, arg...) do { } while (0)
63 * The PC Card Standard, Release 7, section 4.13.4, says that twIORD
64 * has a minimum value of 165ns. Section 4.13.5 says that twIOWR has
65 * a minimum value of 165ns, as well. Section 4.7.2 (describing
66 * common and attribute memory write timing) says that twWE has a
67 * minimum value of 150ns for a 250ns cycle time (for 5V operation;
68 * see section 4.7.4), or 300ns for a 600ns cycle time (for 3.3V
69 * operation, also section 4.7.4). Section 4.7.3 says that taOE
70 * has a maximum value of 150ns for a 300ns cycle time (for 5V
71 * operation), or 300ns for a 600ns cycle time (for 3.3V operation).
73 * When configuring memory maps, Card Services appears to adopt the policy
74 * that a memory access time of "0" means "use the default." The default
75 * PCMCIA I/O command width time is 165ns. The default PCMCIA 5V attribute
76 * and memory command width time is 150ns; the PCMCIA 3.3V attribute and
77 * memory command width time is 300ns.
79 #define SOC_PCMCIA_IO_ACCESS (165)
80 #define SOC_PCMCIA_5V_MEM_ACCESS (150)
81 #define SOC_PCMCIA_3V_MEM_ACCESS (300)
82 #define SOC_PCMCIA_ATTR_MEM_ACCESS (300)
85 * The socket driver actually works nicely in interrupt-driven form,
86 * so the (relatively infrequent) polling is "just to be sure."
88 #define SOC_PCMCIA_POLL_PERIOD (2*HZ)
91 /* I/O pins replacing memory pins
92 * (PCMCIA System Architecture, 2nd ed., by Don Anderson, p.75)
94 * These signals change meaning when going from memory-only to
95 * memory-or-I/O interface: