1/*- 2 * Copyright (c) 1998,1999,2000,2001 S�ren Schmidt <sos@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/dev/ata/ata-dma.c 85345 2001-10-23 08:01:47Z sos $ |
29 */ 30 31#include "pci.h" 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/ata.h> 35#include <sys/bio.h> 36#include <sys/malloc.h> --- 61 unchanged lines hidden (view full) --- 98 ata_printf(scp, device, "simplex device, DMA on primary only\n"); 99 return; 100 } 101 } 102 103 /* DMA engine address alignment is usually 1 word (2 bytes) */ 104 scp->alignment = 0x1; 105 |
106#if 1 |
107 if (udmamode > 2 && !ATA_PARAM(scp, device)->hwres_cblid) { 108 ata_printf(scp, device, 109 "DMA limited to UDMA33, non-ATA66 compliant cable\n"); 110 udmamode = 2; 111 } |
112#endif |
113 switch (scp->chiptype) { 114 115 case 0x244a8086: /* Intel ICH2 mobile */ 116 case 0x244b8086: /* Intel ICH2 */ 117 if (udmamode >= 5) { 118 int32_t mask48, new48; 119 int16_t word54; 120 --- 600 unchanged lines hidden (view full) --- 721 return; 722 } 723 } 724 /* we could set PIO mode timings, but we assume the BIOS did that */ 725 break; 726 727 case 0x4d68105a: /* Promise TX2 ATA100 controllers */ 728 case 0x6268105a: /* Promise TX2v2 ATA100 controllers */ |
729 case 0x4d69105a: /* Promise ATA133 controllers */ |
730 ATA_OUTB(scp->r_bmio, ATA_BMDEVSPEC_0, 0x0b); 731 if (udmamode >= 4 && !(ATA_INB(scp->r_bmio, ATA_BMDEVSPEC_1) & 0x04)) { 732 error = ata_command(scp, device, ATA_C_SETFEATURES, 0, |
733 ATA_UDMA + udmamode, ATA_C_F_SETXFER, |
734 ATA_WAIT_READY); 735 if (bootverbose) 736 ata_printf(scp, device, "%s setting %s on Promise chip\n", 737 (error) ? "failed" : "success", |
738 ata_mode2str(ATA_UDMA + udmamode)); |
739 if (!error) { |
740 scp->mode[ATA_DEV(device)] = ATA_UDMA + udmamode; |
741 return; 742 } 743 } 744 if (udmamode >= 2) { 745 error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 746 ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY); 747 if (bootverbose) 748 ata_printf(scp, device, "%s setting %s on Promise chip\n", --- 423 unchanged lines hidden --- |