Lines Matching +full:drive +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 1998-2000 Michel Aubry
4 * Copyright (C) 1998-2000 Andrzej Krzysztofowicz
5 * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org>
6 * Copyright (C) 2007-2010 Bartlomiej Zolnierkiewicz
13 * supports UDMA mode 2 (33 MB/s)
16 * all revisions support UDMA mode 4 (66 MB/s)
17 * revision A2.0 and up support UDMA mode 5 (100 MB/s)
20 * *** to detect 80-conductor cable presence. ***
24 * HT1000: AKA BCM5785 - Hypertransport Southbridge for Opteron systems. IDE
46 /* Seagate Barracuda ATA IV Family drives in UDMA mode 5
56 static int check_in_drive_lists (ide_drive_t *drive, const char **list) in check_in_drive_lists() argument
58 char *m = (char *)&drive->id[ATA_ID_PROD]; in check_in_drive_lists()
66 static u8 svwks_udma_filter(ide_drive_t *drive) in svwks_udma_filter() argument
68 struct pci_dev *dev = to_pci_dev(drive->hwif->dev); in svwks_udma_filter()
70 if (dev->device == PCI_DEVICE_ID_SERVERWORKS_HT1000IDE) { in svwks_udma_filter()
72 } else if (dev->revision < SVWKS_CSB5_REVISION_NEW) { in svwks_udma_filter()
75 u8 btr = 0, mode, mask; in svwks_udma_filter() local
78 mode = btr & 0x3; in svwks_udma_filter()
82 if (mode > 2 && check_in_drive_lists(drive, svwks_bad_ata100)) in svwks_udma_filter()
83 mode = 2; in svwks_udma_filter()
85 switch(mode) { in svwks_udma_filter()
98 switch (dev->device) { in svwks_csb_check()
110 static void svwks_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive) in svwks_set_pio_mode() argument
115 struct pci_dev *dev = to_pci_dev(hwif->dev); in svwks_set_pio_mode()
116 const u8 pio = drive->pio_mode - XFER_PIO_0; in svwks_set_pio_mode()
118 if (drive->dn >= ARRAY_SIZE(drive_pci)) in svwks_set_pio_mode()
121 pci_write_config_byte(dev, drive_pci[drive->dn], pio_modes[pio]); in svwks_set_pio_mode()
128 csb_pio &= ~(0x0f << (4 * drive->dn)); in svwks_set_pio_mode()
129 csb_pio |= (pio << (4 * drive->dn)); in svwks_set_pio_mode()
135 static void svwks_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive) in svwks_set_dma_mode() argument
141 struct pci_dev *dev = to_pci_dev(hwif->dev); in svwks_set_dma_mode()
142 const u8 speed = drive->dma_mode; in svwks_set_dma_mode()
143 u8 unit = drive->dn & 1; in svwks_set_dma_mode()
147 if (drive->dn >= ARRAY_SIZE(drive_pci2)) in svwks_set_dma_mode()
150 pci_read_config_byte(dev, (0x56|hwif->channel), &ultra_timing); in svwks_set_dma_mode()
154 ultra_enable &= ~(0x01 << drive->dn); in svwks_set_dma_mode()
158 ultra_timing |= (udma_modes[speed - XFER_UDMA_0] << (4 * unit)); in svwks_set_dma_mode()
159 ultra_enable |= (0x01 << drive->dn); in svwks_set_dma_mode()
161 dma_timing |= dma_modes[speed - XFER_MW_DMA_0]; in svwks_set_dma_mode()
163 pci_write_config_byte(dev, drive_pci2[drive->dn], dma_timing); in svwks_set_dma_mode()
164 pci_write_config_byte(dev, (0x56|hwif->channel), ultra_timing); in svwks_set_dma_mode()
177 if (dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { in init_chipset_svwks()
194 else if ((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) || in init_chipset_svwks()
195 (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) || in init_chipset_svwks()
196 (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) { in init_chipset_svwks()
199 if (!(PCI_FUNC(dev->devfn) & 1)) { in init_chipset_svwks()
213 dev->irq = inb_p(0x0c01); in init_chipset_svwks()
228 * Since there will be a future raid mode, in init_chipset_svwks()
231 * mode issue. in init_chipset_svwks()
233 if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE) in init_chipset_svwks()
234 dev->irq = 0; in init_chipset_svwks()
243 * 2. enable DMA modes with bits 0-1 in init_chipset_svwks()
251 if (!(PCI_FUNC(dev->devfn) & 1)) in init_chipset_svwks()
254 btr |= (dev->revision >= SVWKS_CSB5_REVISION_NEW) ? 0x3 : 0x2; in init_chipset_svwks()
257 /* Setup HT1000 SouthBridge Controller - Single Channel Only */ in init_chipset_svwks()
258 else if (dev->device == PCI_DEVICE_ID_SERVERWORKS_HT1000IDE) { in init_chipset_svwks()
274 * of the subsystem device ID indicate presence of an 80-pin cable.
275 * Bit 15 clear = secondary IDE channel does not have 80-pin cable.
276 * Bit 15 set = secondary IDE channel has 80-pin cable.
277 * Bit 14 clear = primary IDE channel does not have 80-pin cable.
278 * Bit 14 set = primary IDE channel has 80-pin cable.
282 struct pci_dev *dev = to_pci_dev(hwif->dev); in ata66_svwks_dell()
284 if (dev->subsystem_vendor == PCI_VENDOR_ID_DELL && in ata66_svwks_dell()
285 dev->vendor == PCI_VENDOR_ID_SERVERWORKS && in ata66_svwks_dell()
286 (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE || in ata66_svwks_dell()
287 dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE)) in ata66_svwks_dell()
288 return ((1 << (hwif->channel + 14)) & in ata66_svwks_dell()
289 dev->subsystem_device) ? ATA_CBL_PATA80 : ATA_CBL_PATA40; in ata66_svwks_dell()
293 /* Sun Cobalt Alpine hardware avoids the 80-pin cable
301 struct pci_dev *dev = to_pci_dev(hwif->dev); in ata66_svwks_cobalt()
303 if (dev->subsystem_vendor == PCI_VENDOR_ID_SUN && in ata66_svwks_cobalt()
304 dev->vendor == PCI_VENDOR_ID_SERVERWORKS && in ata66_svwks_cobalt()
305 dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) in ata66_svwks_cobalt()
306 return ((1 << (hwif->channel + 14)) & in ata66_svwks_cobalt()
307 dev->subsystem_device) ? ATA_CBL_PATA80 : ATA_CBL_PATA40; in ata66_svwks_cobalt()
313 struct pci_dev *dev = to_pci_dev(hwif->dev); in svwks_cable_detect()
316 if (dev->subsystem_vendor == PCI_VENDOR_ID_SERVERWORKS) in svwks_cable_detect()
320 if (dev->subsystem_vendor == PCI_VENDOR_ID_DELL) in svwks_cable_detect()
324 if (dev->subsystem_vendor == PCI_VENDOR_ID_SUN) in svwks_cable_detect()
328 if ((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) || in svwks_cable_detect()
329 (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) in svwks_cable_detect()
372 { /* 3: CSB6-2 */
393 * svwks_init_one - called when a OSB/CSB is found
404 u8 idx = id->driver_data; in svwks_init_one()
411 if ((PCI_FUNC(dev->devfn) & 1) == 0) { in svwks_init_one()