diff options
-rw-r--r-- | drivers/ide/ide-dma.c | 7 | ||||
-rw-r--r-- | drivers/ide/ide.c | 2 | ||||
-rw-r--r-- | drivers/ide/pci/cmd64x.c | 8 | ||||
-rw-r--r-- | drivers/ide/pci/hpt366.c | 21 | ||||
-rw-r--r-- | drivers/ide/pci/pdc202xx_old.c | 12 | ||||
-rw-r--r-- | include/linux/ide.h | 1 |
6 files changed, 22 insertions, 29 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 4703837bf1fc..7568c3e81f2f 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -968,11 +968,6 @@ void ide_setup_dma(ide_hwif_t *hwif, unsigned long base, unsigned num_ports) | |||
968 | 968 | ||
969 | hwif->dma_base = base; | 969 | hwif->dma_base = base; |
970 | 970 | ||
971 | if (hwif->mate) | ||
972 | hwif->dma_master = hwif->channel ? hwif->mate->dma_base : base; | ||
973 | else | ||
974 | hwif->dma_master = base; | ||
975 | |||
976 | if (!(hwif->dma_command)) | 971 | if (!(hwif->dma_command)) |
977 | hwif->dma_command = hwif->dma_base; | 972 | hwif->dma_command = hwif->dma_base; |
978 | if (!(hwif->dma_vendor1)) | 973 | if (!(hwif->dma_vendor1)) |
@@ -1014,8 +1009,6 @@ void ide_setup_dma(ide_hwif_t *hwif, unsigned long base, unsigned num_ports) | |||
1014 | hwif->drives[1].name, (dma_stat & 0x40) ? "DMA" : "pio"); | 1009 | hwif->drives[1].name, (dma_stat & 0x40) ? "DMA" : "pio"); |
1015 | } | 1010 | } |
1016 | printk("\n"); | 1011 | printk("\n"); |
1017 | |||
1018 | BUG_ON(!hwif->dma_master); | ||
1019 | } | 1012 | } |
1020 | 1013 | ||
1021 | EXPORT_SYMBOL_GPL(ide_setup_dma); | 1014 | EXPORT_SYMBOL_GPL(ide_setup_dma); |
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 54943da6e4e5..9ab5458fe950 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -468,7 +468,6 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif) | |||
468 | #endif | 468 | #endif |
469 | 469 | ||
470 | hwif->dma_base = tmp_hwif->dma_base; | 470 | hwif->dma_base = tmp_hwif->dma_base; |
471 | hwif->dma_master = tmp_hwif->dma_master; | ||
472 | hwif->dma_command = tmp_hwif->dma_command; | 471 | hwif->dma_command = tmp_hwif->dma_command; |
473 | hwif->dma_vendor1 = tmp_hwif->dma_vendor1; | 472 | hwif->dma_vendor1 = tmp_hwif->dma_vendor1; |
474 | hwif->dma_status = tmp_hwif->dma_status; | 473 | hwif->dma_status = tmp_hwif->dma_status; |
@@ -602,7 +601,6 @@ void ide_unregister(unsigned int index) | |||
602 | (void) ide_release_dma(hwif); | 601 | (void) ide_release_dma(hwif); |
603 | 602 | ||
604 | hwif->dma_base = 0; | 603 | hwif->dma_base = 0; |
605 | hwif->dma_master = 0; | ||
606 | hwif->dma_command = 0; | 604 | hwif->dma_command = 0; |
607 | hwif->dma_vendor1 = 0; | 605 | hwif->dma_vendor1 = 0; |
608 | hwif->dma_status = 0; | 606 | hwif->dma_status = 0; |
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c index bc553337b1be..f3613bac9dbe 100644 --- a/drivers/ide/pci/cmd64x.c +++ b/drivers/ide/pci/cmd64x.c | |||
@@ -333,14 +333,15 @@ static void cmd64x_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
333 | static int cmd648_ide_dma_end (ide_drive_t *drive) | 333 | static int cmd648_ide_dma_end (ide_drive_t *drive) |
334 | { | 334 | { |
335 | ide_hwif_t *hwif = HWIF(drive); | 335 | ide_hwif_t *hwif = HWIF(drive); |
336 | unsigned long base = hwif->dma_base - (hwif->channel * 8); | ||
336 | int err = __ide_dma_end(drive); | 337 | int err = __ide_dma_end(drive); |
337 | u8 irq_mask = hwif->channel ? MRDMODE_INTR_CH1 : | 338 | u8 irq_mask = hwif->channel ? MRDMODE_INTR_CH1 : |
338 | MRDMODE_INTR_CH0; | 339 | MRDMODE_INTR_CH0; |
339 | u8 mrdmode = inb(hwif->dma_master + 0x01); | 340 | u8 mrdmode = inb(base + 1); |
340 | 341 | ||
341 | /* clear the interrupt bit */ | 342 | /* clear the interrupt bit */ |
342 | outb((mrdmode & ~(MRDMODE_INTR_CH0 | MRDMODE_INTR_CH1)) | irq_mask, | 343 | outb((mrdmode & ~(MRDMODE_INTR_CH0 | MRDMODE_INTR_CH1)) | irq_mask, |
343 | hwif->dma_master + 0x01); | 344 | base + 1); |
344 | 345 | ||
345 | return err; | 346 | return err; |
346 | } | 347 | } |
@@ -365,10 +366,11 @@ static int cmd64x_ide_dma_end (ide_drive_t *drive) | |||
365 | static int cmd648_ide_dma_test_irq (ide_drive_t *drive) | 366 | static int cmd648_ide_dma_test_irq (ide_drive_t *drive) |
366 | { | 367 | { |
367 | ide_hwif_t *hwif = HWIF(drive); | 368 | ide_hwif_t *hwif = HWIF(drive); |
369 | unsigned long base = hwif->dma_base - (hwif->channel * 8); | ||
368 | u8 irq_mask = hwif->channel ? MRDMODE_INTR_CH1 : | 370 | u8 irq_mask = hwif->channel ? MRDMODE_INTR_CH1 : |
369 | MRDMODE_INTR_CH0; | 371 | MRDMODE_INTR_CH0; |
370 | u8 dma_stat = inb(hwif->dma_status); | 372 | u8 dma_stat = inb(hwif->dma_status); |
371 | u8 mrdmode = inb(hwif->dma_master + 0x01); | 373 | u8 mrdmode = inb(base + 1); |
372 | 374 | ||
373 | #ifdef DEBUG | 375 | #ifdef DEBUG |
374 | printk("%s: dma_stat: 0x%02x mrdmode: 0x%02x irq_mask: 0x%02x\n", | 376 | printk("%s: dma_stat: 0x%02x mrdmode: 0x%02x irq_mask: 0x%02x\n", |
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index df14d692743c..d3826a66834d 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c | |||
@@ -894,32 +894,33 @@ static int hpt374_ide_dma_end(ide_drive_t *drive) | |||
894 | 894 | ||
895 | static void hpt3xxn_set_clock(ide_hwif_t *hwif, u8 mode) | 895 | static void hpt3xxn_set_clock(ide_hwif_t *hwif, u8 mode) |
896 | { | 896 | { |
897 | u8 scr2 = inb(hwif->dma_master + 0x7b); | 897 | unsigned long base = hwif->extra_base; |
898 | u8 scr2 = inb(base + 0x6b); | ||
898 | 899 | ||
899 | if ((scr2 & 0x7f) == mode) | 900 | if ((scr2 & 0x7f) == mode) |
900 | return; | 901 | return; |
901 | 902 | ||
902 | /* Tristate the bus */ | 903 | /* Tristate the bus */ |
903 | outb(0x80, hwif->dma_master + 0x73); | 904 | outb(0x80, base + 0x63); |
904 | outb(0x80, hwif->dma_master + 0x77); | 905 | outb(0x80, base + 0x67); |
905 | 906 | ||
906 | /* Switch clock and reset channels */ | 907 | /* Switch clock and reset channels */ |
907 | outb(mode, hwif->dma_master + 0x7b); | 908 | outb(mode, base + 0x6b); |
908 | outb(0xc0, hwif->dma_master + 0x79); | 909 | outb(0xc0, base + 0x69); |
909 | 910 | ||
910 | /* | 911 | /* |
911 | * Reset the state machines. | 912 | * Reset the state machines. |
912 | * NOTE: avoid accidentally enabling the disabled channels. | 913 | * NOTE: avoid accidentally enabling the disabled channels. |
913 | */ | 914 | */ |
914 | outb(inb(hwif->dma_master + 0x70) | 0x32, hwif->dma_master + 0x70); | 915 | outb(inb(base + 0x60) | 0x32, base + 0x60); |
915 | outb(inb(hwif->dma_master + 0x74) | 0x32, hwif->dma_master + 0x74); | 916 | outb(inb(base + 0x64) | 0x32, base + 0x64); |
916 | 917 | ||
917 | /* Complete reset */ | 918 | /* Complete reset */ |
918 | outb(0x00, hwif->dma_master + 0x79); | 919 | outb(0x00, base + 0x69); |
919 | 920 | ||
920 | /* Reconnect channels to bus */ | 921 | /* Reconnect channels to bus */ |
921 | outb(0x00, hwif->dma_master + 0x73); | 922 | outb(0x00, base + 0x63); |
922 | outb(0x00, hwif->dma_master + 0x77); | 923 | outb(0x00, base + 0x67); |
923 | } | 924 | } |
924 | 925 | ||
925 | /** | 926 | /** |
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c index e09742e2ba59..22c7a7533b69 100644 --- a/drivers/ide/pci/pdc202xx_old.c +++ b/drivers/ide/pci/pdc202xx_old.c | |||
@@ -162,7 +162,7 @@ static u8 pdc202xx_old_cable_detect (ide_hwif_t *hwif) | |||
162 | */ | 162 | */ |
163 | static void pdc_old_enable_66MHz_clock(ide_hwif_t *hwif) | 163 | static void pdc_old_enable_66MHz_clock(ide_hwif_t *hwif) |
164 | { | 164 | { |
165 | unsigned long clock_reg = hwif->dma_master + 0x11; | 165 | unsigned long clock_reg = hwif->extra_base + 0x01; |
166 | u8 clock = inb(clock_reg); | 166 | u8 clock = inb(clock_reg); |
167 | 167 | ||
168 | outb(clock | (hwif->channel ? 0x08 : 0x02), clock_reg); | 168 | outb(clock | (hwif->channel ? 0x08 : 0x02), clock_reg); |
@@ -170,7 +170,7 @@ static void pdc_old_enable_66MHz_clock(ide_hwif_t *hwif) | |||
170 | 170 | ||
171 | static void pdc_old_disable_66MHz_clock(ide_hwif_t *hwif) | 171 | static void pdc_old_disable_66MHz_clock(ide_hwif_t *hwif) |
172 | { | 172 | { |
173 | unsigned long clock_reg = hwif->dma_master + 0x11; | 173 | unsigned long clock_reg = hwif->extra_base + 0x01; |
174 | u8 clock = inb(clock_reg); | 174 | u8 clock = inb(clock_reg); |
175 | 175 | ||
176 | outb(clock & ~(hwif->channel ? 0x08 : 0x02), clock_reg); | 176 | outb(clock & ~(hwif->channel ? 0x08 : 0x02), clock_reg); |
@@ -193,7 +193,7 @@ static void pdc202xx_old_ide_dma_start(ide_drive_t *drive) | |||
193 | if (drive->media != ide_disk || drive->addressing == 1) { | 193 | if (drive->media != ide_disk || drive->addressing == 1) { |
194 | struct request *rq = HWGROUP(drive)->rq; | 194 | struct request *rq = HWGROUP(drive)->rq; |
195 | ide_hwif_t *hwif = HWIF(drive); | 195 | ide_hwif_t *hwif = HWIF(drive); |
196 | unsigned long high_16 = hwif->dma_master; | 196 | unsigned long high_16 = hwif->extra_base - 16; |
197 | unsigned long atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20); | 197 | unsigned long atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20); |
198 | u32 word_count = 0; | 198 | u32 word_count = 0; |
199 | u8 clock = inb(high_16 + 0x11); | 199 | u8 clock = inb(high_16 + 0x11); |
@@ -212,7 +212,7 @@ static int pdc202xx_old_ide_dma_end(ide_drive_t *drive) | |||
212 | { | 212 | { |
213 | if (drive->media != ide_disk || drive->addressing == 1) { | 213 | if (drive->media != ide_disk || drive->addressing == 1) { |
214 | ide_hwif_t *hwif = HWIF(drive); | 214 | ide_hwif_t *hwif = HWIF(drive); |
215 | unsigned long high_16 = hwif->dma_master; | 215 | unsigned long high_16 = hwif->extra_base - 16; |
216 | unsigned long atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20); | 216 | unsigned long atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20); |
217 | u8 clock = 0; | 217 | u8 clock = 0; |
218 | 218 | ||
@@ -228,7 +228,7 @@ static int pdc202xx_old_ide_dma_end(ide_drive_t *drive) | |||
228 | static int pdc202xx_old_ide_dma_test_irq(ide_drive_t *drive) | 228 | static int pdc202xx_old_ide_dma_test_irq(ide_drive_t *drive) |
229 | { | 229 | { |
230 | ide_hwif_t *hwif = HWIF(drive); | 230 | ide_hwif_t *hwif = HWIF(drive); |
231 | unsigned long high_16 = hwif->dma_master; | 231 | unsigned long high_16 = hwif->extra_base - 16; |
232 | u8 dma_stat = inb(hwif->dma_status); | 232 | u8 dma_stat = inb(hwif->dma_status); |
233 | u8 sc1d = inb(high_16 + 0x001d); | 233 | u8 sc1d = inb(high_16 + 0x001d); |
234 | 234 | ||
@@ -271,7 +271,7 @@ static void pdc202xx_dma_timeout(ide_drive_t *drive) | |||
271 | 271 | ||
272 | static void pdc202xx_reset_host (ide_hwif_t *hwif) | 272 | static void pdc202xx_reset_host (ide_hwif_t *hwif) |
273 | { | 273 | { |
274 | unsigned long high_16 = hwif->dma_master; | 274 | unsigned long high_16 = hwif->extra_base - 16; |
275 | u8 udma_speed_flag = inb(high_16 | 0x001f); | 275 | u8 udma_speed_flag = inb(high_16 | 0x001f); |
276 | 276 | ||
277 | outb(udma_speed_flag | 0x10, high_16 | 0x001f); | 277 | outb(udma_speed_flag | 0x10, high_16 | 0x001f); |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 9a6a41e7079f..1fb03b630676 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -766,7 +766,6 @@ typedef struct hwif_s { | |||
766 | int rqsize; /* max sectors per request */ | 766 | int rqsize; /* max sectors per request */ |
767 | int irq; /* our irq number */ | 767 | int irq; /* our irq number */ |
768 | 768 | ||
769 | unsigned long dma_master; /* reference base addr dmabase */ | ||
770 | unsigned long dma_base; /* base addr for dma ports */ | 769 | unsigned long dma_base; /* base addr for dma ports */ |
771 | unsigned long dma_command; /* dma command register */ | 770 | unsigned long dma_command; /* dma command register */ |
772 | unsigned long dma_vendor1; /* dma vendor 1 register */ | 771 | unsigned long dma_vendor1; /* dma vendor 1 register */ |