Deleted Added
full compact
ata-dma.c (85350) ata-dma.c (85352)
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 85350 2001-10-23 09:25:57Z sos $
28 * $FreeBSD: head/sys/dev/ata/ata-dma.c 85352 2001-10-23 09:57:49Z 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>

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

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
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>

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

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 0x248a8086: /* Intel ICH3 mobile */
116 case 0x248b8086: /* Intel ICH3 */
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
121 word54 = pci_read_config(parent, 0x54, 2);
122 if (word54 & (0x10 << devno)) {

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

139 }
140 }
141 /* make sure eventual ATA100 mode from the BIOS is disabled */
142 pci_write_config(parent, 0x54,
143 pci_read_config(parent, 0x54, 2) & ~(0x1000<<devno),2);
144 /* FALLTHROUGH */
145
146 case 0x24118086: /* Intel ICH */
117 case 0x244a8086: /* Intel ICH2 mobile */
118 case 0x244b8086: /* Intel ICH2 */
119 if (udmamode >= 5) {
120 int32_t mask48, new48;
121 int16_t word54;
122
123 word54 = pci_read_config(parent, 0x54, 2);
124 if (word54 & (0x10 << devno)) {

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

141 }
142 }
143 /* make sure eventual ATA100 mode from the BIOS is disabled */
144 pci_write_config(parent, 0x54,
145 pci_read_config(parent, 0x54, 2) & ~(0x1000<<devno),2);
146 /* FALLTHROUGH */
147
148 case 0x24118086: /* Intel ICH */
149 case 0x76018086: /* Intel ICH */
147 if (udmamode >= 4) {
148 int32_t mask48, new48;
149 int16_t word54;
150
151 word54 = pci_read_config(parent, 0x54, 2);
152 if (word54 & (0x10 << devno)) {
153 error = ata_command(scp, device, ATA_C_SETFEATURES, 0,
154 ATA_UDMA4, ATA_C_F_SETXFER,ATA_WAIT_READY);

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

169 }
170 }
171 /* make sure eventual ATA66 mode from the BIOS is disabled */
172 pci_write_config(parent, 0x54,
173 pci_read_config(parent, 0x54, 2) & ~(1 << devno), 2);
174 /* FALLTHROUGH */
175
176 case 0x71118086: /* Intel PIIX4 */
150 if (udmamode >= 4) {
151 int32_t mask48, new48;
152 int16_t word54;
153
154 word54 = pci_read_config(parent, 0x54, 2);
155 if (word54 & (0x10 << devno)) {
156 error = ata_command(scp, device, ATA_C_SETFEATURES, 0,
157 ATA_UDMA4, ATA_C_F_SETXFER,ATA_WAIT_READY);

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

172 }
173 }
174 /* make sure eventual ATA66 mode from the BIOS is disabled */
175 pci_write_config(parent, 0x54,
176 pci_read_config(parent, 0x54, 2) & ~(1 << devno), 2);
177 /* FALLTHROUGH */
178
179 case 0x71118086: /* Intel PIIX4 */
180 case 0x84CA8086: /* Intel PIIX4 */
177 case 0x71998086: /* Intel PIIX4e */
178 case 0x24218086: /* Intel ICH0 */
179 if (udmamode >= 2) {
180 int32_t mask48, new48;
181
182 error = ata_command(scp, device, ATA_C_SETFEATURES, 0,
183 ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
184 if (bootverbose)

--- 1018 unchanged lines hidden ---
181 case 0x71998086: /* Intel PIIX4e */
182 case 0x24218086: /* Intel ICH0 */
183 if (udmamode >= 2) {
184 int32_t mask48, new48;
185
186 error = ata_command(scp, device, ATA_C_SETFEATURES, 0,
187 ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
188 if (bootverbose)

--- 1018 unchanged lines hidden ---