diff options
Diffstat (limited to 'drivers/ide/pci/tc86c001.c')
-rw-r--r-- | drivers/ide/pci/tc86c001.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/ide/pci/tc86c001.c b/drivers/ide/pci/tc86c001.c index de62db576adc..631506e9b5d2 100644 --- a/drivers/ide/pci/tc86c001.c +++ b/drivers/ide/pci/tc86c001.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * drivers/ide/pci/tc86c001.c Version 1.00 Dec 12, 2006 | 2 | * drivers/ide/pci/tc86c001.c Version 1.01 Sep 5, 2007 |
3 | * | 3 | * |
4 | * Copyright (C) 2002 Toshiba Corporation | 4 | * Copyright (C) 2002 Toshiba Corporation |
5 | * Copyright (C) 2005-2006 MontaVista Software, Inc. <source@mvista.com> | 5 | * Copyright (C) 2005-2006 MontaVista Software, Inc. <source@mvista.com> |
@@ -17,7 +17,7 @@ static void tc86c001_set_mode(ide_drive_t *drive, const u8 speed) | |||
17 | { | 17 | { |
18 | ide_hwif_t *hwif = HWIF(drive); | 18 | ide_hwif_t *hwif = HWIF(drive); |
19 | unsigned long scr_port = hwif->config_data + (drive->dn ? 0x02 : 0x00); | 19 | unsigned long scr_port = hwif->config_data + (drive->dn ? 0x02 : 0x00); |
20 | u16 mode, scr = hwif->INW(scr_port); | 20 | u16 mode, scr = inw(scr_port); |
21 | 21 | ||
22 | switch (speed) { | 22 | switch (speed) { |
23 | case XFER_UDMA_4: mode = 0x00c0; break; | 23 | case XFER_UDMA_4: mode = 0x00c0; break; |
@@ -65,7 +65,7 @@ static int tc86c001_timer_expiry(ide_drive_t *drive) | |||
65 | ide_hwif_t *hwif = HWIF(drive); | 65 | ide_hwif_t *hwif = HWIF(drive); |
66 | ide_expiry_t *expiry = ide_get_hwifdata(hwif); | 66 | ide_expiry_t *expiry = ide_get_hwifdata(hwif); |
67 | ide_hwgroup_t *hwgroup = HWGROUP(drive); | 67 | ide_hwgroup_t *hwgroup = HWGROUP(drive); |
68 | u8 dma_stat = hwif->INB(hwif->dma_status); | 68 | u8 dma_stat = inb(hwif->dma_status); |
69 | 69 | ||
70 | /* Restore a higher level driver's expiry handler first. */ | 70 | /* Restore a higher level driver's expiry handler first. */ |
71 | hwgroup->expiry = expiry; | 71 | hwgroup->expiry = expiry; |
@@ -73,7 +73,7 @@ static int tc86c001_timer_expiry(ide_drive_t *drive) | |||
73 | if ((dma_stat & 5) == 1) { /* DMA active and no interrupt */ | 73 | if ((dma_stat & 5) == 1) { /* DMA active and no interrupt */ |
74 | unsigned long sc_base = hwif->config_data; | 74 | unsigned long sc_base = hwif->config_data; |
75 | unsigned long twcr_port = sc_base + (drive->dn ? 0x06 : 0x04); | 75 | unsigned long twcr_port = sc_base + (drive->dn ? 0x06 : 0x04); |
76 | u8 dma_cmd = hwif->INB(hwif->dma_command); | 76 | u8 dma_cmd = inb(hwif->dma_command); |
77 | 77 | ||
78 | printk(KERN_WARNING "%s: DMA interrupt possibly stuck, " | 78 | printk(KERN_WARNING "%s: DMA interrupt possibly stuck, " |
79 | "attempting recovery...\n", drive->name); | 79 | "attempting recovery...\n", drive->name); |
@@ -135,7 +135,7 @@ static int tc86c001_busproc(ide_drive_t *drive, int state) | |||
135 | u16 scr1; | 135 | u16 scr1; |
136 | 136 | ||
137 | /* System Control 1 Register bit 11 (ATA Hard Reset) read */ | 137 | /* System Control 1 Register bit 11 (ATA Hard Reset) read */ |
138 | scr1 = hwif->INW(sc_base + 0x00); | 138 | scr1 = inw(sc_base + 0x00); |
139 | 139 | ||
140 | switch (state) { | 140 | switch (state) { |
141 | case BUSSTATE_ON: | 141 | case BUSSTATE_ON: |
@@ -165,7 +165,7 @@ static int tc86c001_busproc(ide_drive_t *drive, int state) | |||
165 | static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) | 165 | static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) |
166 | { | 166 | { |
167 | unsigned long sc_base = pci_resource_start(hwif->pci_dev, 5); | 167 | unsigned long sc_base = pci_resource_start(hwif->pci_dev, 5); |
168 | u16 scr1 = hwif->INW(sc_base + 0x00);; | 168 | u16 scr1 = inw(sc_base + 0x00); |
169 | 169 | ||
170 | /* System Control 1 Register bit 15 (Soft Reset) set */ | 170 | /* System Control 1 Register bit 15 (Soft Reset) set */ |
171 | outw(scr1 | 0x8000, sc_base + 0x00); | 171 | outw(scr1 | 0x8000, sc_base + 0x00); |
@@ -184,8 +184,6 @@ static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) | |||
184 | 184 | ||
185 | hwif->busproc = &tc86c001_busproc; | 185 | hwif->busproc = &tc86c001_busproc; |
186 | 186 | ||
187 | hwif->drives[0].autotune = hwif->drives[1].autotune = 1; | ||
188 | |||
189 | if (!hwif->dma_base) | 187 | if (!hwif->dma_base) |
190 | return; | 188 | return; |
191 | 189 | ||
@@ -198,10 +196,6 @@ static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) | |||
198 | /* Sector Count Register limit */ | 196 | /* Sector Count Register limit */ |
199 | hwif->rqsize = 0xffff; | 197 | hwif->rqsize = 0xffff; |
200 | 198 | ||
201 | hwif->atapi_dma = 1; | ||
202 | hwif->ultra_mask = 0x1f; | ||
203 | hwif->mwdma_mask = 0x07; | ||
204 | |||
205 | hwif->dma_start = &tc86c001_dma_start; | 199 | hwif->dma_start = &tc86c001_dma_start; |
206 | 200 | ||
207 | if (hwif->cbl != ATA_CBL_PATA40_SHORT) { | 201 | if (hwif->cbl != ATA_CBL_PATA40_SHORT) { |
@@ -209,7 +203,7 @@ static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) | |||
209 | * System Control 1 Register bit 13 (PDIAGN): | 203 | * System Control 1 Register bit 13 (PDIAGN): |
210 | * 0=80-pin cable, 1=40-pin cable | 204 | * 0=80-pin cable, 1=40-pin cable |
211 | */ | 205 | */ |
212 | scr1 = hwif->INW(sc_base + 0x00); | 206 | scr1 = inw(sc_base + 0x00); |
213 | hwif->cbl = (scr1 & 0x2000) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; | 207 | hwif->cbl = (scr1 & 0x2000) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; |
214 | } | 208 | } |
215 | } | 209 | } |
@@ -228,10 +222,10 @@ static ide_pci_device_t tc86c001_chipset __devinitdata = { | |||
228 | .name = "TC86C001", | 222 | .name = "TC86C001", |
229 | .init_chipset = init_chipset_tc86c001, | 223 | .init_chipset = init_chipset_tc86c001, |
230 | .init_hwif = init_hwif_tc86c001, | 224 | .init_hwif = init_hwif_tc86c001, |
231 | .autodma = AUTODMA, | 225 | .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_OFF_BOARD, |
232 | .bootable = OFF_BOARD, | ||
233 | .host_flags = IDE_HFLAG_SINGLE, | ||
234 | .pio_mask = ATA_PIO4, | 226 | .pio_mask = ATA_PIO4, |
227 | .mwdma_mask = ATA_MWDMA2, | ||
228 | .udma_mask = ATA_UDMA4, | ||
235 | }; | 229 | }; |
236 | 230 | ||
237 | static int __devinit tc86c001_init_one(struct pci_dev *dev, | 231 | static int __devinit tc86c001_init_one(struct pci_dev *dev, |