diff options
Diffstat (limited to 'meta/recipes-kernel/linux/linux-2.6.23/cm-x270/0005-cm-x270-pcmcia.patch')
-rw-r--r-- | meta/recipes-kernel/linux/linux-2.6.23/cm-x270/0005-cm-x270-pcmcia.patch | 228 |
1 files changed, 0 insertions, 228 deletions
diff --git a/meta/recipes-kernel/linux/linux-2.6.23/cm-x270/0005-cm-x270-pcmcia.patch b/meta/recipes-kernel/linux/linux-2.6.23/cm-x270/0005-cm-x270-pcmcia.patch deleted file mode 100644 index 7dceff5c9d..0000000000 --- a/meta/recipes-kernel/linux/linux-2.6.23/cm-x270/0005-cm-x270-pcmcia.patch +++ /dev/null | |||
@@ -1,228 +0,0 @@ | |||
1 | From 338653da8f8afcdf8afc7e8a5a0104d5083597cc Mon Sep 17 00:00:00 2001 | ||
2 | From: Cliff Brake <cbrake@happy.dev.bec-systems.com> | ||
3 | Date: Fri, 20 Jul 2007 19:01:27 -0400 | ||
4 | Subject: [PATCH] cm-x270-pcmcia | ||
5 | |||
6 | --- | ||
7 | drivers/pcmcia/Makefile | 1 + | ||
8 | drivers/pcmcia/pxa2xx_cm_x270.c | 198 +++++++++++++++++++++++++++++++++++++++ | ||
9 | 2 files changed, 199 insertions(+), 0 deletions(-) | ||
10 | create mode 100644 drivers/pcmcia/pxa2xx_cm_x270.c | ||
11 | |||
12 | diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile | ||
13 | index 4276965..353d5b7 100644 | ||
14 | --- a/drivers/pcmcia/Makefile | ||
15 | +++ b/drivers/pcmcia/Makefile | ||
16 | @@ -69,4 +69,5 @@ sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o | ||
17 | pxa2xx_cs-$(CONFIG_ARCH_LUBBOCK) += pxa2xx_lubbock.o sa1111_generic.o | ||
18 | pxa2xx_cs-$(CONFIG_MACH_MAINSTONE) += pxa2xx_mainstone.o | ||
19 | pxa2xx_cs-$(CONFIG_PXA_SHARPSL) += pxa2xx_sharpsl.o | ||
20 | +pxa2xx_cs-$(CONFIG_MACH_ARMCORE) += pxa2xx_cm_x270.o | ||
21 | |||
22 | diff --git a/drivers/pcmcia/pxa2xx_cm_x270.c b/drivers/pcmcia/pxa2xx_cm_x270.c | ||
23 | new file mode 100644 | ||
24 | index 0000000..25e369f | ||
25 | --- /dev/null | ||
26 | +++ b/drivers/pcmcia/pxa2xx_cm_x270.c | ||
27 | @@ -0,0 +1,198 @@ | ||
28 | +/* | ||
29 | + * linux/drivers/pcmcia/pxa/pxa_armcore.c | ||
30 | + * | ||
31 | + * This program is free software; you can redistribute it and/or modify | ||
32 | + * it under the terms of the GNU General Public License version 2 as | ||
33 | + * published by the Free Software Foundation. | ||
34 | + * | ||
35 | + * Compulab Ltd., 2003 | ||
36 | + * | ||
37 | + */ | ||
38 | + | ||
39 | +#include <linux/kernel.h> | ||
40 | +#include <linux/sched.h> | ||
41 | +#include <linux/platform_device.h> | ||
42 | +#include <linux/irq.h> | ||
43 | + | ||
44 | +#include <pcmcia/ss.h> | ||
45 | +#include <asm/delay.h> | ||
46 | +#include <asm/hardware.h> | ||
47 | + | ||
48 | +#include <asm/arch/pxa-regs.h> | ||
49 | +#include <asm/arch/cm-x270.h> | ||
50 | + | ||
51 | +#include "soc_common.h" | ||
52 | + | ||
53 | + | ||
54 | +static struct pcmcia_irqs irqs[] = { | ||
55 | + { 0, PCMCIA_S0_CD_VALID, "PCMCIA0 CD" }, | ||
56 | + { 1, PCMCIA_S1_CD_VALID, "PCMCIA1 CD" }, | ||
57 | +}; | ||
58 | + | ||
59 | + | ||
60 | +static int | ||
61 | +cmx270_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | ||
62 | +{ | ||
63 | + int return_val=0; | ||
64 | + | ||
65 | + GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) | | ||
66 | + GPIO_bit(GPIO49_nPWE) | | ||
67 | + GPIO_bit(GPIO50_nPIOR) | | ||
68 | + GPIO_bit(GPIO51_nPIOW) | | ||
69 | + GPIO_bit(GPIO85_nPCE_1) | | ||
70 | + GPIO_bit(GPIO54_nPCE_2); | ||
71 | + | ||
72 | + pxa_gpio_mode(GPIO48_nPOE_MD); | ||
73 | + pxa_gpio_mode(GPIO49_nPWE_MD); | ||
74 | + pxa_gpio_mode(GPIO50_nPIOR_MD); | ||
75 | + pxa_gpio_mode(GPIO51_nPIOW_MD); | ||
76 | + pxa_gpio_mode(GPIO85_nPCE_1_MD); | ||
77 | + pxa_gpio_mode(GPIO54_nPCE_2_MD); | ||
78 | + //pxa_gpio_mode(GPIO79_pSKTSEL_MD); /* REVISIT: s/b dependent on num sockets (on ATX base not routed)*/ | ||
79 | + pxa_gpio_mode(GPIO55_nPREG_MD); | ||
80 | + pxa_gpio_mode(GPIO56_nPWAIT_MD); | ||
81 | + pxa_gpio_mode(GPIO57_nIOIS16_MD); | ||
82 | + | ||
83 | + // Reset signal | ||
84 | + GPDR(GPIO53_nPCE_2) |= GPIO_bit(GPIO53_nPCE_2); | ||
85 | + GPCR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2); | ||
86 | + | ||
87 | + GPDR(IRQ_TO_GPIO(PCMCIA_S0_CD_VALID)) &= ~GPIO_bit(IRQ_TO_GPIO(PCMCIA_S0_CD_VALID)); | ||
88 | + GPDR(IRQ_TO_GPIO(PCMCIA_S1_CD_VALID)) &= ~GPIO_bit(IRQ_TO_GPIO(PCMCIA_S1_CD_VALID)); | ||
89 | + | ||
90 | + set_irq_type(PCMCIA_S0_CD_VALID, IRQ_TYPE_EDGE_BOTH); | ||
91 | + set_irq_type(PCMCIA_S1_CD_VALID, IRQ_TYPE_EDGE_BOTH); | ||
92 | + | ||
93 | + //irq's for slots: | ||
94 | + GPDR(IRQ_TO_GPIO(PCMCIA_S0_RDYINT)) &= ~GPIO_bit(IRQ_TO_GPIO(PCMCIA_S0_RDYINT)); | ||
95 | + GPDR(IRQ_TO_GPIO(PCMCIA_S1_RDYINT)) &= ~GPIO_bit(IRQ_TO_GPIO(PCMCIA_S1_RDYINT)); | ||
96 | + | ||
97 | + set_irq_type(PCMCIA_S0_RDYINT, IRQ_TYPE_EDGE_FALLING); | ||
98 | + set_irq_type(PCMCIA_S1_RDYINT, IRQ_TYPE_EDGE_FALLING); | ||
99 | + | ||
100 | + skt->irq = (skt->nr == 0) ? PCMCIA_S0_RDYINT : PCMCIA_S1_RDYINT; | ||
101 | + return_val = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); | ||
102 | + | ||
103 | + return return_val; | ||
104 | +} | ||
105 | + | ||
106 | + | ||
107 | +static void cmx270_pcmcia_shutdown(struct soc_pcmcia_socket *skt) | ||
108 | +{ | ||
109 | + soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); | ||
110 | + | ||
111 | + set_irq_type(IRQ_TO_GPIO(PCMCIA_S0_CD_VALID), IRQ_TYPE_NONE); | ||
112 | + set_irq_type(IRQ_TO_GPIO(PCMCIA_S1_CD_VALID), IRQ_TYPE_NONE); | ||
113 | + | ||
114 | + set_irq_type(IRQ_TO_GPIO(PCMCIA_S0_RDYINT), IRQ_TYPE_NONE); | ||
115 | + set_irq_type(IRQ_TO_GPIO(PCMCIA_S1_RDYINT), IRQ_TYPE_NONE); | ||
116 | +} | ||
117 | + | ||
118 | + | ||
119 | +static void cmx270_pcmcia_socket_state(struct soc_pcmcia_socket *skt, | ||
120 | + struct pcmcia_state *state) | ||
121 | +{ | ||
122 | + | ||
123 | + state->detect = (PCC_DETECT(skt->nr) == 0) ? 1 : 0; | ||
124 | + state->ready = (PCC_READY(skt->nr) == 0) ? 0 : 1; | ||
125 | + state->bvd1 = 1; | ||
126 | + state->bvd2 = 1; | ||
127 | + state->vs_3v = 0; | ||
128 | + state->vs_Xv = 0; | ||
129 | + state->wrprot = 0; /* not available */ | ||
130 | + | ||
131 | +} | ||
132 | + | ||
133 | + | ||
134 | +static int | ||
135 | +cmx270_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, | ||
136 | + const socket_state_t *state) | ||
137 | +{ | ||
138 | + | ||
139 | + GPSR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE); | ||
140 | + pxa_gpio_mode(GPIO49_nPWE | GPIO_OUT); | ||
141 | + //pxa_gpio_mode(GPIO79_pSKTSEL_MD | GPIO_OUT); /* For 2-socket mode */ | ||
142 | + | ||
143 | + switch(skt->nr){ | ||
144 | + case 0: | ||
145 | + if(state->flags & SS_RESET) { | ||
146 | + //GPCR(GPIO79_pSKTSEL) = GPIO_bit(GPIO79_pSKTSEL); /* For 2-socket mode */ | ||
147 | + //udelay(1); | ||
148 | + GPCR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE); | ||
149 | + GPSR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2); | ||
150 | + udelay(10); | ||
151 | + GPCR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2); | ||
152 | + GPSR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE); | ||
153 | + } | ||
154 | + break; | ||
155 | + case 1: | ||
156 | + if(state->flags & SS_RESET) { | ||
157 | + //GPCR(GPIO79_pSKTSEL) = GPIO_bit(GPIO79_pSKTSEL); /* For 2-socket mode */ | ||
158 | + //udelay(1); | ||
159 | + GPCR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE); | ||
160 | + GPSR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2); | ||
161 | + udelay(10); | ||
162 | + GPCR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2); | ||
163 | + GPSR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE); | ||
164 | + } | ||
165 | + break; | ||
166 | + } | ||
167 | + | ||
168 | + pxa_gpio_mode(GPIO49_nPWE_MD); | ||
169 | + //pxa_gpio_mode(GPIO79_pSKTSEL_MD); /* For 2-socket mode */ | ||
170 | + | ||
171 | + | ||
172 | + return 0; | ||
173 | +} | ||
174 | + | ||
175 | +static void cmx270_pcmcia_socket_init(struct soc_pcmcia_socket *skt) | ||
176 | +{ | ||
177 | +} | ||
178 | + | ||
179 | +static void cmx270_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) | ||
180 | +{ | ||
181 | +} | ||
182 | + | ||
183 | + | ||
184 | +static struct pcmcia_low_level cmx270_pcmcia_ops = { | ||
185 | + .owner = THIS_MODULE, | ||
186 | + .hw_init = cmx270_pcmcia_hw_init, | ||
187 | + .hw_shutdown = cmx270_pcmcia_shutdown, | ||
188 | + .socket_state = cmx270_pcmcia_socket_state, | ||
189 | + .configure_socket = cmx270_pcmcia_configure_socket, | ||
190 | + .socket_init = cmx270_pcmcia_socket_init, | ||
191 | + .socket_suspend = cmx270_pcmcia_socket_suspend, | ||
192 | + .nr = 2, | ||
193 | +}; | ||
194 | + | ||
195 | +static struct platform_device *cmx270_pcmcia_device; | ||
196 | + | ||
197 | +static int __init cmx270_pcmcia_init(void) | ||
198 | +{ | ||
199 | + int ret; | ||
200 | + | ||
201 | + cmx270_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); | ||
202 | + | ||
203 | + if (!cmx270_pcmcia_device) | ||
204 | + return -ENOMEM; | ||
205 | + | ||
206 | + cmx270_pcmcia_device->dev.platform_data = &cmx270_pcmcia_ops; | ||
207 | + | ||
208 | + printk ("Registering cm-x270 PCMCIA interface.\n"); | ||
209 | + ret = platform_device_add(cmx270_pcmcia_device); | ||
210 | + | ||
211 | + if (ret) | ||
212 | + platform_device_put(cmx270_pcmcia_device); | ||
213 | + | ||
214 | + return ret; | ||
215 | +} | ||
216 | + | ||
217 | +static void __exit cmx270_pcmcia_exit(void) | ||
218 | +{ | ||
219 | + platform_device_unregister(cmx270_pcmcia_device); | ||
220 | +} | ||
221 | + | ||
222 | +module_init(cmx270_pcmcia_init); | ||
223 | +module_exit(cmx270_pcmcia_exit); | ||
224 | + | ||
225 | +MODULE_LICENSE("GPL"); | ||
226 | -- | ||
227 | 1.5.1.6 | ||
228 | |||