Lines Matching +full:wire +full:- +full:sized

2  * pata_it821x.c 	- IT821x PATA for new ATA layer
35 * o If you write LBA48 sized I/O's (ie > 256 sector) in smart mode
41 * - In pass through mode we do all the work you would expect
42 * - In smart mode the clocking set up is done by the controller generally
44 * - There are a few extra vendor commands that actually talk to the
55 * is a raid volume. Even more cute - the controller can do automated
68 * - ATAPI and other speed filtering
69 * - RAID configuration ioctls
116 * it821x_program - program the PIO/MWDMA registers
128 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in it821x_program()
129 struct it821x_dev *itdev = ap->private_data; in it821x_program()
130 int channel = ap->port_no; in it821x_program()
134 if (itdev->clock_mode == ATA_66) in it821x_program()
143 * it821x_program_udma - program the UDMA registers
156 struct it821x_dev *itdev = ap->private_data; in it821x_program_udma()
157 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in it821x_program_udma()
158 int channel = ap->port_no; in it821x_program_udma()
159 int unit = adev->devno; in it821x_program_udma()
163 if (itdev->clock_mode == ATA_66) in it821x_program_udma()
167 if (itdev->timing10 == 0) in it821x_program_udma()
187 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in it821x_clock_strategy()
188 struct it821x_dev *itdev = ap->private_data; in it821x_clock_strategy()
189 u8 unit = adev->devno; in it821x_clock_strategy()
197 if (itdev->want[0][0] > itdev->want[1][0]) { in it821x_clock_strategy()
198 clock = itdev->want[0][1]; in it821x_clock_strategy()
199 altclock = itdev->want[1][1]; in it821x_clock_strategy()
201 clock = itdev->want[1][1]; in it821x_clock_strategy()
202 altclock = itdev->want[0][1]; in it821x_clock_strategy()
209 /* Nobody cares - keep the same clock */ in it821x_clock_strategy()
213 if (clock == itdev->clock_mode) in it821x_clock_strategy()
218 itdev->clock_mode = ATA_66; in it821x_clock_strategy()
220 itdev->clock_mode = ATA_50; in it821x_clock_strategy()
224 v &= ~(1 << (1 + ap->port_no)); in it821x_clock_strategy()
225 v |= sel << (1 + ap->port_no); in it821x_clock_strategy()
232 if (pair && itdev->udma[1-unit] != UDMA_OFF) { in it821x_clock_strategy()
233 it821x_program_udma(ap, pair, itdev->udma[1-unit]); in it821x_clock_strategy()
234 it821x_program(ap, pair, itdev->pio[1-unit]); in it821x_clock_strategy()
240 if (itdev->udma[unit] != UDMA_OFF) { in it821x_clock_strategy()
241 it821x_program_udma(ap, adev, itdev->udma[unit]); in it821x_clock_strategy()
242 it821x_program(ap, adev, itdev->pio[unit]); in it821x_clock_strategy()
247 * it821x_passthru_set_piomode - set PIO mode data
261 struct it821x_dev *itdev = ap->private_data; in it821x_passthru_set_piomode()
262 int unit = adev->devno; in it821x_passthru_set_piomode()
263 int mode_wanted = adev->pio_mode - XFER_PIO_0; in it821x_passthru_set_piomode()
265 /* We prefer 66Mhz clock for PIO 0-3, don't care for PIO4 */ in it821x_passthru_set_piomode()
266 itdev->want[unit][1] = pio_want[mode_wanted]; in it821x_passthru_set_piomode()
267 itdev->want[unit][0] = 1; /* PIO is lowest priority */ in it821x_passthru_set_piomode()
268 itdev->pio[unit] = pio[mode_wanted]; in it821x_passthru_set_piomode()
270 it821x_program(ap, adev, itdev->pio[unit]); in it821x_passthru_set_piomode()
274 * it821x_passthru_set_dmamode - set initial DMA mode data
292 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in it821x_passthru_set_dmamode()
293 struct it821x_dev *itdev = ap->private_data; in it821x_passthru_set_dmamode()
294 int channel = ap->port_no; in it821x_passthru_set_dmamode()
295 int unit = adev->devno; in it821x_passthru_set_dmamode()
298 if (adev->dma_mode >= XFER_UDMA_0) { in it821x_passthru_set_dmamode()
299 int mode_wanted = adev->dma_mode - XFER_UDMA_0; in it821x_passthru_set_dmamode()
301 itdev->want[unit][1] = udma_want[mode_wanted]; in it821x_passthru_set_dmamode()
302 itdev->want[unit][0] = 3; /* UDMA is high priority */ in it821x_passthru_set_dmamode()
303 itdev->mwdma[unit] = MWDMA_OFF; in it821x_passthru_set_dmamode()
304 itdev->udma[unit] = udma[mode_wanted]; in it821x_passthru_set_dmamode()
306 itdev->udma[unit] |= 0x8080; /* UDMA 5/6 select on */ in it821x_passthru_set_dmamode()
310 if (itdev->timing10) in it821x_passthru_set_dmamode()
316 it821x_program_udma(ap, adev, itdev->udma[unit]); in it821x_passthru_set_dmamode()
318 int mode_wanted = adev->dma_mode - XFER_MW_DMA_0; in it821x_passthru_set_dmamode()
320 itdev->want[unit][1] = mwdma_want[mode_wanted]; in it821x_passthru_set_dmamode()
321 itdev->want[unit][0] = 2; /* MWDMA is low priority */ in it821x_passthru_set_dmamode()
322 itdev->mwdma[unit] = dma[mode_wanted]; in it821x_passthru_set_dmamode()
323 itdev->udma[unit] = UDMA_OFF; in it821x_passthru_set_dmamode()
325 /* UDMA bits off - Revision 0x10 do them in pairs */ in it821x_passthru_set_dmamode()
327 if (itdev->timing10) in it821x_passthru_set_dmamode()
337 * it821x_passthru_bmdma_start - DMA start callback
347 struct ata_port *ap = qc->ap; in it821x_passthru_bmdma_start()
348 struct ata_device *adev = qc->dev; in it821x_passthru_bmdma_start()
349 struct it821x_dev *itdev = ap->private_data; in it821x_passthru_bmdma_start()
350 int unit = adev->devno; in it821x_passthru_bmdma_start()
352 if (itdev->mwdma[unit] != MWDMA_OFF) in it821x_passthru_bmdma_start()
353 it821x_program(ap, adev, itdev->mwdma[unit]); in it821x_passthru_bmdma_start()
354 else if (itdev->udma[unit] != UDMA_OFF && itdev->timing10) in it821x_passthru_bmdma_start()
355 it821x_program_udma(ap, adev, itdev->udma[unit]); in it821x_passthru_bmdma_start()
360 * it821x_passthru_bmdma_stop - DMA stop callback
370 struct ata_port *ap = qc->ap; in it821x_passthru_bmdma_stop()
371 struct ata_device *adev = qc->dev; in it821x_passthru_bmdma_stop()
372 struct it821x_dev *itdev = ap->private_data; in it821x_passthru_bmdma_stop()
373 int unit = adev->devno; in it821x_passthru_bmdma_stop()
376 if (itdev->mwdma[unit] != MWDMA_OFF) in it821x_passthru_bmdma_stop()
377 it821x_program(ap, adev, itdev->pio[unit]); in it821x_passthru_bmdma_stop()
382 * it821x_passthru_dev_select - Select master/slave
392 struct it821x_dev *itdev = ap->private_data; in it821x_passthru_dev_select()
393 if (itdev && device != itdev->last_device) { in it821x_passthru_dev_select()
394 struct ata_device *adev = &ap->link.device[device]; in it821x_passthru_dev_select()
395 it821x_program(ap, adev, itdev->pio[adev->devno]); in it821x_passthru_dev_select()
396 itdev->last_device = device; in it821x_passthru_dev_select()
402 * it821x_smart_qc_issue - wrap qc issue prot
412 switch(qc->tf.command) in it821x_smart_qc_issue()
430 /* Arguably should just no-op this one */ in it821x_smart_qc_issue()
434 ata_dev_dbg(qc->dev, "it821x: can't process command 0x%02X\n", in it821x_smart_qc_issue()
435 qc->tf.command); in it821x_smart_qc_issue()
440 * it821x_passthru_qc_issue - wrap qc issue prot
450 it821x_passthru_dev_select(qc->ap, qc->dev->devno); in it821x_passthru_qc_issue()
455 * it821x_smart_set_mode - mode setting
471 dev->pio_mode = XFER_PIO_0; in it821x_smart_set_mode()
472 dev->dma_mode = XFER_MW_DMA_0; in it821x_smart_set_mode()
475 if (ata_id_has_dma(dev->id)) { in it821x_smart_set_mode()
477 dev->xfer_mode = XFER_MW_DMA_0; in it821x_smart_set_mode()
478 dev->xfer_shift = ATA_SHIFT_MWDMA; in it821x_smart_set_mode()
479 dev->flags &= ~ATA_DFLAG_PIO; in it821x_smart_set_mode()
482 dev->xfer_mode = XFER_PIO_0; in it821x_smart_set_mode()
483 dev->xfer_shift = ATA_SHIFT_PIO; in it821x_smart_set_mode()
484 dev->flags |= ATA_DFLAG_PIO; in it821x_smart_set_mode()
491 * it821x_dev_config - Called each device identify
504 ata_id_c_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num)); in it821x_dev_config()
506 if (adev->max_sectors > 255) in it821x_dev_config()
507 adev->max_sectors = 255; in it821x_dev_config()
511 if (adev->id[129] == 1) in it821x_dev_config()
513 adev->id[147] ? "Bootable " : "", in it821x_dev_config()
514 adev->id[129]); in it821x_dev_config()
517 adev->id[147] ? "Bootable " : "", in it821x_dev_config()
518 adev->id[129], adev->id[146]); in it821x_dev_config()
522 adev->quirks &= ~ATA_QUIRK_DIAGNOSTIC; in it821x_dev_config()
524 adev->quirks |= ATA_QUIRK_BROKEN_HPA; in it821x_dev_config()
528 * it821x_read_id - Hack identify data up
570 * it821x_check_atapi_dma - ATAPI DMA handler
579 struct ata_port *ap = qc->ap; in it821x_check_atapi_dma()
580 struct it821x_dev *itdev = ap->private_data; in it821x_check_atapi_dma()
584 return -EOPNOTSUPP; in it821x_check_atapi_dma()
587 if (itdev->smart) in it821x_check_atapi_dma()
588 return -EOPNOTSUPP; in it821x_check_atapi_dma()
590 if (itdev->timing10) in it821x_check_atapi_dma()
591 return -EOPNOTSUPP; in it821x_check_atapi_dma()
597 * it821x_display_disk - display disk setup
612 const char *cbl = "(40 wire cable)"; in it821x_display_disk()
635 snprintf(mbuf, 8, "%5s%d", mtype, mode - 1); in it821x_display_disk()
639 ata_port_info(ap, "%d: %-6s %-8s %s %s\n", in it821x_display_disk()
642 ata_port_info(ap, "%d: %-6s %-8s Volume: %1d %s %s\n", in it821x_display_disk()
649 * it821x_firmware_command - issue firmware command
670 ap->ctl |= ATA_NIEN; in it821x_firmware_command()
671 iowrite8(ap->ctl, ap->ioaddr.ctl_addr); in it821x_firmware_command()
673 iowrite8(ATA_DEVICE_OBS, ap->ioaddr.device_addr); in it821x_firmware_command()
674 iowrite8(cmd, ap->ioaddr.command_addr); in it821x_firmware_command()
679 status = ioread8(ap->ioaddr.status_addr); in it821x_firmware_command()
686 ioread16_rep(ap->ioaddr.data_addr, buf, len/2); in it821x_firmware_command()
697 * it821x_probe_firmware - firmware reporting/setup
729 * it821x_port_start - port setup
740 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in it821x_port_start()
748 itdev = devm_kzalloc(&pdev->dev, sizeof(struct it821x_dev), GFP_KERNEL); in it821x_port_start()
750 return -ENOMEM; in it821x_port_start()
751 ap->private_data = itdev; in it821x_port_start()
756 itdev->smart = 1; in it821x_port_start()
760 if (ap->port_no == 0) in it821x_port_start()
764 if (conf & (1 << (1 + ap->port_no))) in it821x_port_start()
765 itdev->clock_mode = ATA_50; in it821x_port_start()
767 itdev->clock_mode = ATA_66; in it821x_port_start()
769 itdev->want[0][1] = ATA_ANY; in it821x_port_start()
770 itdev->want[1][1] = ATA_ANY; in it821x_port_start()
771 itdev->last_device = -1; in it821x_port_start()
773 if (pdev->revision == 0x10) { in it821x_port_start()
774 itdev->timing10 = 1; in it821x_port_start()
776 if (!itdev->smart) in it821x_port_start()
777 dev_warn(&pdev->dev, in it821x_port_start()
785 * it821x_rdc_cable - Cable detect for RDC1010
795 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in it821x_rdc_cable()
798 if (r40 & (1 << (2 + ap->port_no))) in it821x_rdc_cable()
856 if (pdev->vendor != PCI_VENDOR_ID_ITE || in it821x_disable_raid()
857 pdev->device != PCI_DEVICE_ID_ITE_8212) in it821x_disable_raid()
917 if (pdev->vendor == PCI_VENDOR_ID_RDC) { in it821x_init_one()
919 if (pdev->revision == 0x11) in it821x_init_one()
926 dev_info(&pdev->dev, "forcing bypass mode.\n"); in it821x_init_one()
932 dev_info(&pdev->dev, "controller in %s mode.\n", mode[conf]); in it821x_init_one()
951 /* Resume - turn raid back off if need be */ in it821x_reinit_one()
981 MODULE_DESCRIPTION("low-level driver for the IT8211/IT8212 IDE RAID controller");