diff options
Diffstat (limited to 'drivers/ide/arm/bast-ide.c')
-rw-r--r-- | drivers/ide/arm/bast-ide.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/ide/arm/bast-ide.c b/drivers/ide/arm/bast-ide.c index ec46c44b061c..713cef20622e 100644 --- a/drivers/ide/arm/bast-ide.c +++ b/drivers/ide/arm/bast-ide.c | |||
@@ -21,6 +21,8 @@ | |||
21 | #include <asm/arch/bast-map.h> | 21 | #include <asm/arch/bast-map.h> |
22 | #include <asm/arch/bast-irq.h> | 22 | #include <asm/arch/bast-irq.h> |
23 | 23 | ||
24 | #define DRV_NAME "bast-ide" | ||
25 | |||
24 | static int __init bastide_register(unsigned int base, unsigned int aux, int irq) | 26 | static int __init bastide_register(unsigned int base, unsigned int aux, int irq) |
25 | { | 27 | { |
26 | ide_hwif_t *hwif; | 28 | ide_hwif_t *hwif; |
@@ -33,27 +35,23 @@ static int __init bastide_register(unsigned int base, unsigned int aux, int irq) | |||
33 | base += BAST_IDE_CS; | 35 | base += BAST_IDE_CS; |
34 | aux += BAST_IDE_CS; | 36 | aux += BAST_IDE_CS; |
35 | 37 | ||
36 | for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { | 38 | for (i = 0; i <= 7; i++) { |
37 | hw.io_ports[i] = (unsigned long)base; | 39 | hw.io_ports_array[i] = (unsigned long)base; |
38 | base += 0x20; | 40 | base += 0x20; |
39 | } | 41 | } |
40 | 42 | ||
41 | hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20); | 43 | hw.io_ports.ctl_addr = aux + (6 * 0x20); |
42 | hw.irq = irq; | 44 | hw.irq = irq; |
43 | 45 | ||
44 | hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); | 46 | hwif = ide_find_port(); |
45 | if (hwif == NULL) | 47 | if (hwif == NULL) |
46 | goto out; | 48 | goto out; |
47 | 49 | ||
48 | i = hwif->index; | 50 | i = hwif->index; |
49 | 51 | ||
50 | if (hwif->present) | 52 | ide_init_port_data(hwif, i); |
51 | ide_unregister(i); | ||
52 | else | ||
53 | ide_init_port_data(hwif, i); | ||
54 | |||
55 | ide_init_port_hw(hwif, &hw); | 53 | ide_init_port_hw(hwif, &hw); |
56 | hwif->quirkproc = NULL; | 54 | hwif->port_ops = NULL; |
57 | 55 | ||
58 | idx[0] = i; | 56 | idx[0] = i; |
59 | 57 | ||
@@ -64,6 +62,8 @@ out: | |||
64 | 62 | ||
65 | static int __init bastide_init(void) | 63 | static int __init bastide_init(void) |
66 | { | 64 | { |
65 | unsigned long base = BAST_VA_IDEPRI + BAST_IDE_CS; | ||
66 | |||
67 | /* we can treat the VR1000 and the BAST the same */ | 67 | /* we can treat the VR1000 and the BAST the same */ |
68 | 68 | ||
69 | if (!(machine_is_bast() || machine_is_vr1000())) | 69 | if (!(machine_is_bast() || machine_is_vr1000())) |
@@ -71,6 +71,11 @@ static int __init bastide_init(void) | |||
71 | 71 | ||
72 | printk("BAST: IDE driver, (c) 2003-2004 Simtec Electronics\n"); | 72 | printk("BAST: IDE driver, (c) 2003-2004 Simtec Electronics\n"); |
73 | 73 | ||
74 | if (!request_mem_region(base, 0x400000, DRV_NAME)) { | ||
75 | printk(KERN_ERR "%s: resources busy\n", DRV_NAME); | ||
76 | return -EBUSY; | ||
77 | } | ||
78 | |||
74 | bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0); | 79 | bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0); |
75 | bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1); | 80 | bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1); |
76 | 81 | ||