diff options
Diffstat (limited to 'drivers/ide/pci/hpt366.c')
-rw-r--r-- | drivers/ide/pci/hpt366.c | 21 |
1 files changed, 11 insertions, 10 deletions
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 | /** |