aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-03 16:28:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-03 16:28:14 -0400
commitd6748066ad0e8b2514545998f8367ebb3906f299 (patch)
treef7a9bfd764a8fb781aeda0ef2249afbab42dddf7 /drivers/ide
parentf04c045f8ce69c22bda9d99eb927276b776135fc (diff)
parent3ba1e543ab4b02640d396098f2f6a199560d5f2d (diff)
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (37 commits) MIPS: O32: Provide definition of registers ta0 .. ta3. MIPS: perf: Add Octeon support for hardware perf. MIPS: perf: Add support for 64-bit perf counters. MIPS: perf: Reorganize contents of perf support files. MIPS: perf: Cleanup formatting in arch/mips/kernel/perf_event.c MIPS: Add accessor macros for 64-bit performance counter registers. MIPS: Add probes for more Octeon II CPUs. MIPS: Add more CPU identifiers for Octeon II CPUs. MIPS: XLR, XLS: Add comment for smp setup MIPS: JZ4740: GPIO: Check correct IRQ in demux handler MIPS: JZ4740: GPIO: Simplify IRQ demuxer MIPS: JZ4740: Use generic irq chip MIPS: Alchemy: remove all CONFIG_SOC_AU1??? defines MIPS: Alchemy: kill au1xxx.h header MIPS: Alchemy: clean DMA code of CONFIG_SOC_AU1??? defines MIPS, IDE: Alchem, au1xxx-ide: Remove pb1200/db1200 header dep MIPS: Alchemy: Redo PCI as platform driver MIPS: Alchemy: more base address cleanup MIPS: Alchemy: rewrite USB platform setup. MIPS: Alchemy: abstract USB block control register access ... Fix up trivial conflicts in: arch/mips/alchemy/devboards/db1x00/platform.c drivers/ide/Kconfig drivers/mmc/host/au1xmmc.c drivers/video/Kconfig sound/mips/Kconfig
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 76b6d98bd295..5a26584934ca 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 b26c23416fa7..259786ca8b75 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;