Deleted Added
full compact
ata-dma.c (84584) ata-dma.c (85345)
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 *
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 84584 2001-10-06 11:07:04Z sos $
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
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
106 if (udmamode > 2 && !ATA_PARAM(scp, device)->hwres_cblid) {
107 ata_printf(scp, device,
108 "DMA limited to UDMA33, non-ATA66 compliant cable\n");
109 udmamode = 2;
110 }
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 }
111
112#endif
112 switch (scp->chiptype) {
113
114 case 0x244a8086: /* Intel ICH2 mobile */
115 case 0x244b8086: /* Intel ICH2 */
116 if (udmamode >= 5) {
117 int32_t mask48, new48;
118 int16_t word54;
119

--- 600 unchanged lines hidden (view full) ---

720 return;
721 }
722 }
723 /* we could set PIO mode timings, but we assume the BIOS did that */
724 break;
725
726 case 0x4d68105a: /* Promise TX2 ATA100 controllers */
727 case 0x6268105a: /* Promise TX2v2 ATA100 controllers */
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 */
728 ATA_OUTB(scp->r_bmio, ATA_BMDEVSPEC_0, 0x0b);
729 if (udmamode >= 4 && !(ATA_INB(scp->r_bmio, ATA_BMDEVSPEC_1) & 0x04)) {
730 error = ata_command(scp, device, ATA_C_SETFEATURES, 0,
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,
731 ATA_UDMA + max(udmamode, 5), ATA_C_F_SETXFER,
733 ATA_UDMA + udmamode, ATA_C_F_SETXFER,
732 ATA_WAIT_READY);
733 if (bootverbose)
734 ata_printf(scp, device, "%s setting %s on Promise chip\n",
735 (error) ? "failed" : "success",
734 ATA_WAIT_READY);
735 if (bootverbose)
736 ata_printf(scp, device, "%s setting %s on Promise chip\n",
737 (error) ? "failed" : "success",
736 ata_mode2str(ATA_UDMA + max(udmamode, 5)));
738 ata_mode2str(ATA_UDMA + udmamode));
737 if (!error) {
739 if (!error) {
738 scp->mode[ATA_DEV(device)] = ATA_UDMA + (max(udmamode, 5));
740 scp->mode[ATA_DEV(device)] = ATA_UDMA + udmamode;
739 return;
740 }
741 }
742 if (udmamode >= 2) {
743 error = ata_command(scp, device, ATA_C_SETFEATURES, 0,
744 ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
745 if (bootverbose)
746 ata_printf(scp, device, "%s setting %s on Promise chip\n",

--- 423 unchanged lines hidden ---
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 ---