aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/Kconfig6
-rw-r--r--drivers/ide/au1xxx-ide.c46
2 files changed, 30 insertions, 22 deletions
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 76b6d98bd29..5a26584934c 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -677,19 +677,19 @@ config BLK_DEV_IDE_PMAC_ATA100FIRST
677 677
678config BLK_DEV_IDE_AU1XXX 678config BLK_DEV_IDE_AU1XXX
679 bool "IDE for AMD Alchemy Au1200" 679 bool "IDE for AMD Alchemy Au1200"
680 depends on SOC_AU1200 680 depends on MIPS_ALCHEMY
681 select IDE_XFER_MODE 681 select IDE_XFER_MODE
682choice 682choice
683 prompt "IDE Mode for AMD Alchemy Au1200" 683 prompt "IDE Mode for AMD Alchemy Au1200"
684 default BLK_DEV_IDE_AU1XXX_PIO_DBDMA 684 default BLK_DEV_IDE_AU1XXX_PIO_DBDMA
685 depends on SOC_AU1200 && BLK_DEV_IDE_AU1XXX 685 depends on BLK_DEV_IDE_AU1XXX
686 686
687config BLK_DEV_IDE_AU1XXX_PIO_DBDMA 687config BLK_DEV_IDE_AU1XXX_PIO_DBDMA
688 bool "PIO+DbDMA IDE for AMD Alchemy Au1200" 688 bool "PIO+DbDMA IDE for AMD Alchemy Au1200"
689 689
690config BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 690config BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
691 bool "MDMA2+DbDMA IDE for AMD Alchemy Au1200" 691 bool "MDMA2+DbDMA IDE for AMD Alchemy Au1200"
692 depends on SOC_AU1200 && BLK_DEV_IDE_AU1XXX 692 depends on BLK_DEV_IDE_AU1XXX
693endchoice 693endchoice
694 694
695config BLK_DEV_IDE_TX4938 695config BLK_DEV_IDE_TX4938
diff --git a/drivers/ide/au1xxx-ide.c b/drivers/ide/au1xxx-ide.c
index b26c23416fa..259786ca8b7 100644
--- a/drivers/ide/au1xxx-ide.c
+++ b/drivers/ide/au1xxx-ide.c
@@ -36,13 +36,17 @@
36#include <linux/ide.h> 36#include <linux/ide.h>
37#include <linux/scatterlist.h> 37#include <linux/scatterlist.h>
38 38
39#include <asm/mach-au1x00/au1xxx.h> 39#include <asm/mach-au1x00/au1000.h>
40#include <asm/mach-au1x00/au1xxx_dbdma.h> 40#include <asm/mach-au1x00/au1xxx_dbdma.h>
41#include <asm/mach-au1x00/au1xxx_ide.h> 41#include <asm/mach-au1x00/au1xxx_ide.h>
42 42
43#define DRV_NAME "au1200-ide" 43#define DRV_NAME "au1200-ide"
44#define DRV_AUTHOR "Enrico Walther <enrico.walther@amd.com> / Pete Popov <ppopov@embeddedalley.com>" 44#define DRV_AUTHOR "Enrico Walther <enrico.walther@amd.com> / Pete Popov <ppopov@embeddedalley.com>"
45 45
46#ifndef IDE_REG_SHIFT
47#define IDE_REG_SHIFT 5
48#endif
49
46/* enable the burstmode in the dbdma */ 50/* enable the burstmode in the dbdma */
47#define IDE_AU1XXX_BURSTMODE 1 51#define IDE_AU1XXX_BURSTMODE 1
48 52
@@ -317,10 +321,11 @@ static void auide_ddma_rx_callback(int irq, void *param)
317} 321}
318#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ 322#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
319 323
320static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 devwidth, u32 flags) 324static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize,
325 u32 devwidth, u32 flags, u32 regbase)
321{ 326{
322 dev->dev_id = dev_id; 327 dev->dev_id = dev_id;
323 dev->dev_physaddr = (u32)IDE_PHYS_ADDR; 328 dev->dev_physaddr = CPHYSADDR(regbase);
324 dev->dev_intlevel = 0; 329 dev->dev_intlevel = 0;
325 dev->dev_intpolarity = 0; 330 dev->dev_intpolarity = 0;
326 dev->dev_tsize = tsize; 331 dev->dev_tsize = tsize;
@@ -344,7 +349,7 @@ static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d)
344 dbdev_tab_t source_dev_tab, target_dev_tab; 349 dbdev_tab_t source_dev_tab, target_dev_tab;
345 u32 dev_id, tsize, devwidth, flags; 350 u32 dev_id, tsize, devwidth, flags;
346 351
347 dev_id = IDE_DDMA_REQ; 352 dev_id = hwif->ddma_id;
348 353
349 tsize = 8; /* 1 */ 354 tsize = 8; /* 1 */
350 devwidth = 32; /* 16 */ 355 devwidth = 32; /* 16 */
@@ -356,20 +361,17 @@ static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d)
356#endif 361#endif
357 362
358 /* setup dev_tab for tx channel */ 363 /* setup dev_tab for tx channel */
359 auide_init_dbdma_dev( &source_dev_tab, 364 auide_init_dbdma_dev(&source_dev_tab, dev_id, tsize, devwidth,
360 dev_id, 365 DEV_FLAGS_OUT | flags, auide->regbase);
361 tsize, devwidth, DEV_FLAGS_OUT | flags);
362 auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); 366 auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab );
363 367
364 auide_init_dbdma_dev( &source_dev_tab, 368 auide_init_dbdma_dev(&source_dev_tab, dev_id, tsize, devwidth,
365 dev_id, 369 DEV_FLAGS_IN | flags, auide->regbase);
366 tsize, devwidth, DEV_FLAGS_IN | flags);
367 auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); 370 auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab );
368 371
369 /* We also need to add a target device for the DMA */ 372 /* We also need to add a target device for the DMA */
370 auide_init_dbdma_dev( &target_dev_tab, 373 auide_init_dbdma_dev(&target_dev_tab, (u32)DSCR_CMD0_ALWAYS, tsize,
371 (u32)DSCR_CMD0_ALWAYS, 374 devwidth, DEV_FLAGS_ANYUSE, auide->regbase);
372 tsize, devwidth, DEV_FLAGS_ANYUSE);
373 auide->target_dev_id = au1xxx_ddma_add_device(&target_dev_tab); 375 auide->target_dev_id = au1xxx_ddma_add_device(&target_dev_tab);
374 376
375 /* Get a channel for TX */ 377 /* Get a channel for TX */
@@ -411,14 +413,12 @@ static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d)
411#endif 413#endif
412 414
413 /* setup dev_tab for tx channel */ 415 /* setup dev_tab for tx channel */
414 auide_init_dbdma_dev( &source_dev_tab, 416 auide_init_dbdma_dev(&source_dev_tab, (u32)DSCR_CMD0_ALWAYS, 8, 32,
415 (u32)DSCR_CMD0_ALWAYS, 417 DEV_FLAGS_OUT | flags, auide->regbase);
416 8, 32, DEV_FLAGS_OUT | flags);
417 auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); 418 auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab );
418 419
419 auide_init_dbdma_dev( &source_dev_tab, 420 auide_init_dbdma_dev(&source_dev_tab, (u32)DSCR_CMD0_ALWAYS, 8, 32,
420 (u32)DSCR_CMD0_ALWAYS, 421 DEV_FLAGS_IN | flags, auide->regbase);
421 8, 32, DEV_FLAGS_IN | flags);
422 auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); 422 auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab );
423 423
424 /* Get a channel for TX */ 424 /* Get a channel for TX */
@@ -540,6 +540,14 @@ static int au_ide_probe(struct platform_device *dev)
540 goto out; 540 goto out;
541 } 541 }
542 542
543 res = platform_get_resource(dev, IORESOURCE_DMA, 0);
544 if (!res) {
545 pr_debug("%s: no DDMA ID resource\n", DRV_NAME);
546 ret = -ENODEV;
547 goto out;
548 }
549 ahwif->ddma_id = res->start;
550
543 memset(&hw, 0, sizeof(hw)); 551 memset(&hw, 0, sizeof(hw));
544 auide_setup_ports(&hw, ahwif); 552 auide_setup_ports(&hw, ahwif);
545 hw.irq = ahwif->irq; 553 hw.irq = ahwif->irq;