diff options
author | sos <sos@FreeBSD.org> | 2000-10-30 09:36:40 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2000-10-30 09:36:40 +0000 |
commit | cc816837b46b09d068651c0666c59f27271ccc04 (patch) | |
tree | 2b905703f124d05900bf59572286d2b8e7947882 /sys | |
parent | c4bae732d250330f0293865a5feeb2cf1ccca79a (diff) | |
download | FreeBSD-src-cc816837b46b09d068651c0666c59f27271ccc04.zip FreeBSD-src-cc816837b46b09d068651c0666c59f27271ccc04.tar.gz |
Fix the PCCARD ATA breakage..
This is due to a bug that has been in there since Warneer did the
PCCARD stuff, the altioaddr is not offset 8 its offset 14 from
the base address.
Also only probe the master device, no known PCCARD ATA thingies
has a slave AFAIK..
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ata/ata-all.c | 8 | ||||
-rw-r--r-- | sys/dev/ata/ata-all.h | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index 947d820..2cd0565 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -181,7 +181,7 @@ ata_pccard_probe(device_t dev) } bus_release_resource(dev, SYS_RES_IOPORT, 0, port); scp->channel = 0; - scp->flags |= ATA_USE_16BIT; + scp->flags |= (ATA_USE_16BIT | ATA_NO_SLAVE); return ata_probe(dev); } @@ -794,7 +794,7 @@ ata_probe(device_t dev) altioaddr = rman_get_start(altio) + 0x02; } else - altioaddr = ioaddr + ATA_IOSIZE; + altioaddr = ioaddr + ATA_PCCARD_ALTOFFSET; rid = ATA_BMADDR_RID; bmio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); @@ -1241,6 +1241,10 @@ ata_reset(struct ata_softc *scp, int *mask) inb(scp->ioaddr + ATA_ERROR); DELAY(3000); + /* in some setups we dont want to test for a slave */ + if (scp->flags & ATA_NO_SLAVE) + *mask &= ~0x02; + /* wait for BUSY to go inactive */ for (timeout = 0; timeout < 310000; timeout++) { if (status0 & ATA_S_BUSY) { diff --git a/sys/dev/ata/ata-all.h b/sys/dev/ata/ata-all.h index d709a81..4d2e6c1 100644 --- a/sys/dev/ata/ata-all.h +++ b/sys/dev/ata/ata-all.h @@ -100,6 +100,7 @@ #define ATA_S_BUSY 0x80 /* busy */ #define ATA_ALTOFFSET 0x206 /* alternate registers offset */ +#define ATA_PCCARD_ALTOFFSET 0x0e /* do for PCCARD devices */ #define ATA_ALTIOSIZE 0x01 /* alternate registers size */ #define ATA_A_IDS 0x02 /* disable interrupts */ #define ATA_A_RESET 0x04 /* RESET controller */ @@ -306,8 +307,9 @@ struct ata_softc { #define ATA_DMA_ACTIVE 0x01 #define ATA_ATAPI_DMA_RO 0x02 #define ATA_USE_16BIT 0x04 -#define ATA_ATTACHED 0x08 -#define ATA_QUEUED 0x10 +#define ATA_NO_SLAVE 0x08 +#define ATA_ATTACHED 0x10 +#define ATA_QUEUED 0x20 int devices; /* what is present */ #define ATA_ATA_MASTER 0x01 |