aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/arm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/arm')
-rw-r--r--drivers/ide/arm/bast-ide.c3
-rw-r--r--drivers/ide/arm/icside.c56
-rw-r--r--drivers/ide/arm/ide_arm.c18
-rw-r--r--drivers/ide/arm/palm_bk3710.c28
-rw-r--r--drivers/ide/arm/rapide.c1
5 files changed, 74 insertions, 32 deletions
diff --git a/drivers/ide/arm/bast-ide.c b/drivers/ide/arm/bast-ide.c
index a80b9574865e..d158f579bde2 100644
--- a/drivers/ide/arm/bast-ide.c
+++ b/drivers/ide/arm/bast-ide.c
@@ -55,8 +55,7 @@ static int __init bastide_register(unsigned int base, unsigned int aux, int irq)
55 ide_init_port_data(hwif, i); 55 ide_init_port_data(hwif, i);
56 56
57 ide_init_port_hw(hwif, &hw); 57 ide_init_port_hw(hwif, &hw);
58 hwif->mmio = 1; 58 hwif->port_ops = NULL;
59 hwif->quirkproc = NULL;
60 59
61 idx[0] = i; 60 idx[0] = i;
62 61
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index fd12bbe93f11..7d642f44e35b 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -191,6 +191,10 @@ static void icside_maskproc(ide_drive_t *drive, int mask)
191 local_irq_restore(flags); 191 local_irq_restore(flags);
192} 192}
193 193
194static const struct ide_port_ops icside_v6_no_dma_port_ops = {
195 .maskproc = icside_maskproc,
196};
197
194#ifdef CONFIG_BLK_DEV_IDEDMA_ICS 198#ifdef CONFIG_BLK_DEV_IDEDMA_ICS
195/* 199/*
196 * SG-DMA support. 200 * SG-DMA support.
@@ -266,6 +270,11 @@ static void icside_set_dma_mode(ide_drive_t *drive, const u8 xfer_mode)
266 ide_xfer_verbose(xfer_mode), 2000 / drive->drive_data); 270 ide_xfer_verbose(xfer_mode), 2000 / drive->drive_data);
267} 271}
268 272
273static const struct ide_port_ops icside_v6_port_ops = {
274 .set_dma_mode = icside_set_dma_mode,
275 .maskproc = icside_maskproc,
276};
277
269static void icside_dma_host_set(ide_drive_t *drive, int on) 278static void icside_dma_host_set(ide_drive_t *drive, int on)
270{ 279{
271} 280}
@@ -375,25 +384,33 @@ static void icside_dma_lost_irq(ide_drive_t *drive)
375 printk(KERN_ERR "%s: IRQ lost\n", drive->name); 384 printk(KERN_ERR "%s: IRQ lost\n", drive->name);
376} 385}
377 386
378static void icside_dma_init(ide_hwif_t *hwif) 387static int icside_dma_init(ide_hwif_t *hwif, const struct ide_port_info *d)
379{ 388{
380 hwif->dmatable_cpu = NULL; 389 hwif->dmatable_cpu = NULL;
381 hwif->dmatable_dma = 0; 390 hwif->dmatable_dma = 0;
382 hwif->set_dma_mode = icside_set_dma_mode; 391
383 392 return 0;
384 hwif->dma_host_set = icside_dma_host_set;
385 hwif->dma_setup = icside_dma_setup;
386 hwif->dma_exec_cmd = icside_dma_exec_cmd;
387 hwif->dma_start = icside_dma_start;
388 hwif->ide_dma_end = icside_dma_end;
389 hwif->ide_dma_test_irq = icside_dma_test_irq;
390 hwif->dma_timeout = icside_dma_timeout;
391 hwif->dma_lost_irq = icside_dma_lost_irq;
392} 393}
394
395static const struct ide_dma_ops icside_v6_dma_ops = {
396 .dma_host_set = icside_dma_host_set,
397 .dma_setup = icside_dma_setup,
398 .dma_exec_cmd = icside_dma_exec_cmd,
399 .dma_start = icside_dma_start,
400 .dma_end = icside_dma_end,
401 .dma_test_irq = icside_dma_test_irq,
402 .dma_timeout = icside_dma_timeout,
403 .dma_lost_irq = icside_dma_lost_irq,
404};
393#else 405#else
394#define icside_dma_init(hwif) (0) 406#define icside_v6_dma_ops NULL
395#endif 407#endif
396 408
409static int icside_dma_off_init(ide_hwif_t *hwif, const struct ide_port_info *d)
410{
411 return -EOPNOTSUPP;
412}
413
397static ide_hwif_t * 414static ide_hwif_t *
398icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *ec) 415icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *ec)
399{ 416{
@@ -408,7 +425,6 @@ icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *e
408 * Ensure we're using MMIO 425 * Ensure we're using MMIO
409 */ 426 */
410 default_hwif_mmiops(hwif); 427 default_hwif_mmiops(hwif);
411 hwif->mmio = 1;
412 428
413 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { 429 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
414 hwif->io_ports[i] = port; 430 hwif->io_ports[i] = port;
@@ -416,7 +432,6 @@ icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *e
416 } 432 }
417 hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)base + info->ctrloffset; 433 hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)base + info->ctrloffset;
418 hwif->irq = ec->irq; 434 hwif->irq = ec->irq;
419 hwif->noprobe = 0;
420 hwif->chipset = ide_acorn; 435 hwif->chipset = ide_acorn;
421 hwif->gendev.parent = &ec->dev; 436 hwif->gendev.parent = &ec->dev;
422 hwif->dev = &ec->dev; 437 hwif->dev = &ec->dev;
@@ -462,8 +477,10 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec)
462} 477}
463 478
464static const struct ide_port_info icside_v6_port_info __initdata = { 479static const struct ide_port_info icside_v6_port_info __initdata = {
480 .init_dma = icside_dma_off_init,
481 .port_ops = &icside_v6_no_dma_port_ops,
482 .dma_ops = &icside_v6_dma_ops,
465 .host_flags = IDE_HFLAG_SERIALIZE | 483 .host_flags = IDE_HFLAG_SERIALIZE |
466 IDE_HFLAG_NO_DMA | /* no SFF-style DMA */
467 IDE_HFLAG_NO_AUTOTUNE, 484 IDE_HFLAG_NO_AUTOTUNE,
468 .mwdma_mask = ATA_MWDMA2, 485 .mwdma_mask = ATA_MWDMA2,
469 .swdma_mask = ATA_SWDMA2, 486 .swdma_mask = ATA_SWDMA2,
@@ -526,7 +543,6 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
526 state->hwif[0] = hwif; 543 state->hwif[0] = hwif;
527 state->hwif[1] = mate; 544 state->hwif[1] = mate;
528 545
529 hwif->maskproc = icside_maskproc;
530 hwif->hwif_data = state; 546 hwif->hwif_data = state;
531 hwif->config_data = (unsigned long)ioc_base; 547 hwif->config_data = (unsigned long)ioc_base;
532 hwif->select_data = sel; 548 hwif->select_data = sel;
@@ -537,10 +553,10 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
537 mate->select_data = sel | 1; 553 mate->select_data = sel | 1;
538 554
539 if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) { 555 if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) {
540 icside_dma_init(hwif); 556 d.init_dma = icside_dma_init;
541 icside_dma_init(mate); 557 d.port_ops = &icside_v6_dma_port_ops;
542 } else 558 d.dma_ops = NULL;
543 d.mwdma_mask = d.swdma_mask = 0; 559 }
544 560
545 idx[0] = hwif->index; 561 idx[0] = hwif->index;
546 idx[1] = mate->index; 562 idx[1] = mate->index;
diff --git a/drivers/ide/arm/ide_arm.c b/drivers/ide/arm/ide_arm.c
index 82643df7c49a..4263ffd4ab20 100644
--- a/drivers/ide/arm/ide_arm.c
+++ b/drivers/ide/arm/ide_arm.c
@@ -14,6 +14,8 @@
14#include <asm/mach-types.h> 14#include <asm/mach-types.h>
15#include <asm/irq.h> 15#include <asm/irq.h>
16 16
17#define DRV_NAME "ide_arm"
18
17#ifdef CONFIG_ARCH_CLPS7500 19#ifdef CONFIG_ARCH_CLPS7500
18# include <asm/arch/hardware.h> 20# include <asm/arch/hardware.h>
19# 21#
@@ -28,10 +30,24 @@ static int __init ide_arm_init(void)
28{ 30{
29 ide_hwif_t *hwif; 31 ide_hwif_t *hwif;
30 hw_regs_t hw; 32 hw_regs_t hw;
33 unsigned long base = IDE_ARM_IO, ctl = IDE_ARM_IO + 0x206;
31 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; 34 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
32 35
36 if (!request_region(base, 8, DRV_NAME)) {
37 printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n",
38 DRV_NAME, base, base + 7);
39 return -EBUSY;
40 }
41
42 if (!request_region(ctl, 1, DRV_NAME)) {
43 printk(KERN_ERR "%s: I/O resource 0x%lX not free.\n",
44 DRV_NAME, ctl);
45 release_region(base, 8);
46 return -EBUSY;
47 }
48
33 memset(&hw, 0, sizeof(hw)); 49 memset(&hw, 0, sizeof(hw));
34 ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206); 50 ide_std_init_ports(&hw, base, ctl);
35 hw.irq = IDE_ARM_IRQ; 51 hw.irq = IDE_ARM_IRQ;
36 52
37 hwif = ide_find_port(); 53 hwif = ide_find_port();
diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c
index 666df779a5f4..8fa34e26443a 100644
--- a/drivers/ide/arm/palm_bk3710.c
+++ b/drivers/ide/arm/palm_bk3710.c
@@ -317,17 +317,31 @@ static u8 __devinit palm_bk3710_cable_detect(ide_hwif_t *hwif)
317 return ATA_CBL_PATA80; 317 return ATA_CBL_PATA80;
318} 318}
319 319
320static void __devinit palm_bk3710_init_hwif(ide_hwif_t *hwif) 320static int __devinit palm_bk3710_init_dma(ide_hwif_t *hwif,
321 const struct ide_port_info *d)
321{ 322{
322 hwif->set_pio_mode = palm_bk3710_set_pio_mode; 323 unsigned long base =
323 hwif->set_dma_mode = palm_bk3710_set_dma_mode; 324 hwif->io_ports[IDE_DATA_OFFSET] - IDE_PALM_ATA_PRI_REG_OFFSET;
324 325
325 hwif->cable_detect = palm_bk3710_cable_detect; 326 printk(KERN_INFO " %s: MMIO-DMA\n", hwif->name);
327
328 if (ide_allocate_dma_engine(hwif))
329 return -1;
330
331 ide_setup_dma(hwif, base);
332
333 return 0;
326} 334}
327 335
336static const struct ide_port_ops palm_bk3710_ports_ops = {
337 .set_pio_mode = palm_bk3710_set_pio_mode,
338 .set_dma_mode = palm_bk3710_set_dma_mode,
339 .cable_detect = palm_bk3710_cable_detect,
340};
341
328static const struct ide_port_info __devinitdata palm_bk3710_port_info = { 342static const struct ide_port_info __devinitdata palm_bk3710_port_info = {
329 .init_hwif = palm_bk3710_init_hwif, 343 .init_dma = palm_bk3710_init_dma,
330 .host_flags = IDE_HFLAG_NO_DMA, /* hack (no PCI) */ 344 .port_ops = &palm_bk3710_ports_ops,
331 .pio_mask = ATA_PIO4, 345 .pio_mask = ATA_PIO4,
332 .udma_mask = ATA_UDMA4, /* (input clk 99MHz) */ 346 .udma_mask = ATA_UDMA4, /* (input clk 99MHz) */
333 .mwdma_mask = ATA_MWDMA2, 347 .mwdma_mask = ATA_MWDMA2,
@@ -394,8 +408,6 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
394 hwif->mmio = 1; 408 hwif->mmio = 1;
395 default_hwif_mmiops(hwif); 409 default_hwif_mmiops(hwif);
396 410
397 ide_setup_dma(hwif, mem->start);
398
399 idx[0] = i; 411 idx[0] = i;
400 412
401 ide_device_add(idx, &palm_bk3710_port_info); 413 ide_device_add(idx, &palm_bk3710_port_info);
diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c
index 2c3d0ec91dc3..c0581bd98d0d 100644
--- a/drivers/ide/arm/rapide.c
+++ b/drivers/ide/arm/rapide.c
@@ -53,7 +53,6 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
53 53
54 ide_init_port_hw(hwif, &hw); 54 ide_init_port_hw(hwif, &hw);
55 55
56 hwif->mmio = 1;
57 default_hwif_mmiops(hwif); 56 default_hwif_mmiops(hwif);
58 57
59 idx[0] = hwif->index; 58 idx[0] = hwif->index;