Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
/*-
|
2002-01-28 13:17:10 +00:00
|
|
|
|
* Copyright (c) 1998,1999,2000,2001,2002 S<EFBFBD>ren Schmidt <sos@FreeBSD.org>
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
|
* are met:
|
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
|
* notice, this list of conditions and the following disclaimer,
|
|
|
|
|
* without modification, immediately at the beginning of the file.
|
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
|
* 3. The name of the author may not be used to endorse or promote products
|
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
|
*
|
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
*
|
1999-08-28 01:08:13 +00:00
|
|
|
|
* $FreeBSD$
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
|
#include <sys/systm.h>
|
2001-03-15 15:36:25 +00:00
|
|
|
|
#include <sys/ata.h>
|
2002-04-26 22:48:23 +00:00
|
|
|
|
#include <sys/endian.h>
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
#include <sys/malloc.h>
|
1999-04-18 20:48:15 +00:00
|
|
|
|
#include <sys/bus.h>
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
#include <pci/pcivar.h>
|
2000-08-28 21:48:13 +00:00
|
|
|
|
#include <machine/bus.h>
|
2001-02-06 16:44:25 +00:00
|
|
|
|
#include <sys/rman.h>
|
2000-09-20 07:00:24 +00:00
|
|
|
|
#include <dev/ata/ata-all.h>
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
|
1999-10-09 19:57:13 +00:00
|
|
|
|
/* prototypes */
|
2002-04-05 13:13:56 +00:00
|
|
|
|
static void ata_dmacreate(struct ata_device *, int, int);
|
|
|
|
|
static void ata_dmasetupd_cb(void *, bus_dma_segment_t *, int, int);
|
|
|
|
|
static void ata_dmasetupc_cb(void *, bus_dma_segment_t *, int, int);
|
|
|
|
|
static void cyrix_timing(struct ata_device *, int, int);
|
|
|
|
|
static void promise_timing(struct ata_device *, int, int);
|
|
|
|
|
static void hpt_timing(struct ata_device *, int, int);
|
|
|
|
|
static int hpt_cable80(struct ata_device *);
|
1999-10-09 19:57:13 +00:00
|
|
|
|
|
|
|
|
|
/* misc defines */
|
2002-04-05 13:13:56 +00:00
|
|
|
|
#define ATAPI_DEVICE(atadev) \
|
|
|
|
|
((atadev->unit == ATA_MASTER && \
|
|
|
|
|
atadev->channel->devices & ATA_ATAPI_MASTER) || \
|
|
|
|
|
(atadev->unit == ATA_SLAVE && \
|
|
|
|
|
atadev->channel->devices & ATA_ATAPI_SLAVE))
|
|
|
|
|
|
|
|
|
|
#define MAXSEGSZ PAGE_SIZE
|
|
|
|
|
#define MAXTABSZ PAGE_SIZE
|
|
|
|
|
#define MAXCTLDMASZ (2 * (MAXTABSZ + MAXPHYS))
|
|
|
|
|
|
|
|
|
|
struct ata_dc_cb_args {
|
|
|
|
|
bus_addr_t maddr;
|
|
|
|
|
int error;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
ata_dmasetupc_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int error)
|
|
|
|
|
{
|
|
|
|
|
struct ata_dc_cb_args *cba = (struct ata_dc_cb_args *)xsc;
|
|
|
|
|
|
|
|
|
|
if (!(cba->error = error))
|
|
|
|
|
cba->maddr = segs[0].ds_addr;
|
|
|
|
|
}
|
1999-04-16 21:22:55 +00:00
|
|
|
|
|
2002-04-05 13:13:56 +00:00
|
|
|
|
int
|
|
|
|
|
ata_dmaalloc(struct ata_device *atadev)
|
2000-09-19 11:08:39 +00:00
|
|
|
|
{
|
2002-04-05 13:13:56 +00:00
|
|
|
|
struct ata_channel *ch;
|
|
|
|
|
struct ata_dc_cb_args ccba;
|
|
|
|
|
struct ata_dmastate *ds;
|
|
|
|
|
int error;
|
|
|
|
|
|
|
|
|
|
ch = atadev->channel;
|
|
|
|
|
ds = &atadev->dmastate;
|
|
|
|
|
if (!ds->cdmatag) {
|
|
|
|
|
if ((error = bus_dma_tag_create(ch->dmatag, 1, PAGE_SIZE,
|
|
|
|
|
BUS_SPACE_MAXADDR_32BIT,
|
|
|
|
|
BUS_SPACE_MAXADDR, NULL, NULL,
|
|
|
|
|
MAXTABSZ, 1, MAXTABSZ,
|
|
|
|
|
BUS_DMA_ALLOCNOW, &ds->cdmatag)))
|
|
|
|
|
return error;
|
|
|
|
|
}
|
|
|
|
|
if (!ds->ddmatag) {
|
|
|
|
|
if ((error = bus_dma_tag_create(ch->dmatag, ch->alignment + 1, 0,
|
|
|
|
|
BUS_SPACE_MAXADDR_32BIT,
|
|
|
|
|
BUS_SPACE_MAXADDR, NULL, NULL,
|
|
|
|
|
MAXPHYS, ATA_DMA_ENTRIES, MAXSEGSZ,
|
|
|
|
|
BUS_DMA_ALLOCNOW, &ds->ddmatag)))
|
|
|
|
|
return error;
|
|
|
|
|
}
|
|
|
|
|
if (!ds->mdmatab) {
|
|
|
|
|
if ((error = bus_dmamem_alloc(ds->cdmatag, (void **)&ds->dmatab, 0,
|
|
|
|
|
&ds->cdmamap)))
|
|
|
|
|
return error;
|
|
|
|
|
|
|
|
|
|
if ((error = bus_dmamap_load(ds->cdmatag, ds->cdmamap, ds->dmatab,
|
|
|
|
|
MAXTABSZ, ata_dmasetupc_cb, &ccba,
|
|
|
|
|
0)) != 0 || ccba.error != 0) {
|
|
|
|
|
bus_dmamem_free(ds->cdmatag, ds->dmatab, ds->cdmamap);
|
|
|
|
|
return error;
|
2000-09-19 11:08:39 +00:00
|
|
|
|
}
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ds->mdmatab = ccba.maddr;
|
|
|
|
|
}
|
|
|
|
|
if (!ds->ddmamap) {
|
|
|
|
|
if ((error = bus_dmamap_create(ds->ddmatag, 0, &ds->ddmamap)) != 0)
|
|
|
|
|
return error;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ata_dmafree(struct ata_device *atadev)
|
|
|
|
|
{
|
|
|
|
|
struct ata_dmastate *ds;
|
|
|
|
|
|
|
|
|
|
ds = &atadev->dmastate;
|
|
|
|
|
if (ds->mdmatab) {
|
|
|
|
|
bus_dmamap_unload(ds->cdmatag, ds->cdmamap);
|
|
|
|
|
bus_dmamem_free(ds->cdmatag, ds->dmatab, ds->cdmamap);
|
|
|
|
|
ds->mdmatab = 0;
|
|
|
|
|
ds->cdmamap = NULL;
|
|
|
|
|
ds->dmatab = NULL;
|
|
|
|
|
}
|
|
|
|
|
if (ds->ddmamap) {
|
|
|
|
|
bus_dmamap_destroy(ds->ddmatag, ds->ddmamap);
|
|
|
|
|
ds->ddmamap = NULL;
|
|
|
|
|
}
|
|
|
|
|
if (ds->cdmatag) {
|
|
|
|
|
bus_dma_tag_destroy(ds->cdmatag);
|
|
|
|
|
ds->cdmatag = NULL;
|
|
|
|
|
}
|
|
|
|
|
if (ds->ddmatag) {
|
|
|
|
|
bus_dma_tag_destroy(ds->ddmatag);
|
|
|
|
|
ds->ddmatag = NULL;
|
2000-09-19 11:08:39 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2000-01-28 13:35:43 +00:00
|
|
|
|
void
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmafreetags(struct ata_channel *ch)
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
{
|
2002-04-05 13:13:56 +00:00
|
|
|
|
|
|
|
|
|
if (ch->dmatag) {
|
|
|
|
|
bus_dma_tag_destroy(ch->dmatag);
|
|
|
|
|
ch->dmatag = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
ata_dmacreate(struct ata_device *atadev, int apiomode, int mode)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
atadev->mode = mode;
|
|
|
|
|
if (!atadev->channel->dmatag) {
|
|
|
|
|
if (bus_dma_tag_create(NULL, 1, 0,
|
|
|
|
|
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR,
|
|
|
|
|
NULL, NULL, MAXCTLDMASZ, ATA_DMA_ENTRIES,
|
|
|
|
|
BUS_SPACE_MAXSIZE_32BIT, 0,
|
|
|
|
|
&atadev->channel->dmatag)) {
|
|
|
|
|
ata_prtdev(atadev, "DMA tag allocation failed, disabling DMA\n");
|
|
|
|
|
ata_dmainit(atadev, apiomode, -1, -1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ata_dmainit(struct ata_device *atadev, int apiomode, int wdmamode, int udmamode)
|
|
|
|
|
{
|
|
|
|
|
device_t parent = device_get_parent(atadev->channel->dev);
|
|
|
|
|
int chiptype = atadev->channel->chiptype;
|
|
|
|
|
int chiprev = pci_get_revid(parent);
|
|
|
|
|
int channel = atadev->channel->unit;
|
|
|
|
|
int device = ATA_DEV(atadev->unit);
|
|
|
|
|
int devno = (channel << 1) + device;
|
2000-08-06 19:51:58 +00:00
|
|
|
|
int error;
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
|
2000-01-28 13:35:43 +00:00
|
|
|
|
/* set our most pessimistic default mode */
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
atadev->mode = ATA_PIO;
|
2000-01-28 13:35:43 +00:00
|
|
|
|
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (!atadev->channel->r_bmio)
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
|
1999-10-09 19:57:13 +00:00
|
|
|
|
/* if simplex controller, only allow DMA on primary channel */
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (channel == 1) {
|
|
|
|
|
ATA_OUTB(atadev->channel->r_bmio, ATA_BMSTAT_PORT,
|
|
|
|
|
ATA_INB(atadev->channel->r_bmio, ATA_BMSTAT_PORT) &
|
2001-02-06 16:44:25 +00:00
|
|
|
|
(ATA_BMSTAT_DMA_MASTER | ATA_BMSTAT_DMA_SLAVE));
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (ATA_INB(atadev->channel->r_bmio, ATA_BMSTAT_PORT) &
|
|
|
|
|
ATA_BMSTAT_DMA_SIMPLEX) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "simplex device, DMA on primary only\n");
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
1999-10-09 19:57:13 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-19 11:08:39 +00:00
|
|
|
|
/* DMA engine address alignment is usually 1 word (2 bytes) */
|
2002-04-05 13:13:56 +00:00
|
|
|
|
atadev->channel->alignment = 0x1;
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
|
2001-10-23 08:01:47 +00:00
|
|
|
|
#if 1
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (udmamode > 2 && !atadev->param->hwres_cblid) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev,"DMA limited to UDMA33, non-ATA66 cable or device\n");
|
2000-05-23 19:05:56 +00:00
|
|
|
|
udmamode = 2;
|
|
|
|
|
}
|
2001-10-23 08:01:47 +00:00
|
|
|
|
#endif
|
2002-04-05 13:13:56 +00:00
|
|
|
|
switch (chiptype) {
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
|
2002-07-19 22:14:54 +00:00
|
|
|
|
case 0x24cb8086: /* Intel ICH4 */
|
2001-10-23 09:57:49 +00:00
|
|
|
|
case 0x248a8086: /* Intel ICH3 mobile */
|
|
|
|
|
case 0x248b8086: /* Intel ICH3 */
|
2001-04-16 21:22:34 +00:00
|
|
|
|
case 0x244a8086: /* Intel ICH2 mobile */
|
2000-08-06 19:51:58 +00:00
|
|
|
|
case 0x244b8086: /* Intel ICH2 */
|
|
|
|
|
if (udmamode >= 5) {
|
|
|
|
|
int32_t mask48, new48;
|
|
|
|
|
int16_t word54;
|
|
|
|
|
|
|
|
|
|
word54 = pci_read_config(parent, 0x54, 2);
|
|
|
|
|
if (word54 & (0x10 << devno)) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
|
|
|
|
ATA_UDMA5, ATA_C_F_SETXFER,ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA5 on Intel chip\n",
|
2000-08-06 19:51:58 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
mask48 = (1 << devno) + (3 << (16 + (devno << 2)));
|
|
|
|
|
new48 = (1 << devno) + (1 << (16 + (devno << 2)));
|
|
|
|
|
pci_write_config(parent, 0x48,
|
|
|
|
|
(pci_read_config(parent, 0x48, 4) &
|
|
|
|
|
~mask48) | new48, 4);
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
pci_write_config(parent, 0x54, word54 | (0x1000<<devno), 2);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA5);
|
2000-08-06 19:51:58 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2000-08-10 07:34:49 +00:00
|
|
|
|
/* make sure eventual ATA100 mode from the BIOS is disabled */
|
|
|
|
|
pci_write_config(parent, 0x54,
|
|
|
|
|
pci_read_config(parent, 0x54, 2) & ~(0x1000<<devno),2);
|
2000-08-06 19:51:58 +00:00
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
|
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
case 0x24118086: /* Intel ICH */
|
|
|
|
|
case 0x76018086: /* Intel ICH */
|
2000-02-22 20:37:01 +00:00
|
|
|
|
if (udmamode >= 4) {
|
|
|
|
|
int32_t mask48, new48;
|
|
|
|
|
int16_t word54;
|
|
|
|
|
|
|
|
|
|
word54 = pci_read_config(parent, 0x54, 2);
|
|
|
|
|
if (word54 & (0x10 << devno)) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
|
|
|
|
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA4 on Intel chip\n",
|
2001-04-16 21:22:34 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
2000-02-22 20:37:01 +00:00
|
|
|
|
if (!error) {
|
|
|
|
|
mask48 = (1 << devno) + (3 << (16 + (devno << 2)));
|
|
|
|
|
new48 = (1 << devno) + (2 << (16 + (devno << 2)));
|
|
|
|
|
pci_write_config(parent, 0x48,
|
|
|
|
|
(pci_read_config(parent, 0x48, 4) &
|
|
|
|
|
~mask48) | new48, 4);
|
|
|
|
|
pci_write_config(parent, 0x54, word54 | (1 << devno), 2);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA4);
|
2000-02-22 20:37:01 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
}
|
2000-08-10 07:34:49 +00:00
|
|
|
|
/* make sure eventual ATA66 mode from the BIOS is disabled */
|
|
|
|
|
pci_write_config(parent, 0x54,
|
|
|
|
|
pci_read_config(parent, 0x54, 2) & ~(1 << devno), 2);
|
2000-02-22 20:37:01 +00:00
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
|
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
case 0x71118086: /* Intel PIIX4 */
|
2001-10-23 09:57:49 +00:00
|
|
|
|
case 0x84CA8086: /* Intel PIIX4 */
|
2000-01-17 02:04:19 +00:00
|
|
|
|
case 0x71998086: /* Intel PIIX4e */
|
|
|
|
|
case 0x24218086: /* Intel ICH0 */
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
if (udmamode >= 2) {
|
Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there
are some cool things in this one (and new bugs probably :) )...
The ATA driver has grown "real" timeout support for all devices.
This means that it should be possible to get in contact with
(especially) lost ATAPI devices. It also means that the ATA
driver is now usable on notebooks as it will DTRT on resume.
An experimental hack at utilizing the Promise66's at UDMA66 is
in there, but I cant test it. If someone feels like sending
me one, give me a ping.
The ATAPI DMA enableling scheme has been changed, also better DMA
support for the Aladdin chipset has been implemented for ATAPI
devices. Note that the Aladdin apparently only can do DMA reads
on ATAPI devices, and the Promise cant do ATAPI DMA at all.
I have seen problems on some ATAPI devices that should be able
to run in DMA mode, so if you encounter problems with hanging
atapi devices during the probe, or during access, disable DMA
in atapi-all.c, and let me know. It might be nessesary to do this
via a "white list" for known good devices...
The ATAPI CDROM driver can now use eject/close without hanging and
the bug that caused reading beyond the end of a CD has been fixed.
Media change is also handled proberly. DVD drives are identified
and are usable as CDROM devices at least, I dont have the HW to
test this further, see above :).
The ATAPI tape driver has gotten some support for using the DSC
method for not blocking the IDE channel during read/write when
the device has full buffers. It knows about the OnStream DI-30
device, support is not completed yet, but it can function as a
primitive backup medium, without filemarks, and without bad media
handeling. This is because the OnStream device doesn't handle this
(like everybody else) in HW. It also now supports getting/setting
the record position on devices that supports it.
Some rather major cleanups and rearrangements as well (cvs -b diff
is your freind). I'm closing in on declaring this for beta code,
most of the infrastruture is in place by now.
As usual USE AT YOUR OWN RISK!!, this is still alpha level code.
This driver can hose your disk real bad if anything goes wrong, but
now you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-09-21 19:50:40 +00:00
|
|
|
|
int32_t mask48, new48;
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
1999-11-08 21:36:00 +00:00
|
|
|
|
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there
are some cool things in this one (and new bugs probably :) )...
The ATA driver has grown "real" timeout support for all devices.
This means that it should be possible to get in contact with
(especially) lost ATAPI devices. It also means that the ATA
driver is now usable on notebooks as it will DTRT on resume.
An experimental hack at utilizing the Promise66's at UDMA66 is
in there, but I cant test it. If someone feels like sending
me one, give me a ping.
The ATAPI DMA enableling scheme has been changed, also better DMA
support for the Aladdin chipset has been implemented for ATAPI
devices. Note that the Aladdin apparently only can do DMA reads
on ATAPI devices, and the Promise cant do ATAPI DMA at all.
I have seen problems on some ATAPI devices that should be able
to run in DMA mode, so if you encounter problems with hanging
atapi devices during the probe, or during access, disable DMA
in atapi-all.c, and let me know. It might be nessesary to do this
via a "white list" for known good devices...
The ATAPI CDROM driver can now use eject/close without hanging and
the bug that caused reading beyond the end of a CD has been fixed.
Media change is also handled proberly. DVD drives are identified
and are usable as CDROM devices at least, I dont have the HW to
test this further, see above :).
The ATAPI tape driver has gotten some support for using the DSC
method for not blocking the IDE channel during read/write when
the device has full buffers. It knows about the OnStream DI-30
device, support is not completed yet, but it can function as a
primitive backup medium, without filemarks, and without bad media
handeling. This is because the OnStream device doesn't handle this
(like everybody else) in HW. It also now supports getting/setting
the record position on devices that supports it.
Some rather major cleanups and rearrangements as well (cvs -b diff
is your freind). I'm closing in on declaring this for beta code,
most of the infrastruture is in place by now.
As usual USE AT YOUR OWN RISK!!, this is still alpha level code.
This driver can hose your disk real bad if anything goes wrong, but
now you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-09-21 19:50:40 +00:00
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA2 on Intel chip\n",
|
2001-04-16 21:22:34 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
1999-11-24 21:40:05 +00:00
|
|
|
|
if (!error) {
|
|
|
|
|
mask48 = (1 << devno) + (3 << (16 + (devno << 2)));
|
|
|
|
|
new48 = (1 << devno) + (2 << (16 + (devno << 2)));
|
2000-02-18 20:57:33 +00:00
|
|
|
|
pci_write_config(parent, 0x48,
|
|
|
|
|
(pci_read_config(parent, 0x48, 4) &
|
1999-11-24 21:40:05 +00:00
|
|
|
|
~mask48) | new48, 4);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA2);
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
1999-11-24 21:40:05 +00:00
|
|
|
|
}
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
}
|
2000-08-10 07:34:49 +00:00
|
|
|
|
/* make sure eventual ATA33 mode from the BIOS is disabled */
|
|
|
|
|
pci_write_config(parent, 0x48,
|
|
|
|
|
pci_read_config(parent, 0x48, 4) & ~(1 << devno), 4);
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
|
|
|
|
|
|
case 0x70108086: /* Intel PIIX3 */
|
|
|
|
|
if (wdmamode >= 2 && apiomode >= 4) {
|
|
|
|
|
int32_t mask40, new40, mask44, new44;
|
|
|
|
|
|
|
|
|
|
/* if SITRE not set doit for both channels */
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (!((pci_read_config(parent, 0x40, 4) >> (channel<<8)) & 0x4000)){
|
2000-02-18 20:57:33 +00:00
|
|
|
|
new40 = pci_read_config(parent, 0x40, 4);
|
|
|
|
|
new44 = pci_read_config(parent, 0x44, 4);
|
Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there
are some cool things in this one (and new bugs probably :) )...
The ATA driver has grown "real" timeout support for all devices.
This means that it should be possible to get in contact with
(especially) lost ATAPI devices. It also means that the ATA
driver is now usable on notebooks as it will DTRT on resume.
An experimental hack at utilizing the Promise66's at UDMA66 is
in there, but I cant test it. If someone feels like sending
me one, give me a ping.
The ATAPI DMA enableling scheme has been changed, also better DMA
support for the Aladdin chipset has been implemented for ATAPI
devices. Note that the Aladdin apparently only can do DMA reads
on ATAPI devices, and the Promise cant do ATAPI DMA at all.
I have seen problems on some ATAPI devices that should be able
to run in DMA mode, so if you encounter problems with hanging
atapi devices during the probe, or during access, disable DMA
in atapi-all.c, and let me know. It might be nessesary to do this
via a "white list" for known good devices...
The ATAPI CDROM driver can now use eject/close without hanging and
the bug that caused reading beyond the end of a CD has been fixed.
Media change is also handled proberly. DVD drives are identified
and are usable as CDROM devices at least, I dont have the HW to
test this further, see above :).
The ATAPI tape driver has gotten some support for using the DSC
method for not blocking the IDE channel during read/write when
the device has full buffers. It knows about the OnStream DI-30
device, support is not completed yet, but it can function as a
primitive backup medium, without filemarks, and without bad media
handeling. This is because the OnStream device doesn't handle this
(like everybody else) in HW. It also now supports getting/setting
the record position on devices that supports it.
Some rather major cleanups and rearrangements as well (cvs -b diff
is your freind). I'm closing in on declaring this for beta code,
most of the infrastruture is in place by now.
As usual USE AT YOUR OWN RISK!!, this is still alpha level code.
This driver can hose your disk real bad if anything goes wrong, but
now you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-09-21 19:50:40 +00:00
|
|
|
|
if (!(new40 & 0x00004000)) {
|
|
|
|
|
new44 &= ~0x0000000f;
|
|
|
|
|
new44 |= ((new40&0x00003000)>>10)|((new40&0x00000300)>>8);
|
|
|
|
|
}
|
|
|
|
|
if (!(new40 & 0x40000000)) {
|
|
|
|
|
new44 &= ~0x000000f0;
|
|
|
|
|
new44 |= ((new40&0x30000000)>>22)|((new40&0x03000000)>>20);
|
|
|
|
|
}
|
|
|
|
|
new40 |= 0x40004000;
|
2000-02-18 20:57:33 +00:00
|
|
|
|
pci_write_config(parent, 0x40, new40, 4);
|
|
|
|
|
pci_write_config(parent, 0x44, new44, 4);
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
}
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
1999-11-08 21:36:00 +00:00
|
|
|
|
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there
are some cool things in this one (and new bugs probably :) )...
The ATA driver has grown "real" timeout support for all devices.
This means that it should be possible to get in contact with
(especially) lost ATAPI devices. It also means that the ATA
driver is now usable on notebooks as it will DTRT on resume.
An experimental hack at utilizing the Promise66's at UDMA66 is
in there, but I cant test it. If someone feels like sending
me one, give me a ping.
The ATAPI DMA enableling scheme has been changed, also better DMA
support for the Aladdin chipset has been implemented for ATAPI
devices. Note that the Aladdin apparently only can do DMA reads
on ATAPI devices, and the Promise cant do ATAPI DMA at all.
I have seen problems on some ATAPI devices that should be able
to run in DMA mode, so if you encounter problems with hanging
atapi devices during the probe, or during access, disable DMA
in atapi-all.c, and let me know. It might be nessesary to do this
via a "white list" for known good devices...
The ATAPI CDROM driver can now use eject/close without hanging and
the bug that caused reading beyond the end of a CD has been fixed.
Media change is also handled proberly. DVD drives are identified
and are usable as CDROM devices at least, I dont have the HW to
test this further, see above :).
The ATAPI tape driver has gotten some support for using the DSC
method for not blocking the IDE channel during read/write when
the device has full buffers. It knows about the OnStream DI-30
device, support is not completed yet, but it can function as a
primitive backup medium, without filemarks, and without bad media
handeling. This is because the OnStream device doesn't handle this
(like everybody else) in HW. It also now supports getting/setting
the record position on devices that supports it.
Some rather major cleanups and rearrangements as well (cvs -b diff
is your freind). I'm closing in on declaring this for beta code,
most of the infrastruture is in place by now.
As usual USE AT YOUR OWN RISK!!, this is still alpha level code.
This driver can hose your disk real bad if anything goes wrong, but
now you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-09-21 19:50:40 +00:00
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting WDMA2 on Intel chip\n",
|
2001-04-16 21:22:34 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
1999-11-24 21:40:05 +00:00
|
|
|
|
if (!error) {
|
|
|
|
|
if (device == ATA_MASTER) {
|
|
|
|
|
mask40 = 0x0000330f;
|
|
|
|
|
new40 = 0x00002307;
|
|
|
|
|
mask44 = 0;
|
|
|
|
|
new44 = 0;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
mask40 = 0x000000f0;
|
|
|
|
|
new40 = 0x00000070;
|
|
|
|
|
mask44 = 0x0000000f;
|
|
|
|
|
new44 = 0x0000000b;
|
|
|
|
|
}
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (channel) {
|
1999-11-24 21:40:05 +00:00
|
|
|
|
mask40 <<= 16;
|
|
|
|
|
new40 <<= 16;
|
|
|
|
|
mask44 <<= 4;
|
|
|
|
|
new44 <<= 4;
|
|
|
|
|
}
|
2000-02-18 20:57:33 +00:00
|
|
|
|
pci_write_config(parent, 0x40,
|
|
|
|
|
(pci_read_config(parent, 0x40, 4) & ~mask40)|
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
new40, 4);
|
2000-02-18 20:57:33 +00:00
|
|
|
|
pci_write_config(parent, 0x44,
|
|
|
|
|
(pci_read_config(parent, 0x44, 4) & ~mask44)|
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
new44, 4);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_WDMA2);
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there
are some cool things in this one (and new bugs probably :) )...
The ATA driver has grown "real" timeout support for all devices.
This means that it should be possible to get in contact with
(especially) lost ATAPI devices. It also means that the ATA
driver is now usable on notebooks as it will DTRT on resume.
An experimental hack at utilizing the Promise66's at UDMA66 is
in there, but I cant test it. If someone feels like sending
me one, give me a ping.
The ATAPI DMA enableling scheme has been changed, also better DMA
support for the Aladdin chipset has been implemented for ATAPI
devices. Note that the Aladdin apparently only can do DMA reads
on ATAPI devices, and the Promise cant do ATAPI DMA at all.
I have seen problems on some ATAPI devices that should be able
to run in DMA mode, so if you encounter problems with hanging
atapi devices during the probe, or during access, disable DMA
in atapi-all.c, and let me know. It might be nessesary to do this
via a "white list" for known good devices...
The ATAPI CDROM driver can now use eject/close without hanging and
the bug that caused reading beyond the end of a CD has been fixed.
Media change is also handled proberly. DVD drives are identified
and are usable as CDROM devices at least, I dont have the HW to
test this further, see above :).
The ATAPI tape driver has gotten some support for using the DSC
method for not blocking the IDE channel during read/write when
the device has full buffers. It knows about the OnStream DI-30
device, support is not completed yet, but it can function as a
primitive backup medium, without filemarks, and without bad media
handeling. This is because the OnStream device doesn't handle this
(like everybody else) in HW. It also now supports getting/setting
the record position on devices that supports it.
Some rather major cleanups and rearrangements as well (cvs -b diff
is your freind). I'm closing in on declaring this for beta code,
most of the infrastruture is in place by now.
As usual USE AT YOUR OWN RISK!!, this is still alpha level code.
This driver can hose your disk real bad if anything goes wrong, but
now you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-09-21 19:50:40 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
1999-11-24 21:40:05 +00:00
|
|
|
|
/* we could set PIO mode timings, but we assume the BIOS did that */
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0x12308086: /* Intel PIIX */
|
1999-12-13 10:19:39 +00:00
|
|
|
|
if (wdmamode >= 2 && apiomode >= 4) {
|
|
|
|
|
int32_t word40;
|
|
|
|
|
|
2000-02-18 20:57:33 +00:00
|
|
|
|
word40 = pci_read_config(parent, 0x40, 4);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
word40 >>= channel * 16;
|
1999-12-13 10:19:39 +00:00
|
|
|
|
|
|
|
|
|
/* Check for timing config usable for DMA on controller */
|
|
|
|
|
if (!((word40 & 0x3300) == 0x2300 &&
|
2002-04-05 13:13:56 +00:00
|
|
|
|
((word40 >> (device ? 4 : 0)) & 1) == 1))
|
1999-12-13 10:19:39 +00:00
|
|
|
|
break;
|
|
|
|
|
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
1999-12-13 10:19:39 +00:00
|
|
|
|
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting WDMA2 on Intel chip\n",
|
2000-01-24 20:45:24 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
1999-12-13 10:19:39 +00:00
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_WDMA2);
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
1999-12-13 10:19:39 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
break;
|
|
|
|
|
|
1999-10-09 19:57:13 +00:00
|
|
|
|
case 0x522910b9: /* AcerLabs Aladdin IV/V */
|
2001-04-06 19:18:35 +00:00
|
|
|
|
/* the older Aladdin doesn't support ATAPI DMA on both master & slave */
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (chiprev < 0xc2 &&
|
|
|
|
|
atadev->channel->devices & ATA_ATAPI_MASTER &&
|
|
|
|
|
atadev->channel->devices & ATA_ATAPI_SLAVE) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "two atapi devices on this channel, no DMA\n");
|
1999-11-08 21:36:00 +00:00
|
|
|
|
break;
|
1999-10-09 19:57:13 +00:00
|
|
|
|
}
|
2002-04-05 13:13:56 +00:00
|
|
|
|
pci_write_config(parent, 0x58 + (channel << 2), 0x00310001, 4);
|
|
|
|
|
if (udmamode >= 5 && chiprev >= 0xc4) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2001-04-06 19:18:35 +00:00
|
|
|
|
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA5 on Acer chip\n",
|
2001-04-06 19:18:35 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
int32_t word54 = pci_read_config(parent, 0x54, 4);
|
|
|
|
|
|
|
|
|
|
pci_write_config(parent, 0x4b,
|
|
|
|
|
pci_read_config(parent, 0x4b, 1) | 0x01, 1);
|
|
|
|
|
word54 &= ~(0x000f000f << (devno << 2));
|
|
|
|
|
word54 |= (0x000f0005 << (devno << 2));
|
|
|
|
|
pci_write_config(parent, 0x54, word54, 4);
|
|
|
|
|
pci_write_config(parent, 0x53,
|
|
|
|
|
pci_read_config(parent, 0x53, 1) | 0x03, 1);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA5);
|
2001-04-06 19:18:35 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (udmamode >= 4 && chiprev >= 0xc2) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2001-04-06 19:18:35 +00:00
|
|
|
|
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA4 on Acer chip\n",
|
2001-04-06 19:18:35 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
int32_t word54 = pci_read_config(parent, 0x54, 4);
|
1999-10-09 19:57:13 +00:00
|
|
|
|
|
2001-04-06 19:18:35 +00:00
|
|
|
|
pci_write_config(parent, 0x4b,
|
|
|
|
|
pci_read_config(parent, 0x4b, 1) | 0x01, 1);
|
|
|
|
|
word54 &= ~(0x000f000f << (devno << 2));
|
|
|
|
|
word54 |= (0x00080005 << (devno << 2));
|
|
|
|
|
pci_write_config(parent, 0x54, word54, 4);
|
|
|
|
|
pci_write_config(parent, 0x53,
|
|
|
|
|
pci_read_config(parent, 0x53, 1) | 0x03, 1);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA4);
|
2001-04-06 19:18:35 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (udmamode >= 2 && chiprev >= 0x20) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
1999-11-08 21:36:00 +00:00
|
|
|
|
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there
are some cool things in this one (and new bugs probably :) )...
The ATA driver has grown "real" timeout support for all devices.
This means that it should be possible to get in contact with
(especially) lost ATAPI devices. It also means that the ATA
driver is now usable on notebooks as it will DTRT on resume.
An experimental hack at utilizing the Promise66's at UDMA66 is
in there, but I cant test it. If someone feels like sending
me one, give me a ping.
The ATAPI DMA enableling scheme has been changed, also better DMA
support for the Aladdin chipset has been implemented for ATAPI
devices. Note that the Aladdin apparently only can do DMA reads
on ATAPI devices, and the Promise cant do ATAPI DMA at all.
I have seen problems on some ATAPI devices that should be able
to run in DMA mode, so if you encounter problems with hanging
atapi devices during the probe, or during access, disable DMA
in atapi-all.c, and let me know. It might be nessesary to do this
via a "white list" for known good devices...
The ATAPI CDROM driver can now use eject/close without hanging and
the bug that caused reading beyond the end of a CD has been fixed.
Media change is also handled proberly. DVD drives are identified
and are usable as CDROM devices at least, I dont have the HW to
test this further, see above :).
The ATAPI tape driver has gotten some support for using the DSC
method for not blocking the IDE channel during read/write when
the device has full buffers. It knows about the OnStream DI-30
device, support is not completed yet, but it can function as a
primitive backup medium, without filemarks, and without bad media
handeling. This is because the OnStream device doesn't handle this
(like everybody else) in HW. It also now supports getting/setting
the record position on devices that supports it.
Some rather major cleanups and rearrangements as well (cvs -b diff
is your freind). I'm closing in on declaring this for beta code,
most of the infrastruture is in place by now.
As usual USE AT YOUR OWN RISK!!, this is still alpha level code.
This driver can hose your disk real bad if anything goes wrong, but
now you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-09-21 19:50:40 +00:00
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA2 on Acer chip\n",
|
2000-01-24 20:45:24 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
1999-11-24 21:40:05 +00:00
|
|
|
|
if (!error) {
|
2001-04-06 19:18:35 +00:00
|
|
|
|
int32_t word54 = pci_read_config(parent, 0x54, 4);
|
|
|
|
|
|
2000-05-23 19:05:56 +00:00
|
|
|
|
word54 &= ~(0x000f000f << (devno << 2));
|
|
|
|
|
word54 |= (0x000a0005 << (devno << 2));
|
2000-02-18 20:57:33 +00:00
|
|
|
|
pci_write_config(parent, 0x54, word54, 4);
|
|
|
|
|
pci_write_config(parent, 0x53,
|
|
|
|
|
pci_read_config(parent, 0x53, 1) | 0x03, 1);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
atadev->channel->flags |= ATA_ATAPI_DMA_RO;
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA2);
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
1999-11-24 21:40:05 +00:00
|
|
|
|
}
|
Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there
are some cool things in this one (and new bugs probably :) )...
The ATA driver has grown "real" timeout support for all devices.
This means that it should be possible to get in contact with
(especially) lost ATAPI devices. It also means that the ATA
driver is now usable on notebooks as it will DTRT on resume.
An experimental hack at utilizing the Promise66's at UDMA66 is
in there, but I cant test it. If someone feels like sending
me one, give me a ping.
The ATAPI DMA enableling scheme has been changed, also better DMA
support for the Aladdin chipset has been implemented for ATAPI
devices. Note that the Aladdin apparently only can do DMA reads
on ATAPI devices, and the Promise cant do ATAPI DMA at all.
I have seen problems on some ATAPI devices that should be able
to run in DMA mode, so if you encounter problems with hanging
atapi devices during the probe, or during access, disable DMA
in atapi-all.c, and let me know. It might be nessesary to do this
via a "white list" for known good devices...
The ATAPI CDROM driver can now use eject/close without hanging and
the bug that caused reading beyond the end of a CD has been fixed.
Media change is also handled proberly. DVD drives are identified
and are usable as CDROM devices at least, I dont have the HW to
test this further, see above :).
The ATAPI tape driver has gotten some support for using the DSC
method for not blocking the IDE channel during read/write when
the device has full buffers. It knows about the OnStream DI-30
device, support is not completed yet, but it can function as a
primitive backup medium, without filemarks, and without bad media
handeling. This is because the OnStream device doesn't handle this
(like everybody else) in HW. It also now supports getting/setting
the record position on devices that supports it.
Some rather major cleanups and rearrangements as well (cvs -b diff
is your freind). I'm closing in on declaring this for beta code,
most of the infrastruture is in place by now.
As usual USE AT YOUR OWN RISK!!, this is still alpha level code.
This driver can hose your disk real bad if anything goes wrong, but
now you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-09-21 19:50:40 +00:00
|
|
|
|
}
|
2000-12-19 10:37:03 +00:00
|
|
|
|
|
|
|
|
|
/* make sure eventual UDMA mode from the BIOS is disabled */
|
2001-01-07 17:00:09 +00:00
|
|
|
|
pci_write_config(parent, 0x56, pci_read_config(parent, 0x56, 2) &
|
|
|
|
|
~(0x0008 << (devno << 2)), 2);
|
2000-12-19 10:37:03 +00:00
|
|
|
|
|
1999-11-24 21:40:05 +00:00
|
|
|
|
if (wdmamode >= 2 && apiomode >= 4) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
1999-11-08 21:36:00 +00:00
|
|
|
|
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
1999-10-09 19:57:13 +00:00
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting WDMA2 on Acer chip\n",
|
2000-01-24 20:45:24 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
1999-11-24 21:40:05 +00:00
|
|
|
|
if (!error) {
|
2000-02-18 20:57:33 +00:00
|
|
|
|
pci_write_config(parent, 0x53,
|
|
|
|
|
pci_read_config(parent, 0x53, 1) | 0x03, 1);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
atadev->channel->flags |= ATA_ATAPI_DMA_RO;
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_WDMA2);
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
1999-11-24 21:40:05 +00:00
|
|
|
|
}
|
1999-10-09 19:57:13 +00:00
|
|
|
|
}
|
2000-03-05 16:52:26 +00:00
|
|
|
|
pci_write_config(parent, 0x53,
|
|
|
|
|
(pci_read_config(parent, 0x53, 1) & ~0x01) | 0x02, 1);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
|
|
|
|
ATA_PIO0 + apiomode,
|
|
|
|
|
ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting PIO%d on Acer chip\n",
|
|
|
|
|
(error) ? "failed" : "success",
|
|
|
|
|
(apiomode >= 0) ? apiomode : 0);
|
|
|
|
|
if (!error) {
|
|
|
|
|
int32_t word54 = pci_read_config(parent, 0x54, 4);
|
|
|
|
|
int32_t timing;
|
|
|
|
|
|
|
|
|
|
switch(ATA_PIO0 + apiomode) {
|
|
|
|
|
case ATA_PIO0: timing = 0x006d0003;
|
|
|
|
|
case ATA_PIO1: timing = 0x00580002;
|
|
|
|
|
case ATA_PIO2: timing = 0x00440001;
|
|
|
|
|
case ATA_PIO3: timing = 0x00330001;
|
|
|
|
|
case ATA_PIO4: timing = 0x00310001;
|
|
|
|
|
default: timing = 0x006d0003;
|
|
|
|
|
}
|
|
|
|
|
pci_write_config(parent, 0x58 + (channel << 2), timing, 4);
|
|
|
|
|
word54 &= ~(0x000f000f << (devno << 2));
|
|
|
|
|
word54 |= (0x00000004 << (devno << 2));
|
|
|
|
|
pci_write_config(parent, 0x54, word54, 4);
|
|
|
|
|
atadev->mode = ATA_PIO0 + apiomode;
|
|
|
|
|
return;
|
|
|
|
|
}
|
1999-11-24 21:40:05 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2002-04-16 08:30:51 +00:00
|
|
|
|
case 0x01bc10de: /* nVIDIA nForce */
|
2003-01-08 16:51:41 +00:00
|
|
|
|
case 0x006510de: /* nVIDIA nForce2 */
|
2002-03-24 12:44:23 +00:00
|
|
|
|
case 0x74411022: /* AMD 768 */
|
2001-05-14 18:38:22 +00:00
|
|
|
|
case 0x74111022: /* AMD 766 */
|
2000-04-09 15:08:27 +00:00
|
|
|
|
case 0x74091022: /* AMD 756 */
|
2002-09-18 09:39:37 +00:00
|
|
|
|
case 0x05711106: /* VIA 82C571, 82C586, 82C596, 82C686, 8231,8233,8235 */
|
2002-01-28 13:17:10 +00:00
|
|
|
|
{
|
2002-04-16 08:30:51 +00:00
|
|
|
|
int via_modes[5][7] = {
|
|
|
|
|
{ 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00 }, /* VIA ATA33 */
|
|
|
|
|
{ 0x00, 0x00, 0xea, 0x00, 0xe8, 0x00, 0x00 }, /* VIA ATA66 */
|
|
|
|
|
{ 0x00, 0x00, 0xf4, 0x00, 0xf1, 0xf0, 0x00 }, /* VIA ATA100 */
|
|
|
|
|
{ 0x00, 0x00, 0xf6, 0x00, 0xf2, 0xf1, 0xf0 }, /* VIA ATA133 */
|
2003-01-08 16:51:41 +00:00
|
|
|
|
{ 0x00, 0x00, 0xc0, 0x00, 0xc5, 0xc6, 0xc7 }}; /* AMD/nVIDIA */
|
|
|
|
|
int reg = 0x53 - devno;
|
2002-01-28 13:17:10 +00:00
|
|
|
|
int *reg_val = NULL;
|
2002-04-16 08:30:51 +00:00
|
|
|
|
char *chip = "VIA";
|
2002-01-28 13:17:10 +00:00
|
|
|
|
|
2002-09-18 09:39:37 +00:00
|
|
|
|
if (ata_find_dev(parent, 0x31471106, 0) || /* 8233a */
|
|
|
|
|
ata_find_dev(parent, 0x31771106, 0)) { /* 8235 */
|
2002-01-28 13:17:10 +00:00
|
|
|
|
udmamode = imin(udmamode, 6);
|
|
|
|
|
reg_val = via_modes[3];
|
2001-01-17 09:22:13 +00:00
|
|
|
|
}
|
2002-01-28 13:17:10 +00:00
|
|
|
|
else if (ata_find_dev(parent, 0x06861106, 0x40) || /* 82C686b */
|
|
|
|
|
ata_find_dev(parent, 0x82311106, 0) || /* 8231 */
|
|
|
|
|
ata_find_dev(parent, 0x30741106, 0) || /* 8233 */
|
|
|
|
|
ata_find_dev(parent, 0x31091106, 0)) { /* 8233c */
|
|
|
|
|
udmamode = imin(udmamode, 5);
|
|
|
|
|
reg_val = via_modes[2];
|
|
|
|
|
}
|
|
|
|
|
else if (ata_find_dev(parent, 0x06861106, 0x10) || /* 82C686a */
|
|
|
|
|
ata_find_dev(parent, 0x05961106, 0x12)) { /* 82C596b */
|
|
|
|
|
udmamode = imin(udmamode, 4);
|
|
|
|
|
reg_val = via_modes[1];
|
|
|
|
|
}
|
2002-04-02 16:45:06 +00:00
|
|
|
|
else if (ata_find_dev(parent, 0x06861106, 0)) { /* 82C686 */
|
2002-01-28 13:17:10 +00:00
|
|
|
|
udmamode = imin(udmamode, 2);
|
|
|
|
|
reg_val = via_modes[1];
|
|
|
|
|
}
|
|
|
|
|
else if (ata_find_dev(parent, 0x05961106, 0) || /* 82C596a */
|
|
|
|
|
ata_find_dev(parent, 0x05861106, 0x03)) { /* 82C586b */
|
|
|
|
|
udmamode = imin(udmamode, 2);
|
|
|
|
|
reg_val = via_modes[0];
|
|
|
|
|
}
|
2002-04-16 08:30:51 +00:00
|
|
|
|
else if (chiptype == 0x74411022 || /* AMD 768 */
|
|
|
|
|
chiptype == 0x74111022) { /* AMD 766 */
|
|
|
|
|
udmamode = imin(udmamode, 5);
|
|
|
|
|
reg_val = via_modes[4];
|
|
|
|
|
chip = "AMD";
|
|
|
|
|
}
|
|
|
|
|
else if (chiptype == 0x74091022) { /* AMD 756 */
|
|
|
|
|
udmamode = imin(udmamode, 4);
|
|
|
|
|
reg_val = via_modes[4];
|
|
|
|
|
chip = "AMD";
|
|
|
|
|
}
|
2003-01-08 16:51:41 +00:00
|
|
|
|
else if (chiptype == 0x006510de) { /* nForce2 */
|
|
|
|
|
udmamode = imin(udmamode, 6);
|
|
|
|
|
reg += 0x10;
|
|
|
|
|
reg_val = via_modes[4];
|
|
|
|
|
chip = "nVidia";
|
|
|
|
|
}
|
|
|
|
|
else if (chiptype == 0x01bc10de) { /* nForce */
|
2002-04-16 08:30:51 +00:00
|
|
|
|
udmamode = imin(udmamode, 5);
|
2003-01-08 16:51:41 +00:00
|
|
|
|
reg += 0x10;
|
2002-04-16 08:30:51 +00:00
|
|
|
|
reg_val = via_modes[4];
|
2003-01-08 16:51:41 +00:00
|
|
|
|
chip = "nVidia";
|
2002-04-16 08:30:51 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
2002-01-28 13:17:10 +00:00
|
|
|
|
udmamode = 0;
|
2002-04-16 08:30:51 +00:00
|
|
|
|
|
2003-01-08 16:51:41 +00:00
|
|
|
|
if (udmamode || wdmamode)
|
|
|
|
|
pci_write_config(parent, reg - 0x08, 0x20, 1);
|
|
|
|
|
|
2002-01-28 13:17:10 +00:00
|
|
|
|
if (udmamode >= 6) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2002-01-28 13:17:10 +00:00
|
|
|
|
ATA_UDMA6, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
2001-01-17 09:22:13 +00:00
|
|
|
|
if (bootverbose)
|
2002-04-16 08:30:51 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA6 on %s chip\n",
|
|
|
|
|
(error) ? "failed" : "success", chip);
|
2001-01-17 09:22:13 +00:00
|
|
|
|
if (!error) {
|
2003-01-08 16:51:41 +00:00
|
|
|
|
pci_write_config(parent, reg, reg_val[6], 1);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA6);
|
2001-01-17 09:22:13 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-01-28 13:17:10 +00:00
|
|
|
|
if (udmamode >= 5) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2002-01-28 13:17:10 +00:00
|
|
|
|
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
2001-01-17 09:22:13 +00:00
|
|
|
|
if (bootverbose)
|
2002-04-16 08:30:51 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA5 on %s chip\n",
|
|
|
|
|
(error) ? "failed" : "success", chip);
|
2001-01-17 09:22:13 +00:00
|
|
|
|
if (!error) {
|
2003-01-08 16:51:41 +00:00
|
|
|
|
pci_write_config(parent, reg, reg_val[5], 1);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA5);
|
2001-01-17 09:22:13 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
2000-08-16 07:09:04 +00:00
|
|
|
|
if (udmamode >= 4) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2000-08-16 07:09:04 +00:00
|
|
|
|
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
2002-04-16 08:30:51 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA4 on %s chip\n",
|
|
|
|
|
(error) ? "failed" : "success", chip);
|
2000-08-16 07:09:04 +00:00
|
|
|
|
if (!error) {
|
2003-01-08 16:51:41 +00:00
|
|
|
|
pci_write_config(parent, reg, reg_val[4], 1);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA4);
|
2000-08-16 07:09:04 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2000-01-17 02:04:19 +00:00
|
|
|
|
}
|
2000-08-16 07:09:04 +00:00
|
|
|
|
if (udmamode >= 2) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2000-08-16 07:09:04 +00:00
|
|
|
|
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
2002-04-16 08:30:51 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA2 on %s chip\n",
|
|
|
|
|
(error) ? "failed" : "success", chip);
|
2000-08-16 07:09:04 +00:00
|
|
|
|
if (!error) {
|
2003-01-08 16:51:41 +00:00
|
|
|
|
pci_write_config(parent, reg, reg_val[2], 1);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA2);
|
2000-08-16 07:09:04 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
1999-11-24 21:40:05 +00:00
|
|
|
|
}
|
2002-04-16 08:30:51 +00:00
|
|
|
|
if (wdmamode >= 2 && apiomode >= 4) {
|
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
|
|
|
|
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting WDMA2 on %s chip\n",
|
|
|
|
|
(error) ? "failed" : "success", chip);
|
|
|
|
|
if (!error) {
|
2003-01-08 16:51:41 +00:00
|
|
|
|
pci_write_config(parent, reg, 0x0b, 1);
|
|
|
|
|
pci_write_config(parent, reg - 0x08, 0x31, 1);
|
2002-04-16 08:30:51 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_WDMA2);
|
|
|
|
|
return;
|
|
|
|
|
}
|
1999-11-24 21:40:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* we could set PIO mode timings, but we assume the BIOS did that */
|
1999-10-09 19:57:13 +00:00
|
|
|
|
break;
|
|
|
|
|
|
1999-12-13 10:19:39 +00:00
|
|
|
|
case 0x55131039: /* SiS 5591 */
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
if (ata_find_dev(parent, 0x06301039, 0x30) || /* SiS 630 */
|
2002-04-02 16:45:06 +00:00
|
|
|
|
ata_find_dev(parent, 0x06331039, 0) || /* SiS 633 */
|
|
|
|
|
ata_find_dev(parent, 0x06351039, 0) || /* SiS 635 */
|
|
|
|
|
ata_find_dev(parent, 0x06401039, 0) || /* SiS 640 */
|
|
|
|
|
ata_find_dev(parent, 0x06451039, 0) || /* SiS 645 */
|
|
|
|
|
ata_find_dev(parent, 0x06501039, 0) || /* SiS 650 */
|
|
|
|
|
ata_find_dev(parent, 0x07301039, 0) || /* SiS 730 */
|
|
|
|
|
ata_find_dev(parent, 0x07331039, 0) || /* SiS 733 */
|
|
|
|
|
ata_find_dev(parent, 0x07351039, 0) || /* SiS 735 */
|
|
|
|
|
ata_find_dev(parent, 0x07401039, 0) || /* SiS 740 */
|
|
|
|
|
ata_find_dev(parent, 0x07451039, 0) || /* SiS 745 */
|
|
|
|
|
ata_find_dev(parent, 0x07501039, 0)) { /* SiS 750 */
|
2001-12-02 10:48:52 +00:00
|
|
|
|
int8_t reg = 0x40 + (devno << 1);
|
2001-12-14 21:28:49 +00:00
|
|
|
|
int16_t val = pci_read_config(parent, reg, 2) & 0x0fff;
|
2001-12-02 10:48:52 +00:00
|
|
|
|
|
|
|
|
|
if (udmamode >= 5) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2001-12-02 10:48:52 +00:00
|
|
|
|
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA5 on SiS chip\n",
|
2001-12-02 10:48:52 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
2001-12-14 21:28:49 +00:00
|
|
|
|
pci_write_config(parent, reg, val | 0x8000, 2);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA5);
|
2001-12-02 10:48:52 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (udmamode >= 4) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2001-12-02 10:48:52 +00:00
|
|
|
|
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA4 on SiS chip\n",
|
2001-12-02 10:48:52 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
2001-12-14 21:28:49 +00:00
|
|
|
|
pci_write_config(parent, reg, val | 0x9000, 2);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA4);
|
2001-12-02 10:48:52 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (udmamode >= 2) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2001-12-02 10:48:52 +00:00
|
|
|
|
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA2 on SiS chip\n",
|
2001-12-02 10:48:52 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
2001-12-14 21:28:49 +00:00
|
|
|
|
pci_write_config(parent, reg, val | 0xb000, 2);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA2);
|
2001-12-02 10:48:52 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (ata_find_dev(parent, 0x05301039, 0) || /* SiS 530 */
|
|
|
|
|
ata_find_dev(parent, 0x05401039, 0) || /* SiS 540 */
|
|
|
|
|
ata_find_dev(parent, 0x06201039, 0) || /* SiS 620 */
|
|
|
|
|
ata_find_dev(parent, 0x06301039, 0)) { /* SiS 630 */
|
|
|
|
|
int8_t reg = 0x40 + (devno << 1);
|
|
|
|
|
int16_t val = pci_read_config(parent, reg, 2) & 0x0fff;
|
|
|
|
|
|
|
|
|
|
if (udmamode >= 4) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2001-12-02 10:48:52 +00:00
|
|
|
|
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA4 on SiS chip\n",
|
2001-12-02 10:48:52 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
pci_write_config(parent, reg, val | 0x9000, 2);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA4);
|
2001-12-02 10:48:52 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (udmamode >= 2) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2001-12-02 10:48:52 +00:00
|
|
|
|
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA2 on SiS chip\n",
|
2001-12-02 10:48:52 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
2001-12-14 21:28:49 +00:00
|
|
|
|
pci_write_config(parent, reg, val | 0xa000, 2);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA2);
|
2001-12-02 10:48:52 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-04-05 13:13:56 +00:00
|
|
|
|
} else if (udmamode >= 2 && chiprev > 0xc1) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2001-12-25 14:44:26 +00:00
|
|
|
|
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA2 on SiS chip\n",
|
2001-12-25 14:44:26 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
pci_write_config(parent, 0x40 + (devno << 1), 0xa301, 2);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA2);
|
2001-12-25 14:44:26 +00:00
|
|
|
|
return;
|
1999-12-13 10:19:39 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (wdmamode >=2 && apiomode >= 4) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
1999-12-13 10:19:39 +00:00
|
|
|
|
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting WDMA2 on SiS chip\n",
|
2000-01-24 20:45:24 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
1999-12-13 10:19:39 +00:00
|
|
|
|
if (!error) {
|
2000-02-18 20:57:33 +00:00
|
|
|
|
pci_write_config(parent, 0x40 + (devno << 1), 0x0301, 2);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_WDMA2);
|
2000-02-18 20:57:33 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* we could set PIO mode timings, but we assume the BIOS did that */
|
|
|
|
|
break;
|
|
|
|
|
|
2002-09-12 15:25:59 +00:00
|
|
|
|
case 0x06801095: /* Sil 0680 ATA133 controller */
|
|
|
|
|
{
|
|
|
|
|
u_int8_t ureg = 0xac + (device * 0x02) + (channel * 0x10);
|
|
|
|
|
u_int8_t uval = pci_read_config(parent, ureg, 1);
|
|
|
|
|
u_int8_t mreg = channel ? 0x84 : 0x80;
|
|
|
|
|
u_int8_t mask = device ? 0x30 : 0x03;
|
|
|
|
|
u_int8_t mode = pci_read_config(parent, mreg, 1);
|
|
|
|
|
|
|
|
|
|
/* enable UDMA mode */
|
|
|
|
|
pci_write_config(parent, mreg,
|
|
|
|
|
(mode & ~mask) | (device ? 0x30 : 0x03), 1);
|
|
|
|
|
if (udmamode >= 6) {
|
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
|
|
|
|
ATA_UDMA6, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA6 on Sil chip\n",
|
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
pci_write_config(parent, ureg, (uval & 0x3f) | 0x01, 1);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA6);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (udmamode >= 5) {
|
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
|
|
|
|
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA5 on Sil chip\n",
|
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
pci_write_config(parent, ureg, (uval & 0x3f) | 0x02, 1);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA5);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (udmamode >= 4) {
|
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
|
|
|
|
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA4 on Sil chip\n",
|
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
pci_write_config(parent, ureg, (uval & 0x3f) | 0x03, 1);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA4);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (udmamode >= 2) {
|
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
|
|
|
|
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA2 on Sil chip\n",
|
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
pci_write_config(parent, ureg, (uval & 0x3f) | 0x07, 1);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA2);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* disable UDMA mode and enable WDMA mode */
|
|
|
|
|
pci_write_config(parent, mreg,
|
|
|
|
|
(mode & ~mask) | (device ? 0x20 : 0x02), 1);
|
|
|
|
|
if (wdmamode >= 2 && apiomode >= 4) {
|
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
|
|
|
|
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting WDMA2 on Sil chip\n",
|
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
pci_write_config(parent, ureg - 0x4, 0x10c1, 2);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_WDMA2);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* restore PIO mode */
|
|
|
|
|
pci_write_config(parent, mreg, mode, 1);
|
|
|
|
|
}
|
|
|
|
|
/* we could set PIO mode timings, but we assume the BIOS did that */
|
|
|
|
|
break;
|
|
|
|
|
|
2000-10-03 13:12:36 +00:00
|
|
|
|
case 0x06491095: /* CMD 649 ATA100 controller */
|
|
|
|
|
if (udmamode >= 5) {
|
|
|
|
|
u_int8_t umode;
|
|
|
|
|
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2000-10-03 13:12:36 +00:00
|
|
|
|
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA5 on CMD chip\n",
|
2000-10-03 13:12:36 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
umode = pci_read_config(parent, channel ? 0x7b : 0x73, 1);
|
|
|
|
|
umode &= ~(device ? 0xca : 0x35);
|
|
|
|
|
umode |= (device ? 0x0a : 0x05);
|
|
|
|
|
pci_write_config(parent, channel ? 0x7b : 0x73, umode, 1);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA5);
|
2000-10-03 13:12:36 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
|
|
|
|
|
|
case 0x06481095: /* CMD 648 ATA66 controller */
|
|
|
|
|
if (udmamode >= 4) {
|
|
|
|
|
u_int8_t umode;
|
|
|
|
|
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2000-10-03 13:12:36 +00:00
|
|
|
|
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA4 on CMD chip\n",
|
2000-10-03 13:12:36 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
umode = pci_read_config(parent, channel ? 0x7b : 0x73, 1);
|
|
|
|
|
umode &= ~(device ? 0xca : 0x35);
|
|
|
|
|
umode |= (device ? 0x4a : 0x15);
|
|
|
|
|
pci_write_config(parent, channel ? 0x7b : 0x73, umode, 1);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA4);
|
2000-10-03 13:12:36 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (udmamode >= 2) {
|
|
|
|
|
u_int8_t umode;
|
|
|
|
|
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2000-10-03 13:12:36 +00:00
|
|
|
|
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA2 on CMD chip\n",
|
2000-10-03 13:12:36 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
umode = pci_read_config(parent, channel ? 0x7b : 0x73, 1);
|
|
|
|
|
umode &= ~(device ? 0xca : 0x35);
|
|
|
|
|
umode |= (device ? 0x42 : 0x11);
|
|
|
|
|
pci_write_config(parent, channel ? 0x7b : 0x73, umode, 1);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA2);
|
2000-10-03 13:12:36 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* make sure eventual UDMA mode from the BIOS is disabled */
|
2002-04-05 13:13:56 +00:00
|
|
|
|
pci_write_config(parent, channel ? 0x7b : 0x73,
|
|
|
|
|
pci_read_config(parent, channel ? 0x7b : 0x73, 1) &
|
2002-04-18 19:11:45 +00:00
|
|
|
|
~(device ? 0xca : 0x53), 1);
|
2000-10-03 13:12:36 +00:00
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
|
|
2000-02-18 20:57:33 +00:00
|
|
|
|
case 0x06461095: /* CMD 646 ATA controller */
|
|
|
|
|
if (wdmamode >= 2 && apiomode >= 4) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2000-02-18 20:57:33 +00:00
|
|
|
|
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting WDMA2 on CMD chip\n",
|
2000-02-18 20:57:33 +00:00
|
|
|
|
error ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
int32_t offset = (devno < 3) ? (devno << 1) : 7;
|
|
|
|
|
|
|
|
|
|
pci_write_config(parent, 0x54 + offset, 0x3f, 1);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_WDMA2);
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
1999-12-13 10:19:39 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* we could set PIO mode timings, but we assume the BIOS did that */
|
|
|
|
|
break;
|
|
|
|
|
|
2000-02-25 09:48:23 +00:00
|
|
|
|
case 0xc6931080: /* Cypress 82c693 ATA controller */
|
|
|
|
|
if (wdmamode >= 2 && apiomode >= 4) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2000-02-25 09:48:23 +00:00
|
|
|
|
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting WDMA2 on Cypress chip\n",
|
2000-02-25 09:48:23 +00:00
|
|
|
|
error ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
pci_write_config(atadev->channel->dev,
|
|
|
|
|
channel ? 0x4e:0x4c, 0x2020, 2);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_WDMA2);
|
2000-02-25 09:48:23 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* we could set PIO mode timings, but we assume the BIOS did that */
|
|
|
|
|
break;
|
|
|
|
|
|
2000-10-03 13:12:36 +00:00
|
|
|
|
case 0x01021078: /* Cyrix 5530 ATA33 controller */
|
2002-04-05 13:13:56 +00:00
|
|
|
|
atadev->channel->alignment = 0xf;
|
2000-09-19 11:08:39 +00:00
|
|
|
|
if (udmamode >= 2) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2000-09-19 11:08:39 +00:00
|
|
|
|
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA2 on Cyrix chip\n",
|
2000-09-19 11:08:39 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
cyrix_timing(atadev, devno, ATA_UDMA2);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA2);
|
2000-09-19 11:08:39 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (wdmamode >= 2 && apiomode >= 4) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2000-09-19 11:08:39 +00:00
|
|
|
|
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting WDMA2 on Cyrix chip\n",
|
2000-09-19 11:08:39 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
cyrix_timing(atadev, devno, ATA_WDMA2);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_WDMA2);
|
2000-09-19 11:08:39 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2001-10-06 11:07:04 +00:00
|
|
|
|
ATA_PIO0 + apiomode, ATA_C_F_SETXFER,
|
2000-09-19 11:08:39 +00:00
|
|
|
|
ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting %s on Cyrix chip\n",
|
2000-09-19 11:08:39 +00:00
|
|
|
|
(error) ? "failed" : "success",
|
2001-10-06 11:07:04 +00:00
|
|
|
|
ata_mode2str(ATA_PIO0 + apiomode));
|
2002-04-05 13:13:56 +00:00
|
|
|
|
cyrix_timing(atadev, devno, ATA_PIO0 + apiomode);
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
atadev->mode = ATA_PIO0 + apiomode;
|
2000-09-19 11:08:39 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2003-01-19 13:03:20 +00:00
|
|
|
|
case 0x02131166: /* ServerWorks CSB6 ATA 100 controller (chan 0+1) */
|
2002-03-18 12:13:13 +00:00
|
|
|
|
case 0x02121166: /* ServerWorks CSB5 ATA66/100 controller */
|
2003-01-19 13:03:20 +00:00
|
|
|
|
if (udmamode >= 5 && (chiptype == 0x02131166 ||
|
|
|
|
|
(chiptype == 0x02121166 && chiprev >= 0x92))) {
|
2002-03-18 12:13:13 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
|
|
|
|
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA5 on ServerWorks chip\n",
|
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
u_int16_t reg56;
|
|
|
|
|
|
|
|
|
|
pci_write_config(parent, 0x54,
|
|
|
|
|
pci_read_config(parent, 0x54, 1) |
|
|
|
|
|
(0x01 << devno), 1);
|
|
|
|
|
reg56 = pci_read_config(parent, 0x56, 2);
|
|
|
|
|
reg56 &= ~(0xf << (devno * 4));
|
|
|
|
|
reg56 |= (0x5 << (devno * 4));
|
|
|
|
|
pci_write_config(parent, 0x56, reg56, 2);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA5);
|
2002-03-18 12:13:13 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
2003-01-19 13:03:20 +00:00
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
|
|
|
|
|
|
case 0x02171166: /* ServerWorks CSB6 ATA 66 controller (chan 2) */
|
2002-03-18 12:13:13 +00:00
|
|
|
|
if (udmamode >= 4) {
|
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
|
|
|
|
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA4 on ServerWorks chip\n",
|
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
u_int16_t reg56;
|
|
|
|
|
|
|
|
|
|
pci_write_config(parent, 0x54,
|
|
|
|
|
pci_read_config(parent, 0x54, 1) |
|
|
|
|
|
(0x01 << devno), 1);
|
|
|
|
|
reg56 = pci_read_config(parent, 0x56, 2);
|
|
|
|
|
reg56 &= ~(0xf << (devno * 4));
|
|
|
|
|
reg56 |= (0x4 << (devno * 4));
|
|
|
|
|
pci_write_config(parent, 0x56, reg56, 2);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA4);
|
2002-03-18 12:13:13 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
|
|
2000-10-03 13:12:36 +00:00
|
|
|
|
case 0x02111166: /* ServerWorks ROSB4 ATA33 controller */
|
|
|
|
|
if (udmamode >= 2) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2000-10-03 13:12:36 +00:00
|
|
|
|
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA2 on ServerWorks chip\n",
|
2000-10-03 13:12:36 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
2000-12-19 10:37:03 +00:00
|
|
|
|
u_int16_t reg56;
|
|
|
|
|
|
2000-10-03 13:12:36 +00:00
|
|
|
|
pci_write_config(parent, 0x54,
|
|
|
|
|
pci_read_config(parent, 0x54, 1) |
|
|
|
|
|
(0x01 << devno), 1);
|
|
|
|
|
reg56 = pci_read_config(parent, 0x56, 2);
|
|
|
|
|
reg56 &= ~(0xf << (devno * 4));
|
|
|
|
|
reg56 |= (0x2 << (devno * 4));
|
|
|
|
|
pci_write_config(parent, 0x56, reg56, 2);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA2);
|
2000-10-03 13:12:36 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (wdmamode >= 2 && apiomode >= 4) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2000-10-03 13:12:36 +00:00
|
|
|
|
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting WDMA2 on ServerWorks chip\n",
|
2000-10-03 13:12:36 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
int offset = devno ^ 0x01;
|
2000-10-03 13:12:36 +00:00
|
|
|
|
int word44 = pci_read_config(parent, 0x44, 4);
|
|
|
|
|
|
|
|
|
|
pci_write_config(parent, 0x54,
|
|
|
|
|
pci_read_config(parent, 0x54, 1) &
|
|
|
|
|
~(0x01 << devno), 1);
|
|
|
|
|
word44 &= ~(0xff << (offset << 8));
|
|
|
|
|
word44 |= (0x20 << (offset << 8));
|
|
|
|
|
pci_write_config(parent, 0x44, 0x20, 4);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_WDMA2);
|
2000-10-03 13:12:36 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* we could set PIO mode timings, but we assume the BIOS did that */
|
|
|
|
|
break;
|
|
|
|
|
|
2002-01-28 13:17:10 +00:00
|
|
|
|
case 0x4d69105a: /* Promise TX2 ATA133 controllers */
|
2002-04-11 11:04:23 +00:00
|
|
|
|
case 0x6269105a: /* Promise TX2 ATA133 controllers */
|
2003-01-19 11:47:32 +00:00
|
|
|
|
case 0x1275105a: /* Promise TX2 ATA133 controllers */
|
|
|
|
|
case 0x5275105a: /* Promise TX2 ATA133 controllers */
|
2002-10-01 15:21:09 +00:00
|
|
|
|
case 0x7275105a: /* Promise TX2 ATA133 controllers */
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ATA_OUTB(atadev->channel->r_bmio, ATA_BMDEVSPEC_0, 0x0b);
|
|
|
|
|
if (udmamode >= 6 &&
|
|
|
|
|
!(ATA_INB(atadev->channel->r_bmio, ATA_BMDEVSPEC_1) & 0x04)) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2002-01-28 13:17:10 +00:00
|
|
|
|
ATA_UDMA6, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA6 on Promise chip\n",
|
2002-01-28 13:17:10 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA6);
|
2002-01-28 13:17:10 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
|
|
2001-06-08 09:51:33 +00:00
|
|
|
|
case 0x4d68105a: /* Promise TX2 ATA100 controllers */
|
2001-12-25 14:44:26 +00:00
|
|
|
|
case 0x6268105a: /* Promise TX2 ATA100 controllers */
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ATA_OUTB(atadev->channel->r_bmio, ATA_BMDEVSPEC_0, 0x0b);
|
|
|
|
|
if (udmamode >= 5 &&
|
|
|
|
|
!(ATA_INB(atadev->channel->r_bmio, ATA_BMDEVSPEC_1) & 0x04)) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2002-01-28 13:17:10 +00:00
|
|
|
|
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA5 on Promise chip\n",
|
2002-01-28 13:17:10 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA5);
|
2002-01-28 13:17:10 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ATA_OUTB(atadev->channel->r_bmio, ATA_BMDEVSPEC_0, 0x0b);
|
|
|
|
|
if (udmamode >= 4 &&
|
|
|
|
|
!(ATA_INB(atadev->channel->r_bmio, ATA_BMDEVSPEC_1) & 0x04)) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2002-01-28 13:17:10 +00:00
|
|
|
|
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
2001-10-03 08:27:29 +00:00
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA4 on Promise chip\n",
|
2002-01-28 13:17:10 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
2001-10-03 08:27:29 +00:00
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA4);
|
2001-10-03 08:27:29 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (udmamode >= 2) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2001-10-03 08:27:29 +00:00
|
|
|
|
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA on Promise chip\n",
|
|
|
|
|
(error) ? "failed" : "success");
|
2001-10-03 08:27:29 +00:00
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA2);
|
2001-10-03 08:27:29 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (wdmamode >= 2 && apiomode >= 4) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2001-10-03 08:27:29 +00:00
|
|
|
|
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting WDMA2 on Promise chip\n",
|
|
|
|
|
(error) ? "failed" : "success");
|
2001-10-03 08:27:29 +00:00
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_WDMA2);
|
2001-10-03 08:27:29 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0x0d30105a: /* Promise OEM ATA100 controllers */
|
2002-06-19 12:26:20 +00:00
|
|
|
|
case 0x4d30105a: /* Promise Ultra/FastTrak 100 controllers */
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (!ATAPI_DEVICE(atadev) && udmamode >= 5 &&
|
|
|
|
|
!(pci_read_config(parent, 0x50, 2) & (channel ? 1<<11 : 1<<10))) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2000-08-06 19:51:58 +00:00
|
|
|
|
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA5 on Promise chip\n",
|
2000-08-06 19:51:58 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
promise_timing(atadev, devno, ATA_UDMA5);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA5);
|
2000-08-06 19:51:58 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
2001-08-21 11:35:47 +00:00
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
|
|
2002-06-19 12:26:20 +00:00
|
|
|
|
case 0x0d38105a: /* Promise FastTrak 66 controllers */
|
2001-08-21 11:35:47 +00:00
|
|
|
|
case 0x4d38105a: /* Promise Ultra/FastTrak 66 controllers */
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (!ATAPI_DEVICE(atadev) && udmamode >= 4 &&
|
|
|
|
|
!(pci_read_config(parent, 0x50, 2) & (channel ? 1<<11 : 1<<10))) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
1999-11-08 21:36:00 +00:00
|
|
|
|
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
1999-11-06 16:50:21 +00:00
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA4 on Promise chip\n",
|
2000-01-24 20:45:24 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
1999-11-24 21:40:05 +00:00
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
promise_timing(atadev, devno, ATA_UDMA4);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA4);
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
1999-11-24 21:40:05 +00:00
|
|
|
|
}
|
1999-11-06 16:50:21 +00:00
|
|
|
|
}
|
2001-08-21 11:35:47 +00:00
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
|
|
|
|
|
|
case 0x4d33105a: /* Promise Ultra/FastTrak 33 controllers */
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (!ATAPI_DEVICE(atadev) && udmamode >= 2) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
1999-11-08 21:36:00 +00:00
|
|
|
|
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there
are some cool things in this one (and new bugs probably :) )...
The ATA driver has grown "real" timeout support for all devices.
This means that it should be possible to get in contact with
(especially) lost ATAPI devices. It also means that the ATA
driver is now usable on notebooks as it will DTRT on resume.
An experimental hack at utilizing the Promise66's at UDMA66 is
in there, but I cant test it. If someone feels like sending
me one, give me a ping.
The ATAPI DMA enableling scheme has been changed, also better DMA
support for the Aladdin chipset has been implemented for ATAPI
devices. Note that the Aladdin apparently only can do DMA reads
on ATAPI devices, and the Promise cant do ATAPI DMA at all.
I have seen problems on some ATAPI devices that should be able
to run in DMA mode, so if you encounter problems with hanging
atapi devices during the probe, or during access, disable DMA
in atapi-all.c, and let me know. It might be nessesary to do this
via a "white list" for known good devices...
The ATAPI CDROM driver can now use eject/close without hanging and
the bug that caused reading beyond the end of a CD has been fixed.
Media change is also handled proberly. DVD drives are identified
and are usable as CDROM devices at least, I dont have the HW to
test this further, see above :).
The ATAPI tape driver has gotten some support for using the DSC
method for not blocking the IDE channel during read/write when
the device has full buffers. It knows about the OnStream DI-30
device, support is not completed yet, but it can function as a
primitive backup medium, without filemarks, and without bad media
handeling. This is because the OnStream device doesn't handle this
(like everybody else) in HW. It also now supports getting/setting
the record position on devices that supports it.
Some rather major cleanups and rearrangements as well (cvs -b diff
is your freind). I'm closing in on declaring this for beta code,
most of the infrastruture is in place by now.
As usual USE AT YOUR OWN RISK!!, this is still alpha level code.
This driver can hose your disk real bad if anything goes wrong, but
now you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-09-21 19:50:40 +00:00
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA2 on Promise chip\n",
|
2000-01-24 20:45:24 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
1999-11-24 21:40:05 +00:00
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
promise_timing(atadev, devno, ATA_UDMA2);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA2);
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
1999-11-24 21:40:05 +00:00
|
|
|
|
}
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
}
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (!ATAPI_DEVICE(atadev) && wdmamode >= 2 && apiomode >= 4) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
1999-11-08 21:36:00 +00:00
|
|
|
|
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there
are some cool things in this one (and new bugs probably :) )...
The ATA driver has grown "real" timeout support for all devices.
This means that it should be possible to get in contact with
(especially) lost ATAPI devices. It also means that the ATA
driver is now usable on notebooks as it will DTRT on resume.
An experimental hack at utilizing the Promise66's at UDMA66 is
in there, but I cant test it. If someone feels like sending
me one, give me a ping.
The ATAPI DMA enableling scheme has been changed, also better DMA
support for the Aladdin chipset has been implemented for ATAPI
devices. Note that the Aladdin apparently only can do DMA reads
on ATAPI devices, and the Promise cant do ATAPI DMA at all.
I have seen problems on some ATAPI devices that should be able
to run in DMA mode, so if you encounter problems with hanging
atapi devices during the probe, or during access, disable DMA
in atapi-all.c, and let me know. It might be nessesary to do this
via a "white list" for known good devices...
The ATAPI CDROM driver can now use eject/close without hanging and
the bug that caused reading beyond the end of a CD has been fixed.
Media change is also handled proberly. DVD drives are identified
and are usable as CDROM devices at least, I dont have the HW to
test this further, see above :).
The ATAPI tape driver has gotten some support for using the DSC
method for not blocking the IDE channel during read/write when
the device has full buffers. It knows about the OnStream DI-30
device, support is not completed yet, but it can function as a
primitive backup medium, without filemarks, and without bad media
handeling. This is because the OnStream device doesn't handle this
(like everybody else) in HW. It also now supports getting/setting
the record position on devices that supports it.
Some rather major cleanups and rearrangements as well (cvs -b diff
is your freind). I'm closing in on declaring this for beta code,
most of the infrastruture is in place by now.
As usual USE AT YOUR OWN RISK!!, this is still alpha level code.
This driver can hose your disk real bad if anything goes wrong, but
now you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-09-21 19:50:40 +00:00
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting WDMA2 on Promise chip\n",
|
2000-01-24 20:45:24 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
1999-11-24 21:40:05 +00:00
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
promise_timing(atadev, devno, ATA_WDMA2);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_WDMA2);
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
1999-11-24 21:40:05 +00:00
|
|
|
|
}
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
}
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2001-10-06 11:07:04 +00:00
|
|
|
|
ATA_PIO0 + apiomode,
|
2000-01-03 10:26:59 +00:00
|
|
|
|
ATA_C_F_SETXFER, ATA_WAIT_READY);
|
1999-11-24 21:40:05 +00:00
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting PIO%d on Promise chip\n",
|
2000-01-24 20:45:24 +00:00
|
|
|
|
(error) ? "failed" : "success",
|
|
|
|
|
(apiomode >= 0) ? apiomode : 0);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
promise_timing(atadev, devno, ATA_PIO0 + apiomode);
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
atadev->mode = ATA_PIO0 + apiomode;
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
|
2001-10-23 09:25:57 +00:00
|
|
|
|
case 0x00041103: /* HighPoint HPT366/368/370/372 controllers */
|
2002-02-18 11:57:56 +00:00
|
|
|
|
case 0x00051103: /* HighPoint HPT372 controllers */
|
2002-02-11 15:48:04 +00:00
|
|
|
|
case 0x00081103: /* HighPoint HPT374 controllers */
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (!ATAPI_DEVICE(atadev) && udmamode >= 6 && hpt_cable80(atadev) &&
|
|
|
|
|
((chiptype == 0x00041103 && chiprev >= 0x05) ||
|
|
|
|
|
(chiptype == 0x00051103 && chiprev >= 0x01) ||
|
|
|
|
|
(chiptype == 0x00081103 && chiprev >= 0x07))) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2001-10-23 09:25:57 +00:00
|
|
|
|
ATA_UDMA6, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA6 on HighPoint chip\n",
|
2001-10-23 09:25:57 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
hpt_timing(atadev, devno, ATA_UDMA6);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA6);
|
2001-10-23 09:25:57 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (!ATAPI_DEVICE(atadev) && udmamode >= 5 && hpt_cable80(atadev) &&
|
|
|
|
|
((chiptype == 0x00041103 && chiprev >= 0x03) ||
|
|
|
|
|
(chiptype == 0x00051103 && chiprev >= 0x01) ||
|
|
|
|
|
(chiptype == 0x00081103 && chiprev >= 0x07))) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2000-08-06 19:51:58 +00:00
|
|
|
|
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA5 on HighPoint chip\n",
|
2000-08-06 19:51:58 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
hpt_timing(atadev, devno, ATA_UDMA5);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA5);
|
2000-08-06 19:51:58 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (!ATAPI_DEVICE(atadev) && udmamode >= 4 && hpt_cable80(atadev)) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
1999-11-08 21:36:00 +00:00
|
|
|
|
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
1999-10-09 19:57:13 +00:00
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA4 on HighPoint chip\n",
|
2000-01-24 20:45:24 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
1999-11-24 21:40:05 +00:00
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
hpt_timing(atadev, devno, ATA_UDMA4);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA4);
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
1999-11-24 21:40:05 +00:00
|
|
|
|
}
|
1999-10-09 19:57:13 +00:00
|
|
|
|
}
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (!ATAPI_DEVICE(atadev) && udmamode >= 2) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
1999-11-08 21:36:00 +00:00
|
|
|
|
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there
are some cool things in this one (and new bugs probably :) )...
The ATA driver has grown "real" timeout support for all devices.
This means that it should be possible to get in contact with
(especially) lost ATAPI devices. It also means that the ATA
driver is now usable on notebooks as it will DTRT on resume.
An experimental hack at utilizing the Promise66's at UDMA66 is
in there, but I cant test it. If someone feels like sending
me one, give me a ping.
The ATAPI DMA enableling scheme has been changed, also better DMA
support for the Aladdin chipset has been implemented for ATAPI
devices. Note that the Aladdin apparently only can do DMA reads
on ATAPI devices, and the Promise cant do ATAPI DMA at all.
I have seen problems on some ATAPI devices that should be able
to run in DMA mode, so if you encounter problems with hanging
atapi devices during the probe, or during access, disable DMA
in atapi-all.c, and let me know. It might be nessesary to do this
via a "white list" for known good devices...
The ATAPI CDROM driver can now use eject/close without hanging and
the bug that caused reading beyond the end of a CD has been fixed.
Media change is also handled proberly. DVD drives are identified
and are usable as CDROM devices at least, I dont have the HW to
test this further, see above :).
The ATAPI tape driver has gotten some support for using the DSC
method for not blocking the IDE channel during read/write when
the device has full buffers. It knows about the OnStream DI-30
device, support is not completed yet, but it can function as a
primitive backup medium, without filemarks, and without bad media
handeling. This is because the OnStream device doesn't handle this
(like everybody else) in HW. It also now supports getting/setting
the record position on devices that supports it.
Some rather major cleanups and rearrangements as well (cvs -b diff
is your freind). I'm closing in on declaring this for beta code,
most of the infrastruture is in place by now.
As usual USE AT YOUR OWN RISK!!, this is still alpha level code.
This driver can hose your disk real bad if anything goes wrong, but
now you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-09-21 19:50:40 +00:00
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting UDMA2 on HighPoint chip\n",
|
2000-01-24 20:45:24 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
1999-11-24 21:40:05 +00:00
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
hpt_timing(atadev, devno, ATA_UDMA2);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA2);
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
1999-11-24 21:40:05 +00:00
|
|
|
|
}
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
}
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (!ATAPI_DEVICE(atadev) && wdmamode >= 2 && apiomode >= 4) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
1999-11-08 21:36:00 +00:00
|
|
|
|
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there
are some cool things in this one (and new bugs probably :) )...
The ATA driver has grown "real" timeout support for all devices.
This means that it should be possible to get in contact with
(especially) lost ATAPI devices. It also means that the ATA
driver is now usable on notebooks as it will DTRT on resume.
An experimental hack at utilizing the Promise66's at UDMA66 is
in there, but I cant test it. If someone feels like sending
me one, give me a ping.
The ATAPI DMA enableling scheme has been changed, also better DMA
support for the Aladdin chipset has been implemented for ATAPI
devices. Note that the Aladdin apparently only can do DMA reads
on ATAPI devices, and the Promise cant do ATAPI DMA at all.
I have seen problems on some ATAPI devices that should be able
to run in DMA mode, so if you encounter problems with hanging
atapi devices during the probe, or during access, disable DMA
in atapi-all.c, and let me know. It might be nessesary to do this
via a "white list" for known good devices...
The ATAPI CDROM driver can now use eject/close without hanging and
the bug that caused reading beyond the end of a CD has been fixed.
Media change is also handled proberly. DVD drives are identified
and are usable as CDROM devices at least, I dont have the HW to
test this further, see above :).
The ATAPI tape driver has gotten some support for using the DSC
method for not blocking the IDE channel during read/write when
the device has full buffers. It knows about the OnStream DI-30
device, support is not completed yet, but it can function as a
primitive backup medium, without filemarks, and without bad media
handeling. This is because the OnStream device doesn't handle this
(like everybody else) in HW. It also now supports getting/setting
the record position on devices that supports it.
Some rather major cleanups and rearrangements as well (cvs -b diff
is your freind). I'm closing in on declaring this for beta code,
most of the infrastruture is in place by now.
As usual USE AT YOUR OWN RISK!!, this is still alpha level code.
This driver can hose your disk real bad if anything goes wrong, but
now you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-09-21 19:50:40 +00:00
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting WDMA2 on HighPoint chip\n",
|
2000-01-24 20:45:24 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
1999-11-24 21:40:05 +00:00
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
hpt_timing(atadev, devno, ATA_WDMA2);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_WDMA2);
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
1999-11-24 21:40:05 +00:00
|
|
|
|
}
|
1999-10-09 19:57:13 +00:00
|
|
|
|
}
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2001-10-06 11:07:04 +00:00
|
|
|
|
ATA_PIO0 + apiomode,
|
2000-01-03 10:26:59 +00:00
|
|
|
|
ATA_C_F_SETXFER, ATA_WAIT_READY);
|
1999-11-24 21:40:05 +00:00
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting PIO%d on HighPoint chip\n",
|
2000-01-24 20:45:24 +00:00
|
|
|
|
(error) ? "failed" : "success",
|
|
|
|
|
(apiomode >= 0) ? apiomode : 0);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
hpt_timing(atadev, devno, ATA_PIO0 + apiomode);
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
atadev->mode = ATA_PIO0 + apiomode;
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
|
2002-12-03 20:20:44 +00:00
|
|
|
|
case 0x00091191: /* Acard ATP865R controller */
|
|
|
|
|
case 0x00081191: /* Acard ATP865 controller */
|
|
|
|
|
if (ATAPI_DEVICE(atadev))
|
|
|
|
|
break;
|
|
|
|
|
if (udmamode >= 6) {
|
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
|
|
|
|
ATA_UDMA6, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting up UDMA6 mode on Acard chip\n",
|
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
u_int16_t reg44 = pci_read_config(parent, 0x44, 2);
|
|
|
|
|
|
|
|
|
|
reg44 &= ~(0x000f << (devno << 2));
|
|
|
|
|
reg44 |= (0x0007 << (devno << 2));
|
|
|
|
|
pci_write_config(parent, 0x44, reg44, 2);
|
|
|
|
|
pci_write_config(parent, 0x4a, 0xa6, 1);
|
|
|
|
|
pci_write_config(parent, 0x40 + devno, 0x031, 1);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA6);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (udmamode >= 5) {
|
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
|
|
|
|
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting up UDMA5 mode on Acard chip\n",
|
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
u_int16_t reg44 = pci_read_config(parent, 0x44, 2);
|
|
|
|
|
|
|
|
|
|
reg44 &= ~(0x000f << (devno << 2));
|
|
|
|
|
reg44 |= (0x0006 << (devno << 2));
|
|
|
|
|
pci_write_config(parent, 0x44, reg44, 2);
|
|
|
|
|
pci_write_config(parent, 0x4a, 0xa6, 1);
|
|
|
|
|
pci_write_config(parent, 0x40 + devno, 0x031, 1);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA5);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
|
|
|
|
|
|
case 0x00071191: /* Acard ATP860R controller */
|
|
|
|
|
case 0x00061191: /* Acard ATP860 controller */
|
|
|
|
|
if (ATAPI_DEVICE(atadev))
|
|
|
|
|
break;
|
|
|
|
|
if (udmamode >= 4) {
|
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
|
|
|
|
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting up UDMA4 mode on Acard chip\n",
|
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
u_int16_t reg44 = pci_read_config(parent, 0x44, 2);
|
|
|
|
|
|
|
|
|
|
reg44 &= ~(0x000f << (devno << 2));
|
|
|
|
|
reg44 |= (0x0005 << (devno << 2));
|
|
|
|
|
pci_write_config(parent, 0x44, reg44, 2);
|
|
|
|
|
pci_write_config(parent, 0x4a, 0xa6, 1);
|
|
|
|
|
pci_write_config(parent, 0x40 + devno, 0x031, 1);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA4);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (udmamode >= 2) {
|
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
2003-01-09 13:54:07 +00:00
|
|
|
|
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
2002-12-03 20:20:44 +00:00
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting up UDMA2 mode on Acard chip\n",
|
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
u_int16_t reg44 = pci_read_config(parent, 0x44, 2);
|
|
|
|
|
|
|
|
|
|
reg44 &= ~(0x000f << (devno << 2));
|
|
|
|
|
reg44 |= (0x0003 << (devno << 2));
|
|
|
|
|
pci_write_config(parent, 0x44, reg44, 2);
|
|
|
|
|
pci_write_config(parent, 0x4a, 0xa6, 1);
|
|
|
|
|
pci_write_config(parent, 0x40 + devno, 0x031, 1);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA2);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (wdmamode >= 2 && apiomode >= 4) {
|
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
|
|
|
|
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting up WDMA2 mode on Acard chip\n",
|
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
u_int16_t reg44 = pci_read_config(parent, 0x44, 2);
|
|
|
|
|
|
|
|
|
|
reg44 &= ~(0x000f << (devno << 2));
|
|
|
|
|
pci_write_config(parent, 0x44, reg44, 2);
|
|
|
|
|
pci_write_config(parent, 0x4a, 0xa6, 1);
|
|
|
|
|
pci_write_config(parent, 0x40 + devno, 0x031, 1);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_WDMA2);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* we could set PIO mode timings, but we assume the BIOS did that */
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0x00051191: /* Acard ATP850UF controller */
|
|
|
|
|
if (ATAPI_DEVICE(atadev))
|
|
|
|
|
break;
|
|
|
|
|
if (udmamode >= 2) {
|
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
|
|
|
|
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting up UDMA2 mode on Acard chip\n",
|
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
u_int8_t reg54 = pci_read_config(parent, 0x54, 1);
|
|
|
|
|
|
|
|
|
|
reg54 |= (0x03 << (devno << 1));
|
|
|
|
|
pci_write_config(parent, 0x54, reg54, 1);
|
|
|
|
|
pci_write_config(parent, 0x4a, 0xa6, 1);
|
|
|
|
|
pci_write_config(parent, 0x40 + (devno << 1), 0x0301, 2);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_UDMA2);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (wdmamode >= 2 && apiomode >= 4) {
|
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
|
|
|
|
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
ata_prtdev(atadev, "%s setting up WDMA2 mode on Acard chip\n",
|
|
|
|
|
(error) ? "failed" : "success");
|
|
|
|
|
if (!error) {
|
|
|
|
|
u_int8_t reg54 = pci_read_config(parent, 0x54, 1);
|
|
|
|
|
|
|
|
|
|
reg54 &= ~(0x03 << (devno << 1));
|
|
|
|
|
pci_write_config(parent, 0x54, reg54, 1);
|
|
|
|
|
pci_write_config(parent, 0x4a, 0xa6, 1);
|
|
|
|
|
pci_write_config(parent, 0x40 + (devno << 1), 0x0301, 2);
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_WDMA2);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* we could set PIO mode timings, but we assume the BIOS did that */
|
|
|
|
|
break;
|
|
|
|
|
|
2002-02-12 16:59:28 +00:00
|
|
|
|
case 0x000116ca: /* Cenatek Rocket Drive controller */
|
|
|
|
|
if (wdmamode >= 0 &&
|
2002-04-05 13:13:56 +00:00
|
|
|
|
(ATA_INB(atadev->channel->r_bmio, ATA_BMSTAT_PORT) &
|
|
|
|
|
(device ? ATA_BMSTAT_DMA_SLAVE : ATA_BMSTAT_DMA_MASTER)))
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_DMA);
|
2002-02-12 16:59:28 +00:00
|
|
|
|
else
|
|
|
|
|
atadev->mode = ATA_PIO;
|
|
|
|
|
return;
|
|
|
|
|
|
1999-09-22 12:04:51 +00:00
|
|
|
|
default: /* unknown controller chip */
|
|
|
|
|
/* better not try generic DMA on ATAPI devices it almost never works */
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (ATAPI_DEVICE(atadev))
|
1999-09-22 12:04:51 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2000-01-28 13:35:43 +00:00
|
|
|
|
/* if controller says its setup for DMA take the easy way out */
|
|
|
|
|
/* the downside is we dont know what DMA mode we are in */
|
2002-02-12 16:59:28 +00:00
|
|
|
|
if ((udmamode >= 0 || wdmamode >= 2) &&
|
2002-04-05 13:13:56 +00:00
|
|
|
|
(ATA_INB(atadev->channel->r_bmio, ATA_BMSTAT_PORT) &
|
|
|
|
|
(device ? ATA_BMSTAT_DMA_SLAVE : ATA_BMSTAT_DMA_MASTER))) {
|
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_DMA);
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
1999-09-22 12:04:51 +00:00
|
|
|
|
/* well, we have no support for this, but try anyways */
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if ((wdmamode >= 2 && apiomode >= 4) && atadev->channel->r_bmio) {
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
|
1999-11-08 21:36:00 +00:00
|
|
|
|
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
|
Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there
are some cool things in this one (and new bugs probably :) )...
The ATA driver has grown "real" timeout support for all devices.
This means that it should be possible to get in contact with
(especially) lost ATAPI devices. It also means that the ATA
driver is now usable on notebooks as it will DTRT on resume.
An experimental hack at utilizing the Promise66's at UDMA66 is
in there, but I cant test it. If someone feels like sending
me one, give me a ping.
The ATAPI DMA enableling scheme has been changed, also better DMA
support for the Aladdin chipset has been implemented for ATAPI
devices. Note that the Aladdin apparently only can do DMA reads
on ATAPI devices, and the Promise cant do ATAPI DMA at all.
I have seen problems on some ATAPI devices that should be able
to run in DMA mode, so if you encounter problems with hanging
atapi devices during the probe, or during access, disable DMA
in atapi-all.c, and let me know. It might be nessesary to do this
via a "white list" for known good devices...
The ATAPI CDROM driver can now use eject/close without hanging and
the bug that caused reading beyond the end of a CD has been fixed.
Media change is also handled proberly. DVD drives are identified
and are usable as CDROM devices at least, I dont have the HW to
test this further, see above :).
The ATAPI tape driver has gotten some support for using the DSC
method for not blocking the IDE channel during read/write when
the device has full buffers. It knows about the OnStream DI-30
device, support is not completed yet, but it can function as a
primitive backup medium, without filemarks, and without bad media
handeling. This is because the OnStream device doesn't handle this
(like everybody else) in HW. It also now supports getting/setting
the record position on devices that supports it.
Some rather major cleanups and rearrangements as well (cvs -b diff
is your freind). I'm closing in on declaring this for beta code,
most of the infrastruture is in place by now.
As usual USE AT YOUR OWN RISK!!, this is still alpha level code.
This driver can hose your disk real bad if anything goes wrong, but
now you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-09-21 19:50:40 +00:00
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting WDMA2 on generic chip\n",
|
2000-01-24 20:45:24 +00:00
|
|
|
|
(error) ? "failed" : "success");
|
1999-11-24 21:40:05 +00:00
|
|
|
|
if (!error) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmacreate(atadev, apiomode, ATA_WDMA2);
|
2000-01-28 13:35:43 +00:00
|
|
|
|
return;
|
1999-11-24 21:40:05 +00:00
|
|
|
|
}
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
error = ata_command(atadev, ATA_C_SETFEATURES, 0, ATA_PIO0 + apiomode,
|
2002-02-12 16:59:28 +00:00
|
|
|
|
ATA_C_F_SETXFER, ATA_WAIT_READY);
|
2000-01-03 10:26:59 +00:00
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "%s setting PIO%d on generic chip\n",
|
2000-02-04 10:20:22 +00:00
|
|
|
|
(error) ? "failed" : "success", apiomode < 0 ? 0 : apiomode);
|
|
|
|
|
if (!error)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
atadev->mode = ATA_PIO0 + apiomode;
|
2000-03-05 16:52:26 +00:00
|
|
|
|
else {
|
2000-02-04 10:20:22 +00:00
|
|
|
|
if (bootverbose)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_prtdev(atadev, "using PIO mode set by BIOS\n");
|
|
|
|
|
atadev->mode = ATA_PIO;
|
2000-03-05 16:52:26 +00:00
|
|
|
|
}
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-04-05 13:13:56 +00:00
|
|
|
|
struct ata_dmasetup_data_cb_args {
|
|
|
|
|
struct ata_dmaentry *dmatab;
|
|
|
|
|
int error;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
ata_dmasetupd_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int error)
|
|
|
|
|
{
|
|
|
|
|
struct ata_dmasetup_data_cb_args *cba =
|
|
|
|
|
(struct ata_dmasetup_data_cb_args *)xsc;
|
|
|
|
|
bus_size_t cnt;
|
|
|
|
|
u_int32_t lastcount;
|
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
|
|
cba->error = error;
|
|
|
|
|
if (error != 0)
|
|
|
|
|
return;
|
|
|
|
|
lastcount = j = 0;
|
|
|
|
|
for (i = 0; i < nsegs; i++) {
|
|
|
|
|
/*
|
|
|
|
|
* A maximum segment size was specified for bus_dma_tag_create, but
|
|
|
|
|
* some busdma code does not seem to honor this, so fix up if needed.
|
|
|
|
|
*/
|
|
|
|
|
for (cnt = 0; cnt < segs[i].ds_len; cnt += MAXSEGSZ, j++) {
|
|
|
|
|
cba->dmatab[j].base = htole32(segs[i].ds_addr + cnt);
|
|
|
|
|
lastcount = ulmin(segs[i].ds_len - cnt, MAXSEGSZ) & 0xffff;
|
|
|
|
|
cba->dmatab[j].count = htole32(lastcount);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
cba->dmatab[j - 1].count = htole32(lastcount | ATA_DMA_EOT);
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-19 11:08:39 +00:00
|
|
|
|
int
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmasetup(struct ata_device *atadev, caddr_t data, int32_t count)
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
{
|
2002-04-05 13:13:56 +00:00
|
|
|
|
struct ata_channel *ch = atadev->channel;
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
if (((uintptr_t)data & ch->alignment) || (count & ch->alignment)) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_prtdev(atadev, "non aligned DMA transfer attempted\n");
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
return -1;
|
2000-09-19 11:08:39 +00:00
|
|
|
|
}
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
|
|
|
|
|
if (!count) {
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_prtdev(atadev, "zero length DMA transfer attempted\n");
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-18 19:11:45 +00:00
|
|
|
|
int
|
|
|
|
|
ata_dmastart(struct ata_device *atadev, caddr_t data, int32_t count, int dir)
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
{
|
2002-04-18 19:11:45 +00:00
|
|
|
|
struct ata_channel *ch = atadev->channel;
|
|
|
|
|
struct ata_dmastate *ds = &atadev->dmastate;
|
|
|
|
|
struct ata_dmasetup_data_cb_args cba;
|
2002-04-05 13:13:56 +00:00
|
|
|
|
|
2002-04-18 19:11:45 +00:00
|
|
|
|
if (ds->flags & ATA_DS_ACTIVE)
|
|
|
|
|
panic("ata_dmasetup: transfer active on this device!");
|
|
|
|
|
|
2003-01-08 10:03:31 +00:00
|
|
|
|
switch(ch->chiptype) {
|
|
|
|
|
case 0x0d38105a: /* Promise Fasttrak 66 */
|
|
|
|
|
case 0x4d38105a: /* Promise Ultra/Fasttrak 66 */
|
|
|
|
|
case 0x0d30105a: /* Promise OEM ATA 100 */
|
|
|
|
|
case 0x4d30105a: /* Promise Ultra/Fasttrak 100 */
|
2003-01-19 11:47:32 +00:00
|
|
|
|
if (ch->flags & ATA_48BIT_ACTIVE) {
|
2003-01-19 20:18:07 +00:00
|
|
|
|
ATA_OUTB(ch->r_bmio, (ch->unit ? 0x09 : 0x11),
|
|
|
|
|
ATA_INB(ch->r_bmio, (ch->unit ? 0x09 : 0x11)) |
|
|
|
|
|
(ch->unit ? 0x08 : 0x02));
|
|
|
|
|
ATA_OUTL(ch->r_bmio, (ch->unit ? 0x1c : 0x20),
|
|
|
|
|
(dir ? 0x05000000 : 0x06000000) | (count >> 1));
|
2003-01-19 11:47:32 +00:00
|
|
|
|
}
|
2003-01-08 10:03:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-04-18 19:11:45 +00:00
|
|
|
|
cba.dmatab = ds->dmatab;
|
|
|
|
|
bus_dmamap_sync(ds->cdmatag, ds->cdmamap, BUS_DMASYNC_PREWRITE);
|
|
|
|
|
if (bus_dmamap_load(ds->ddmatag, ds->ddmamap, data, count,
|
|
|
|
|
ata_dmasetupd_cb, &cba, 0) || cba.error)
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
bus_dmamap_sync(ds->cdmatag, ds->cdmamap, BUS_DMASYNC_POSTWRITE);
|
2002-04-05 13:13:56 +00:00
|
|
|
|
bus_dmamap_sync(ds->ddmatag, ds->ddmamap, dir ? BUS_DMASYNC_PREREAD :
|
|
|
|
|
BUS_DMASYNC_PREWRITE);
|
2002-04-18 19:11:45 +00:00
|
|
|
|
|
|
|
|
|
ch->flags |= ATA_DMA_ACTIVE;
|
2003-01-08 10:03:31 +00:00
|
|
|
|
ds->flags = dir ? (ATA_DS_ACTIVE | ATA_DS_READ) : ATA_DS_ACTIVE;
|
2002-04-18 19:11:45 +00:00
|
|
|
|
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ATA_OUTL(ch->r_bmio, ATA_BMDTP_PORT, ds->mdmatab);
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ATA_OUTB(ch->r_bmio, ATA_BMCMD_PORT, dir ? ATA_BMCMD_WRITE_READ : 0);
|
|
|
|
|
ATA_OUTB(ch->r_bmio, ATA_BMSTAT_PORT,
|
2003-01-08 10:03:31 +00:00
|
|
|
|
(ATA_INB(ch->r_bmio, ATA_BMSTAT_PORT) |
|
|
|
|
|
(ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR)));
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ATA_OUTB(ch->r_bmio, ATA_BMCMD_PORT,
|
2003-01-08 10:03:31 +00:00
|
|
|
|
ATA_INB(ch->r_bmio, ATA_BMCMD_PORT) | ATA_BMCMD_START_STOP);
|
2002-04-18 19:11:45 +00:00
|
|
|
|
return 0;
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-09-19 11:08:39 +00:00
|
|
|
|
int
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ata_dmadone(struct ata_device *atadev)
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
{
|
2003-01-08 10:03:31 +00:00
|
|
|
|
struct ata_channel *ch = atadev->channel;
|
|
|
|
|
struct ata_dmastate *ds = &atadev->dmastate;
|
2001-02-06 16:44:25 +00:00
|
|
|
|
int error;
|
|
|
|
|
|
2003-01-08 10:03:31 +00:00
|
|
|
|
switch(ch->chiptype) {
|
|
|
|
|
case 0x0d38105a: /* Promise Fasttrak 66 */
|
|
|
|
|
case 0x4d38105a: /* Promise Ultra/Fasttrak 66 */
|
|
|
|
|
case 0x0d30105a: /* Promise OEM ATA 100 */
|
|
|
|
|
case 0x4d30105a: /* Promise Ultra/Fasttrak 100 */
|
2003-01-19 11:47:32 +00:00
|
|
|
|
if (ch->flags & ATA_48BIT_ACTIVE) {
|
2003-01-19 20:18:07 +00:00
|
|
|
|
ATA_OUTB(ch->r_bmio, (ch->unit ? 0x09 : 0x11),
|
|
|
|
|
ATA_INB(ch->r_bmio, (ch->unit ? 0x09 : 0x11)) &
|
|
|
|
|
~(ch->unit ? 0x08 : 0x02));
|
|
|
|
|
ATA_OUTL(ch->r_bmio, (ch->unit ? 0x1c : 0x20), 0);
|
2003-01-19 11:47:32 +00:00
|
|
|
|
}
|
2003-01-08 10:03:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-01-19 11:47:32 +00:00
|
|
|
|
error = ATA_INB(ch->r_bmio, ATA_BMSTAT_PORT);
|
|
|
|
|
ATA_OUTB(ch->r_bmio, ATA_BMCMD_PORT,
|
|
|
|
|
ATA_INB(ch->r_bmio, ATA_BMCMD_PORT) & ~ATA_BMCMD_START_STOP);
|
|
|
|
|
ATA_OUTB(ch->r_bmio, ATA_BMSTAT_PORT,ATA_BMSTAT_INTERRUPT|ATA_BMSTAT_ERROR);
|
|
|
|
|
|
2002-04-05 13:13:56 +00:00
|
|
|
|
bus_dmamap_sync(ds->ddmatag, ds->ddmamap, (ds->flags & ATA_DS_READ) != 0 ?
|
|
|
|
|
BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
|
|
|
|
|
bus_dmamap_unload(ds->ddmatag, ds->ddmamap);
|
2003-01-19 11:47:32 +00:00
|
|
|
|
|
2002-04-18 19:11:45 +00:00
|
|
|
|
ch->flags &= ~ATA_DMA_ACTIVE;
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ds->flags = 0;
|
2002-04-18 19:11:45 +00:00
|
|
|
|
return (error & ATA_BMSTAT_MASK);
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-09-19 11:08:39 +00:00
|
|
|
|
int
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
ata_dmastatus(struct ata_channel *ch)
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
{
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
return ATA_INB(ch->r_bmio, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK;
|
Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.
DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.
The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.
Fixed problems:
All known hang problems should be solved
The probe code has been sligthly changed, this should solve
the reports I have lying around (I hope).
Hangs when accessing ata & atapi device on the same channel simultaniously.
A real braino in ata_start caused this, fixed.
As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-03-28 18:57:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-10-09 19:57:13 +00:00
|
|
|
|
static void
|
2002-04-05 13:13:56 +00:00
|
|
|
|
cyrix_timing(struct ata_device *atadev, int devno, int mode)
|
2000-09-19 11:08:39 +00:00
|
|
|
|
{
|
|
|
|
|
u_int32_t reg20 = 0x0000e132;
|
|
|
|
|
u_int32_t reg24 = 0x00017771;
|
|
|
|
|
|
|
|
|
|
switch (mode) {
|
|
|
|
|
case ATA_PIO0: reg20 = 0x0000e132; break;
|
|
|
|
|
case ATA_PIO1: reg20 = 0x00018121; break;
|
|
|
|
|
case ATA_PIO2: reg20 = 0x00024020; break;
|
|
|
|
|
case ATA_PIO3: reg20 = 0x00032010; break;
|
|
|
|
|
case ATA_PIO4: reg20 = 0x00040010; break;
|
|
|
|
|
case ATA_WDMA2: reg24 = 0x00002020; break;
|
|
|
|
|
case ATA_UDMA2: reg24 = 0x00911030; break;
|
|
|
|
|
}
|
2002-04-05 13:13:56 +00:00
|
|
|
|
ATA_OUTL(atadev->channel->r_bmio, (devno << 3) + 0x20, reg20);
|
|
|
|
|
ATA_OUTL(atadev->channel->r_bmio, (devno << 3) + 0x24, reg24);
|
2000-09-19 11:08:39 +00:00
|
|
|
|
}
|
2002-01-28 13:17:10 +00:00
|
|
|
|
|
2000-09-19 11:08:39 +00:00
|
|
|
|
static void
|
2002-04-05 13:13:56 +00:00
|
|
|
|
promise_timing(struct ata_device *atadev, int devno, int mode)
|
2000-01-03 10:26:59 +00:00
|
|
|
|
{
|
2000-02-04 10:20:22 +00:00
|
|
|
|
u_int32_t timing = 0;
|
2002-04-05 13:13:56 +00:00
|
|
|
|
/* XXX: Endianess */
|
2000-02-04 10:20:22 +00:00
|
|
|
|
struct promise_timing {
|
|
|
|
|
u_int8_t pa:4;
|
|
|
|
|
u_int8_t prefetch:1;
|
|
|
|
|
u_int8_t iordy:1;
|
|
|
|
|
u_int8_t errdy:1;
|
|
|
|
|
u_int8_t syncin:1;
|
|
|
|
|
u_int8_t pb:5;
|
|
|
|
|
u_int8_t mb:3;
|
|
|
|
|
u_int8_t mc:4;
|
|
|
|
|
u_int8_t dmaw:1;
|
|
|
|
|
u_int8_t dmar:1;
|
|
|
|
|
u_int8_t iordyp:1;
|
|
|
|
|
u_int8_t dmarqp:1;
|
|
|
|
|
u_int8_t reserved:8;
|
|
|
|
|
} *t = (struct promise_timing*)&timing;
|
|
|
|
|
|
|
|
|
|
t->iordy = 1; t->iordyp = 1;
|
|
|
|
|
if (mode >= ATA_DMA) {
|
|
|
|
|
t->prefetch = 1; t->errdy = 1; t->syncin = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-05 13:13:56 +00:00
|
|
|
|
switch (atadev->channel->chiptype) {
|
2000-09-19 11:08:39 +00:00
|
|
|
|
case 0x4d33105a: /* Promise Ultra/Fasttrak 33 */
|
2000-02-04 10:20:22 +00:00
|
|
|
|
switch (mode) {
|
|
|
|
|
default:
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
case ATA_PIO0: t->pa = 9; t->pb = 19; t->mb = 7; t->mc = 15; break;
|
|
|
|
|
case ATA_PIO1: t->pa = 5; t->pb = 12; t->mb = 7; t->mc = 15; break;
|
|
|
|
|
case ATA_PIO2: t->pa = 3; t->pb = 8; t->mb = 7; t->mc = 15; break;
|
|
|
|
|
case ATA_PIO3: t->pa = 2; t->pb = 6; t->mb = 7; t->mc = 15; break;
|
|
|
|
|
case ATA_PIO4: t->pa = 1; t->pb = 4; t->mb = 7; t->mc = 15; break;
|
|
|
|
|
case ATA_WDMA2: t->pa = 3; t->pb = 7; t->mb = 3; t->mc = 3; break;
|
|
|
|
|
case ATA_UDMA2: t->pa = 3; t->pb = 7; t->mb = 1; t->mc = 1; break;
|
2000-02-04 10:20:22 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2002-06-19 12:26:20 +00:00
|
|
|
|
case 0x0d38105a: /* Promise Fasttrak 66 */
|
2000-09-19 11:08:39 +00:00
|
|
|
|
case 0x4d38105a: /* Promise Ultra/Fasttrak 66 */
|
|
|
|
|
case 0x0d30105a: /* Promise OEM ATA 100 */
|
2002-06-19 12:26:20 +00:00
|
|
|
|
case 0x4d30105a: /* Promise Ultra/Fasttrak 100 */
|
2000-02-04 10:20:22 +00:00
|
|
|
|
switch (mode) {
|
|
|
|
|
default:
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
case ATA_PIO0: t->pa = 15; t->pb = 31; t->mb = 7; t->mc = 15; break;
|
|
|
|
|
case ATA_PIO1: t->pa = 10; t->pb = 24; t->mb = 7; t->mc = 15; break;
|
|
|
|
|
case ATA_PIO2: t->pa = 6; t->pb = 16; t->mb = 7; t->mc = 15; break;
|
|
|
|
|
case ATA_PIO3: t->pa = 4; t->pb = 12; t->mb = 7; t->mc = 15; break;
|
|
|
|
|
case ATA_PIO4: t->pa = 2; t->pb = 8; t->mb = 7; t->mc = 15; break;
|
|
|
|
|
case ATA_WDMA2: t->pa = 6; t->pb = 14; t->mb = 6; t->mc = 6; break;
|
|
|
|
|
case ATA_UDMA2: t->pa = 6; t->pb = 14; t->mb = 2; t->mc = 2; break;
|
|
|
|
|
case ATA_UDMA4: t->pa = 3; t->pb = 7; t->mb = 1; t->mc = 1; break;
|
|
|
|
|
case ATA_UDMA5: t->pa = 3; t->pb = 7; t->mb = 1; t->mc = 1; break;
|
2000-02-04 10:20:22 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
2000-01-03 10:26:59 +00:00
|
|
|
|
}
|
2002-04-05 13:13:56 +00:00
|
|
|
|
pci_write_config(device_get_parent(atadev->channel->dev),
|
|
|
|
|
0x60 + (devno << 2), timing, 4);
|
2000-01-03 10:26:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2002-04-05 13:13:56 +00:00
|
|
|
|
hpt_timing(struct ata_device *atadev, int devno, int mode)
|
1999-10-09 19:57:13 +00:00
|
|
|
|
{
|
2002-04-05 13:13:56 +00:00
|
|
|
|
device_t parent = device_get_parent(atadev->channel->dev);
|
|
|
|
|
u_int32_t chiptype = atadev->channel->chiptype;
|
|
|
|
|
int chiprev = pci_get_revid(parent);
|
1999-10-09 19:57:13 +00:00
|
|
|
|
u_int32_t timing;
|
2002-03-08 21:36:49 +00:00
|
|
|
|
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (chiptype == 0x00081103 && chiprev >= 0x07) {
|
2002-02-18 11:57:56 +00:00
|
|
|
|
switch (mode) { /* HPT374 */
|
2002-02-11 15:48:04 +00:00
|
|
|
|
case ATA_PIO0: timing = 0x0ac1f48a; break;
|
|
|
|
|
case ATA_PIO1: timing = 0x0ac1f465; break;
|
|
|
|
|
case ATA_PIO2: timing = 0x0a81f454; break;
|
|
|
|
|
case ATA_PIO3: timing = 0x0a81f443; break;
|
|
|
|
|
case ATA_PIO4: timing = 0x0a81f442; break;
|
2002-03-03 15:36:21 +00:00
|
|
|
|
case ATA_WDMA2: timing = 0x22808242; break;
|
|
|
|
|
case ATA_UDMA2: timing = 0x120c8242; break;
|
|
|
|
|
case ATA_UDMA4: timing = 0x12ac8242; break;
|
|
|
|
|
case ATA_UDMA5: timing = 0x12848242; break;
|
|
|
|
|
case ATA_UDMA6: timing = 0x12808242; break;
|
2002-02-11 15:48:04 +00:00
|
|
|
|
default: timing = 0x0d029d5e;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-04-05 13:13:56 +00:00
|
|
|
|
else if ((chiptype == 0x00041103 && chiprev >= 0x05) ||
|
|
|
|
|
(chiptype == 0x00051103 && chiprev >= 0x01)) {
|
2002-02-18 11:57:56 +00:00
|
|
|
|
switch (mode) { /* HPT372 */
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
case ATA_PIO0: timing = 0x0d029d5e; break;
|
|
|
|
|
case ATA_PIO1: timing = 0x0d029d26; break;
|
|
|
|
|
case ATA_PIO2: timing = 0x0c829ca6; break;
|
|
|
|
|
case ATA_PIO3: timing = 0x0c829c84; break;
|
|
|
|
|
case ATA_PIO4: timing = 0x0c829c62; break;
|
2001-10-23 09:25:57 +00:00
|
|
|
|
case ATA_WDMA2: timing = 0x2c829262; break;
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
case ATA_UDMA2: timing = 0x1c91dc62; break;
|
|
|
|
|
case ATA_UDMA4: timing = 0x1c8ddc62; break;
|
|
|
|
|
case ATA_UDMA5: timing = 0x1c6ddc62; break;
|
|
|
|
|
case ATA_UDMA6: timing = 0x1c81dc62; break;
|
2001-10-23 09:25:57 +00:00
|
|
|
|
default: timing = 0x0d029d5e;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-04-05 13:13:56 +00:00
|
|
|
|
else if (chiptype == 0x00041103 && chiprev >= 0x03) {
|
2002-02-18 11:57:56 +00:00
|
|
|
|
switch (mode) { /* HPT370 */
|
2000-08-06 19:51:58 +00:00
|
|
|
|
case ATA_PIO0: timing = 0x06914e57; break;
|
|
|
|
|
case ATA_PIO1: timing = 0x06914e43; break;
|
|
|
|
|
case ATA_PIO2: timing = 0x06514e33; break;
|
|
|
|
|
case ATA_PIO3: timing = 0x06514e22; break;
|
|
|
|
|
case ATA_PIO4: timing = 0x06514e21; break;
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
case ATA_WDMA2: timing = 0x26514e21; break;
|
|
|
|
|
case ATA_UDMA2: timing = 0x16494e31; break;
|
|
|
|
|
case ATA_UDMA4: timing = 0x16454e31; break;
|
|
|
|
|
case ATA_UDMA5: timing = 0x16454e31; break;
|
2000-08-06 19:51:58 +00:00
|
|
|
|
default: timing = 0x06514e57;
|
1999-10-09 19:57:13 +00:00
|
|
|
|
}
|
2000-08-06 19:51:58 +00:00
|
|
|
|
pci_write_config(parent, 0x40 + (devno << 2) , timing, 4);
|
|
|
|
|
}
|
2002-02-18 11:57:56 +00:00
|
|
|
|
else { /* HPT36[68] */
|
2000-08-06 19:51:58 +00:00
|
|
|
|
switch (pci_read_config(parent, 0x41 + (devno << 2), 1)) {
|
|
|
|
|
case 0x85: /* 25Mhz */
|
|
|
|
|
switch (mode) {
|
2002-03-08 21:36:49 +00:00
|
|
|
|
case ATA_PIO0: timing = 0x40d08585; break;
|
|
|
|
|
case ATA_PIO1: timing = 0x40d08572; break;
|
|
|
|
|
case ATA_PIO2: timing = 0x40ca8542; break;
|
|
|
|
|
case ATA_PIO3: timing = 0x40ca8532; break;
|
|
|
|
|
case ATA_PIO4: timing = 0x40ca8521; break;
|
|
|
|
|
case ATA_WDMA2: timing = 0x20ca8521; break;
|
|
|
|
|
case ATA_UDMA2: timing = 0x10cf8521; break;
|
|
|
|
|
case ATA_UDMA4: timing = 0x10c98521; break;
|
2000-08-06 19:51:58 +00:00
|
|
|
|
default: timing = 0x01208585;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
case 0xa7: /* 33MHz */
|
|
|
|
|
switch (mode) {
|
2002-03-08 21:36:49 +00:00
|
|
|
|
case ATA_PIO0: timing = 0x40d0a7aa; break;
|
|
|
|
|
case ATA_PIO1: timing = 0x40d0a7a3; break;
|
|
|
|
|
case ATA_PIO2: timing = 0x40d0a753; break;
|
|
|
|
|
case ATA_PIO3: timing = 0x40c8a742; break;
|
|
|
|
|
case ATA_PIO4: timing = 0x40c8a731; break;
|
|
|
|
|
case ATA_WDMA2: timing = 0x20c8a731; break;
|
|
|
|
|
case ATA_UDMA2: timing = 0x10caa731; break;
|
|
|
|
|
case ATA_UDMA4: timing = 0x10c9a731; break;
|
2000-08-06 19:51:58 +00:00
|
|
|
|
default: timing = 0x0120a7a7;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 0xd9: /* 40Mhz */
|
|
|
|
|
switch (mode) {
|
2002-03-08 21:36:49 +00:00
|
|
|
|
case ATA_PIO0: timing = 0x4018d9d9; break;
|
|
|
|
|
case ATA_PIO1: timing = 0x4010d9c7; break;
|
|
|
|
|
case ATA_PIO2: timing = 0x4010d997; break;
|
|
|
|
|
case ATA_PIO3: timing = 0x4010d974; break;
|
|
|
|
|
case ATA_PIO4: timing = 0x4008d963; break;
|
|
|
|
|
case ATA_WDMA2: timing = 0x2008d943; break;
|
|
|
|
|
case ATA_UDMA2: timing = 0x100bd943; break;
|
|
|
|
|
case ATA_UDMA4: timing = 0x100fd943; break;
|
2000-08-06 19:51:58 +00:00
|
|
|
|
default: timing = 0x0120d9d9;
|
|
|
|
|
}
|
1999-10-09 19:57:13 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2002-03-08 21:36:49 +00:00
|
|
|
|
pci_write_config(parent, 0x40 + (devno << 2) , timing, 4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
2002-04-05 13:13:56 +00:00
|
|
|
|
hpt_cable80(struct ata_device *atadev)
|
2002-03-08 21:36:49 +00:00
|
|
|
|
{
|
2002-04-05 13:13:56 +00:00
|
|
|
|
device_t parent = device_get_parent(atadev->channel->dev);
|
2002-03-08 21:36:49 +00:00
|
|
|
|
u_int8_t reg, val, res;
|
|
|
|
|
|
2002-04-05 13:13:56 +00:00
|
|
|
|
if (atadev->channel->chiptype==0x00081103 && pci_get_function(parent)==1) {
|
|
|
|
|
reg = atadev->channel->unit ? 0x57 : 0x53;
|
2002-03-08 21:36:49 +00:00
|
|
|
|
val = pci_read_config(parent, reg, 1);
|
|
|
|
|
pci_write_config(parent, reg, val | 0x80, 1);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
reg = 0x5b;
|
|
|
|
|
val = pci_read_config(parent, reg, 1);
|
|
|
|
|
pci_write_config(parent, reg, val & 0xfe, 1);
|
|
|
|
|
}
|
2002-04-05 13:13:56 +00:00
|
|
|
|
res = pci_read_config(parent, 0x5a, 1) & (atadev->channel->unit ? 0x1:0x2);
|
2002-03-08 21:36:49 +00:00
|
|
|
|
pci_write_config(parent, reg, val, 1);
|
|
|
|
|
return !res;
|
1999-10-09 19:57:13 +00:00
|
|
|
|
}
|