aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/xxs1500_ss.c
diff options
context:
space:
mode:
authorManuel Lauss <manuel.lauss@googlemail.com>2010-02-24 11:40:21 -0500
committerRalf Baechle <ralf@linux-mips.org>2010-02-27 06:53:43 -0500
commit11b897cf84c37e6522db914793677e933ef311fb (patch)
treeb9d69cea86b2c1673f30332ff9b3944dc00bfc9b /drivers/pcmcia/xxs1500_ss.c
parentb9b37787d24cca9fbd63f767663e9439fa69aa22 (diff)
MIPS: Alchemy: use 36bit addresses for PCMCIA resources.
On Alchemy the PCMCIA area lies at the end of the chips 36bit system bus area. Currently, addresses at the far end of the 32bit area are assumed to belong to the PCMCIA area and fixed up to the real 36bit address before being passed to ioremap(). A previous commit enabled 64 bit physical size for the resource datatype on Alchemy and this allows to use the correct 36bit addresses when registering the PCMCIA sockets. This patch removes the 32-to-36bit address fixup and registers the Alchemy demo board pcmcia socket with the correct 36bit physical addresses. Tested on DB1200, with a CF card (ide-cs driver) and a 3c589 PCMCIA ethernet card. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> To: Linux-MIPS <linux-mips@linux-mips.org> Cc: Manuel Lauss <manuel.lauss@gmail.com> Patchwork: http://patchwork.linux-mips.org/patch/994/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'drivers/pcmcia/xxs1500_ss.c')
-rw-r--r--drivers/pcmcia/xxs1500_ss.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/drivers/pcmcia/xxs1500_ss.c b/drivers/pcmcia/xxs1500_ss.c
index 4e36930b51ce..61560cd6e287 100644
--- a/drivers/pcmcia/xxs1500_ss.c
+++ b/drivers/pcmcia/xxs1500_ss.c
@@ -56,10 +56,9 @@ struct xxs1500_pcmcia_sock {
56 struct pcmcia_socket socket; 56 struct pcmcia_socket socket;
57 void *virt_io; 57 void *virt_io;
58 58
59 /* the "pseudo" addresses of the PCMCIA space. */ 59 phys_addr_t phys_io;
60 unsigned long phys_io; 60 phys_addr_t phys_attr;
61 unsigned long phys_attr; 61 phys_addr_t phys_mem;
62 unsigned long phys_mem;
63 62
64 /* previous flags for set_socket() */ 63 /* previous flags for set_socket() */
65 unsigned int old_flags; 64 unsigned int old_flags;
@@ -211,7 +210,6 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
211{ 210{
212 struct xxs1500_pcmcia_sock *sock; 211 struct xxs1500_pcmcia_sock *sock;
213 struct resource *r; 212 struct resource *r;
214 phys_t physio;
215 int ret, irq; 213 int ret, irq;
216 214
217 sock = kzalloc(sizeof(struct xxs1500_pcmcia_sock), GFP_KERNEL); 215 sock = kzalloc(sizeof(struct xxs1500_pcmcia_sock), GFP_KERNEL);
@@ -225,9 +223,9 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
225 * for this socket (usually the 36bit address shifted 4 to the 223 * for this socket (usually the 36bit address shifted 4 to the
226 * right). 224 * right).
227 */ 225 */
228 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pseudo-attr"); 226 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-attr");
229 if (!r) { 227 if (!r) {
230 dev_err(&pdev->dev, "missing 'pseudo-attr' resource!\n"); 228 dev_err(&pdev->dev, "missing 'pcmcia-attr' resource!\n");
231 goto out0; 229 goto out0;
232 } 230 }
233 sock->phys_attr = r->start; 231 sock->phys_attr = r->start;
@@ -236,9 +234,9 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
236 * pseudo-mem: The 32bit address of the PCMCIA memory space for 234 * pseudo-mem: The 32bit address of the PCMCIA memory space for
237 * this socket (usually the 36bit address shifted 4 to the right) 235 * this socket (usually the 36bit address shifted 4 to the right)
238 */ 236 */
239 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pseudo-mem"); 237 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-mem");
240 if (!r) { 238 if (!r) {
241 dev_err(&pdev->dev, "missing 'pseudo-mem' resource!\n"); 239 dev_err(&pdev->dev, "missing 'pcmcia-mem' resource!\n");
242 goto out0; 240 goto out0;
243 } 241 }
244 sock->phys_mem = r->start; 242 sock->phys_mem = r->start;
@@ -247,19 +245,14 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
247 * pseudo-io: The 32bit address of the PCMCIA IO space for this 245 * pseudo-io: The 32bit address of the PCMCIA IO space for this
248 * socket (usually the 36bit address shifted 4 to the right). 246 * socket (usually the 36bit address shifted 4 to the right).
249 */ 247 */
250 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pseudo-io"); 248 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-io");
251 if (!r) { 249 if (!r) {
252 dev_err(&pdev->dev, "missing 'pseudo-io' resource!\n"); 250 dev_err(&pdev->dev, "missing 'pcmcia-io' resource!\n");
253 goto out0; 251 goto out0;
254 } 252 }
255 sock->phys_io = r->start; 253 sock->phys_io = r->start;
256 254
257 255
258 /* for io must remap the full 36bit address (for reference see
259 * alchemy/common/setup.c::__fixup_bigphys_addr)
260 */
261 physio = ((phys_t)sock->phys_io) << 4;
262
263 /* 256 /*
264 * PCMCIA client drivers use the inb/outb macros to access 257 * PCMCIA client drivers use the inb/outb macros to access
265 * the IO registers. Since mips_io_port_base is added 258 * the IO registers. Since mips_io_port_base is added
@@ -268,7 +261,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
268 * to access the I/O or MEM address directly, without 261 * to access the I/O or MEM address directly, without
269 * going through this "mips_io_port_base" mechanism. 262 * going through this "mips_io_port_base" mechanism.
270 */ 263 */
271 sock->virt_io = (void *)(ioremap(physio, IO_MAP_SIZE) - 264 sock->virt_io = (void *)(ioremap(sock->phys_io, IO_MAP_SIZE) -
272 mips_io_port_base); 265 mips_io_port_base);
273 266
274 if (!sock->virt_io) { 267 if (!sock->virt_io) {