aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/db1xxx_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/db1xxx_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/db1xxx_ss.c')
-rw-r--r--drivers/pcmcia/db1xxx_ss.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/drivers/pcmcia/db1xxx_ss.c b/drivers/pcmcia/db1xxx_ss.c
index b35b72b0d5b5..3889cf07d6ce 100644
--- a/drivers/pcmcia/db1xxx_ss.c
+++ b/drivers/pcmcia/db1xxx_ss.c
@@ -43,9 +43,9 @@ struct db1x_pcmcia_sock {
43 void *virt_io; 43 void *virt_io;
44 44
45 /* the "pseudo" addresses of the PCMCIA space. */ 45 /* the "pseudo" addresses of the PCMCIA space. */
46 unsigned long phys_io; 46 phys_addr_t phys_io;
47 unsigned long phys_attr; 47 phys_addr_t phys_attr;
48 unsigned long phys_mem; 48 phys_addr_t phys_mem;
49 49
50 /* previous flags for set_socket() */ 50 /* previous flags for set_socket() */
51 unsigned int old_flags; 51 unsigned int old_flags;
@@ -404,7 +404,6 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
404{ 404{
405 struct db1x_pcmcia_sock *sock; 405 struct db1x_pcmcia_sock *sock;
406 struct resource *r; 406 struct resource *r;
407 phys_t physio;
408 int ret, bid; 407 int ret, bid;
409 408
410 sock = kzalloc(sizeof(struct db1x_pcmcia_sock), GFP_KERNEL); 409 sock = kzalloc(sizeof(struct db1x_pcmcia_sock), GFP_KERNEL);
@@ -465,7 +464,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
465 * for this socket (usually the 36bit address shifted 4 to the 464 * for this socket (usually the 36bit address shifted 4 to the
466 * right). 465 * right).
467 */ 466 */
468 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pseudo-attr"); 467 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-attr");
469 if (!r) { 468 if (!r) {
470 printk(KERN_ERR "pcmcia%d has no 'pseudo-attr' resource!\n", 469 printk(KERN_ERR "pcmcia%d has no 'pseudo-attr' resource!\n",
471 sock->nr); 470 sock->nr);
@@ -477,7 +476,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
477 * pseudo-mem: The 32bit address of the PCMCIA memory space for 476 * pseudo-mem: The 32bit address of the PCMCIA memory space for
478 * this socket (usually the 36bit address shifted 4 to the right) 477 * this socket (usually the 36bit address shifted 4 to the right)
479 */ 478 */
480 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pseudo-mem"); 479 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-mem");
481 if (!r) { 480 if (!r) {
482 printk(KERN_ERR "pcmcia%d has no 'pseudo-mem' resource!\n", 481 printk(KERN_ERR "pcmcia%d has no 'pseudo-mem' resource!\n",
483 sock->nr); 482 sock->nr);
@@ -489,7 +488,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
489 * pseudo-io: The 32bit address of the PCMCIA IO space for this 488 * pseudo-io: The 32bit address of the PCMCIA IO space for this
490 * socket (usually the 36bit address shifted 4 to the right). 489 * socket (usually the 36bit address shifted 4 to the right).
491 */ 490 */
492 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pseudo-io"); 491 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-io");
493 if (!r) { 492 if (!r) {
494 printk(KERN_ERR "pcmcia%d has no 'pseudo-io' resource!\n", 493 printk(KERN_ERR "pcmcia%d has no 'pseudo-io' resource!\n",
495 sock->nr); 494 sock->nr);
@@ -497,12 +496,6 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
497 } 496 }
498 sock->phys_io = r->start; 497 sock->phys_io = r->start;
499 498
500
501 /* IO: we must remap the full 36bit address (for reference see
502 * alchemy/common/setup.c::__fixup_bigphys_addr())
503 */
504 physio = ((phys_t)sock->phys_io) << 4;
505
506 /* 499 /*
507 * PCMCIA client drivers use the inb/outb macros to access 500 * PCMCIA client drivers use the inb/outb macros to access
508 * the IO registers. Since mips_io_port_base is added 501 * the IO registers. Since mips_io_port_base is added
@@ -511,7 +504,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
511 * to access the I/O or MEM address directly, without 504 * to access the I/O or MEM address directly, without
512 * going through this "mips_io_port_base" mechanism. 505 * going through this "mips_io_port_base" mechanism.
513 */ 506 */
514 sock->virt_io = (void *)(ioremap(physio, IO_MAP_SIZE) - 507 sock->virt_io = (void *)(ioremap(sock->phys_io, IO_MAP_SIZE) -
515 mips_io_port_base); 508 mips_io_port_base);
516 509
517 if (!sock->virt_io) { 510 if (!sock->virt_io) {
@@ -547,8 +540,8 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
547 goto out2; 540 goto out2;
548 } 541 }
549 542
550 printk(KERN_INFO "Alchemy Db/Pb1xxx pcmcia%d @ io/attr/mem %08lx" 543 printk(KERN_INFO "Alchemy Db/Pb1xxx pcmcia%d @ io/attr/mem %09llx"
551 "(%p) %08lx %08lx card/insert/stschg/eject irqs @ %d " 544 "(%p) %09llx %09llx card/insert/stschg/eject irqs @ %d "
552 "%d %d %d\n", sock->nr, sock->phys_io, sock->virt_io, 545 "%d %d %d\n", sock->nr, sock->phys_io, sock->virt_io,
553 sock->phys_attr, sock->phys_mem, sock->card_irq, 546 sock->phys_attr, sock->phys_mem, sock->card_irq,
554 sock->insert_irq, sock->stschg_irq, sock->eject_irq); 547 sock->insert_irq, sock->stschg_irq, sock->eject_irq);