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..
This commit is contained in:
parent
dc5a40409d
commit
0dbc12d8ca
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=67935
@ -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) {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user