Lines Matching +full:udma +full:- +full:p
1 // SPDX-License-Identifier: GPL-2.0-only
3 * pata_serverworks.c - Serverworks PATA for new ATA layer
11 * Copyright (C) 1998-2000 Michel Aubry
12 * Copyright (C) 1998-2000 Andrzej Krzysztofowicz
13 * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org>
20 * supports UDMA mode 2 (33 MB/s)
23 * all revisions support UDMA mode 4 (66 MB/s)
24 * revision A2.0 and up support UDMA mode 5 (100 MB/s)
27 * *** to detect 80-conductor cable presence. ***
50 * Seagate Barracuda ATA IV Family drives in UDMA mode 5
62 * oem_cable - Dell/Sun serverworks cable detection
71 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in oem_cable()
73 if (pdev->subsystem_device & (1 << (ap->port_no + 14))) in oem_cable()
97 * serverworks_cable_detect - cable detection
106 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in serverworks_cable_detect()
109 while(cb->device) { in serverworks_cable_detect()
110 if (cb->device == pdev->device && in serverworks_cable_detect()
111 (cb->subvendor == pdev->subsystem_vendor || in serverworks_cable_detect()
112 cb->subvendor == PCI_ANY_ID)) { in serverworks_cable_detect()
113 return cb->cable_detect(ap); in serverworks_cable_detect()
119 return -1; /* kill compiler warning */ in serverworks_cable_detect()
123 * serverworks_is_csb - Check for CSB or OSB
132 switch (pdev->device) { in serverworks_is_csb()
145 * serverworks_osb4_filter - mode selection filter
150 * specific rules. OSB4 requires no UDMA for disks due to a FIFO
156 if (adev->class == ATA_DEV_ATA) in serverworks_osb4_filter()
163 * serverworks_csb_filter - mode selection filter
173 const char *p; in serverworks_csb_filter() local
177 /* Disk, UDMA */ in serverworks_csb_filter()
178 if (adev->class != ATA_DEV_ATA) in serverworks_csb_filter()
182 ata_id_c_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num)); in serverworks_csb_filter()
184 for (i = 0; (p = csb_bad_ata100[i]) != NULL; i++) { in serverworks_csb_filter()
185 if (!strcmp(p, model_num)) in serverworks_csb_filter()
192 * serverworks_set_piomode - set initial PIO mode data
202 int offset = 1 + 2 * ap->port_no - adev->devno; in serverworks_set_piomode()
203 int devbits = (2 * ap->port_no + adev->devno) * 4; in serverworks_set_piomode()
205 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in serverworks_set_piomode()
206 int pio = adev->pio_mode - XFER_PIO_0; in serverworks_set_piomode()
220 * serverworks_set_dmamode - set initial DMA mode data
224 * Program the MWDMA/UDMA modes for the serverworks OSB4/CSB5
226 * while the chipset uses mode number for UDMA.
232 int offset = 1 + 2 * ap->port_no - adev->devno; in serverworks_set_dmamode()
233 int devbits = 2 * ap->port_no + adev->devno; in serverworks_set_dmamode()
236 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in serverworks_set_dmamode()
239 pci_read_config_byte(pdev, 0x56 + ap->port_no, &ultra); in serverworks_set_dmamode()
240 ultra &= ~(0x0F << (adev->devno * 4)); in serverworks_set_dmamode()
242 if (adev->dma_mode >= XFER_UDMA_0) { in serverworks_set_dmamode()
245 ultra |= (adev->dma_mode - XFER_UDMA_0) in serverworks_set_dmamode()
246 << (adev->devno * 4); in serverworks_set_dmamode()
250 dma_mode[adev->dma_mode - XFER_MW_DMA_0]); in serverworks_set_dmamode()
253 pci_write_config_byte(pdev, 0x56 + ap->port_no, ultra); in serverworks_set_dmamode()
291 dev_info(&pdev->dev, "UDMA not BIOS enabled.\n"); in serverworks_fixup_osb4()
292 reg |= 0x00004000; /* enable UDMA/33 support */ in serverworks_fixup_osb4()
297 dev_warn(&pdev->dev, "Unable to find bridge.\n"); in serverworks_fixup_osb4()
298 return -ENODEV; in serverworks_fixup_osb4()
306 if (!(PCI_FUNC(pdev->devfn) & 1)) { in serverworks_fixup_csb()
332 /* setup the UDMA Control register in serverworks_fixup_csb()
335 * 2. enable DMA modes with bits 0-1 in serverworks_fixup_csb()
343 if (!(PCI_FUNC(pdev->devfn) & 1)) in serverworks_fixup_csb()
346 btr |= (pdev->revision >= SVWKS_CSB5_REVISION_NEW) ? 0x3 : 0x2; in serverworks_fixup_csb()
355 /* Setup HT1000 SouthBridge Controller - Single Channel Only */ in serverworks_fixup_ht1000()
369 switch (pdev->device) { in serverworks_fixup()
397 }, { /* OSB4 no UDMA */ in serverworks_init_one()
401 /* No UDMA */ in serverworks_init_one()
409 }, { /* CSB5 - later revisions*/ in serverworks_init_one()
417 const struct ata_port_info *ppi[] = { &info[id->driver_data], NULL }; in serverworks_init_one()
428 if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { in serverworks_init_one()
429 /* Select non UDMA capable OSB4 if we can't do fixups */ in serverworks_init_one()
435 else if ((pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) || in serverworks_init_one()
436 (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) || in serverworks_init_one()
437 (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) { in serverworks_init_one()
445 if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2) in serverworks_init_one()
493 MODULE_DESCRIPTION("low-level driver for Serverworks OSB4/CSB5/CSB6");