30 #include <linux/types.h>
31 #include <linux/module.h>
32 #include <linux/kernel.h>
43 #define DRV_NAME "au1200-ide"
47 #define IDE_REG_SHIFT 5
51 #define IDE_AU1XXX_BURSTMODE 1
55 #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA)
94 void *
buf,
unsigned int len)
96 auide_insw(drive->
hwif->io_ports.data_addr, buf, (len + 1) / 2);
100 void *
buf,
unsigned int len)
102 auide_outsw(drive->
hwif->io_ports.data_addr, buf, (len + 1) / 2);
108 int mem_sttime = 0, mem_stcfg = au_readl(
MEM_STCFG2);
169 int mem_sttime = 0, mem_stcfg = au_readl(
MEM_STCFG2);
172 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
214 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
224 ahwif->drive = drive;
237 unsigned int tc = (cur_len < 0xfe00)? cur_len: 0xfe00;
290 if (auide_build_dmatable(drive, cmd) == 0)
311 static void auide_dma_host_set(
ide_drive_t *drive,
int on)
315 static void auide_ddma_tx_callback(
int irq,
void *
param)
319 static void auide_ddma_rx_callback(
int irq,
void *
param)
336 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
339 .dma_setup = auide_dma_setup,
340 .dma_start = auide_dma_start,
341 .dma_end = auide_dma_end,
342 .dma_test_irq = auide_dma_test_irq,
352 dev_id = hwif->ddma_id;
357 #ifdef IDE_AU1XXX_BURSTMODE
364 auide_init_dbdma_dev(&source_dev_tab, dev_id, tsize, devwidth,
368 auide_init_dbdma_dev(&source_dev_tab, dev_id, tsize, devwidth,
380 auide_ddma_tx_callback,
386 auide_ddma_rx_callback,
409 #ifdef IDE_AU1XXX_BURSTMODE
454 for (i = 0; i < 8; i++)
461 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA
462 static const struct ide_tp_ops au1xxx_tp_ops = {
472 .input_data = au1xxx_input_data,
473 .output_data = au1xxx_output_data,
478 .set_pio_mode = au1xxx_set_pio_mode,
479 .set_dma_mode = auide_set_dma_mode,
483 .init_dma = auide_ddma_init,
484 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA
485 .tp_ops = &au1xxx_tp_ops,
487 .port_ops = &au1xxx_port_ops,
488 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
489 .dma_ops = &au1xxx_dma_ops,
495 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
507 struct ide_hw hw, *hws[] = { &hw };
509 #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA)
510 char *
mode =
"MWDMA2";
511 #elif defined(CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA)
512 char *mode =
"PIO+DDMA(offload)";
525 if (ahwif->
irq < 0) {
551 memset(&hw, 0,
sizeof(hw));
552 auide_setup_ports(&hw, ahwif);
562 platform_set_drvdata(dev, host);
573 struct ide_host *host = platform_get_drvdata(dev);
588 .name =
"au1200-ide",
591 .probe = au_ide_probe,
592 .remove = au_ide_remove,
595 static int __init au_ide_init(
void)
600 static void __exit au_ide_exit(
void)