ata-cyrix.c (230132) | ata-cyrix.c (233282) |
---|---|
1/*- 2 * Copyright (c) 1998 - 2008 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 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1998 - 2008 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 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/dev/ata/chipsets/ata-cyrix.c 230132 2012-01-15 13:23:18Z uqs $"); | 28__FBSDID("$FreeBSD: head/sys/dev/ata/chipsets/ata-cyrix.c 233282 2012-03-21 16:59:39Z marius $"); |
29 30#include "opt_ata.h" 31#include <sys/param.h> 32#include <sys/module.h> 33#include <sys/systm.h> 34#include <sys/kernel.h> 35#include <sys/ata.h> 36#include <sys/bus.h> --- 59 unchanged lines hidden (view full) --- 96 97static int 98ata_cyrix_setmode(device_t dev, int target, int mode) 99{ 100 struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); 101 struct ata_channel *ch = device_get_softc(dev); 102 int devno = (ch->unit << 1) + target; 103 int piomode; | 29 30#include "opt_ata.h" 31#include <sys/param.h> 32#include <sys/module.h> 33#include <sys/systm.h> 34#include <sys/kernel.h> 35#include <sys/ata.h> 36#include <sys/bus.h> --- 59 unchanged lines hidden (view full) --- 96 97static int 98ata_cyrix_setmode(device_t dev, int target, int mode) 99{ 100 struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); 101 struct ata_channel *ch = device_get_softc(dev); 102 int devno = (ch->unit << 1) + target; 103 int piomode; |
104 u_int32_t piotiming[] = | 104 static const uint32_t piotiming[] = |
105 { 0x00009172, 0x00012171, 0x00020080, 0x00032010, 0x00040010 }; | 105 { 0x00009172, 0x00012171, 0x00020080, 0x00032010, 0x00040010 }; |
106 u_int32_t dmatiming[] = { 0x00077771, 0x00012121, 0x00002020 }; 107 u_int32_t udmatiming[] = { 0x00921250, 0x00911140, 0x00911030 }; | 106 static const uint32_t dmatiming[] = 107 { 0x00077771, 0x00012121, 0x00002020 }; 108 static const uint32_t udmatiming[] = 109 { 0x00921250, 0x00911140, 0x00911030 }; |
108 109 mode = min(mode, ATA_UDMA2); 110 /* dont try to set the mode if we dont have the resource */ 111 if (ctlr->r_res1) { 112 if (mode >= ATA_UDMA0) { 113 /* Set UDMA timings, and PIO4. */ 114 ATA_OUTL(ch->r_io[ATA_BMCMD_PORT].res, 115 0x24 + (devno << 3), udmatiming[mode & ATA_MODE_MASK]); --- 17 unchanged lines hidden --- | 110 111 mode = min(mode, ATA_UDMA2); 112 /* dont try to set the mode if we dont have the resource */ 113 if (ctlr->r_res1) { 114 if (mode >= ATA_UDMA0) { 115 /* Set UDMA timings, and PIO4. */ 116 ATA_OUTL(ch->r_io[ATA_BMCMD_PORT].res, 117 0x24 + (devno << 3), udmatiming[mode & ATA_MODE_MASK]); --- 17 unchanged lines hidden --- |