- clearify the boot messages (features supported vs features used). Thanks to
Havard Eidnes for his complains about this :) - fix some typo in comments - hoppefully better detection of drives reporting bogus PIO modes.
This commit is contained in:
parent
4f3cc30bcc
commit
1e71e76d6c
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ata_wdc.c,v 1.6 1998/10/13 15:18:46 bouyer Exp $ */
|
||||
/* $NetBSD: ata_wdc.c,v 1.7 1998/11/11 19:38:27 bouyer Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 Manuel Bouyer.
|
||||
@ -426,11 +426,11 @@ wdc_ata_bio_intr(chp, xfer)
|
||||
* IDE drives deassert WDCS_BSY before trasfert is
|
||||
* complete when using DMA. Polling for DRQ to deassert
|
||||
* is not enouth DRQ is not required to be
|
||||
* asserted for DMA transferts, so poll for DRDY.
|
||||
* asserted for DMA transfers, so poll for DRDY.
|
||||
*/
|
||||
if (wdcwait(chp, WDCS_DRDY | WDCS_DRQ, WDCS_DRDY,
|
||||
ATA_DELAY) < 0) {
|
||||
printf("%s:%d:%d: polled transfert timed out "
|
||||
printf("%s:%d:%d: polled transfer timed out "
|
||||
"(st=0x%x)\n", chp->wdc->sc_dev.dv_xname,
|
||||
chp->channel, xfer->drive, chp->ch_status);
|
||||
ata_bio->error = TIMEOUT;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: wd.c,v 1.183 1998/10/20 17:00:25 bouyer Exp $ */
|
||||
/* $NetBSD: wd.c,v 1.184 1998/11/11 19:38:27 bouyer Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 Manuel Bouyer. All rights reserved.
|
||||
@ -129,7 +129,7 @@ struct wd_softc {
|
||||
struct disk sc_dk;
|
||||
struct buf sc_q;
|
||||
/* IDE disk soft states */
|
||||
struct ata_bio sc_wdc_bio; /* current transfert */
|
||||
struct ata_bio sc_wdc_bio; /* current transfer */
|
||||
struct buf *sc_bp; /* buf being transfered */
|
||||
void *wdc_softc; /* pointer to our parent */
|
||||
struct ata_drive_datas *drvp; /* Our controller's infos */
|
||||
@ -264,8 +264,8 @@ wdattach(parent, self, aux)
|
||||
wd->sc_multi = 1;
|
||||
}
|
||||
|
||||
printf("%s: using %d-sector pio transfers,", wd->sc_dev.dv_xname,
|
||||
wd->sc_multi);
|
||||
printf("%s: drive supports %d-sector pio transfers,",
|
||||
wd->sc_dev.dv_xname, wd->sc_multi);
|
||||
|
||||
/* Prior to ATA-4, LBA was optional. */
|
||||
if ((wd->sc_params.atap_capabilities1 & WDC_CAP_LBA) != 0)
|
||||
@ -278,7 +278,7 @@ wdattach(parent, self, aux)
|
||||
#endif
|
||||
|
||||
if ((wd->sc_flags & WDF_LBA) != 0) {
|
||||
printf(" lba mode\n");
|
||||
printf(" lba addressing\n");
|
||||
wd->sc_capacity =
|
||||
(wd->sc_params.atap_capacity[1] << 16) |
|
||||
wd->sc_params.atap_capacity[0];
|
||||
@ -292,7 +292,7 @@ wdattach(parent, self, aux)
|
||||
DEV_BSIZE,
|
||||
wd->sc_capacity);
|
||||
} else {
|
||||
printf(" chs mode\n");
|
||||
printf(" chs addressing\n");
|
||||
wd->sc_capacity =
|
||||
wd->sc_params.atap_cylinders *
|
||||
wd->sc_params.atap_heads *
|
||||
@ -423,7 +423,7 @@ __wdstart(wd, bp)
|
||||
/*
|
||||
* If we're retrying, retry in single-sector mode. This will give us
|
||||
* the sector number of the problem, and will eventually allow the
|
||||
* transfert to succeed.
|
||||
* transfer to succeed.
|
||||
*/
|
||||
if (wd->sc_multi == 1 || wd->retries > 0)
|
||||
wd->sc_wdc_bio.flags = ATA_SINGLE;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: wdvar.h,v 1.2 1998/10/12 16:09:17 bouyer Exp $ */
|
||||
/* $NetBSD: wdvar.h,v 1.3 1998/11/11 19:38:27 bouyer Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 Manuel Bouyer.
|
||||
@ -42,8 +42,8 @@ struct ata_bio {
|
||||
#define ATA_SINGLE 0x0008 /* transfer has to be done in single-sector mode */
|
||||
#define ATA_LBA 0x0010 /* tranfert uses LBA adressing */
|
||||
#define ATA_READ 0x0020 /* tranfert is a read (otherwise a write) */
|
||||
#define ATA_CORR 0x0040 /* transfert had a corrected error */
|
||||
int multi; /* number of blocks to transfert in multi-mode */
|
||||
#define ATA_CORR 0x0040 /* transfer had a corrected error */
|
||||
int multi; /* number of blocks to transfer in multi-mode */
|
||||
struct disklabel *lp; /* pointer to drive's label info */
|
||||
daddr_t blkno; /* block addr */
|
||||
daddr_t blkdone; /* number of blks transfered */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: wdc.c,v 1.38 1998/10/21 09:12:46 bouyer Exp $ */
|
||||
/* $NetBSD: wdc.c,v 1.39 1998/11/11 19:38:27 bouyer Exp $ */
|
||||
|
||||
|
||||
/*
|
||||
@ -719,8 +719,8 @@ wdc_probe_caps(drvp)
|
||||
if ((wdc->cap & (WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32)) ==
|
||||
(WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32)) {
|
||||
/*
|
||||
* Controller claims 16 and 32 bit transferts.
|
||||
* Re-do an UDENTIFY with 32-bit transferts,
|
||||
* Controller claims 16 and 32 bit transfers.
|
||||
* Re-do an IDENTIFY with 32-bit transfers,
|
||||
* and compare results.
|
||||
*/
|
||||
drvp->drive_flags |= DRIVE_CAP32;
|
||||
@ -729,8 +729,7 @@ wdc_probe_caps(drvp)
|
||||
/* Not good. fall back to 16bits */
|
||||
drvp->drive_flags &= ~DRIVE_CAP32;
|
||||
} else {
|
||||
printf("%s: using 32-bits pio transfers\n",
|
||||
drv_dev->dv_xname);
|
||||
printf("%s: 32-bits data port\n", drv_dev->dv_xname);
|
||||
}
|
||||
}
|
||||
|
||||
@ -749,10 +748,13 @@ wdc_probe_caps(drvp)
|
||||
* XXX some drives report something wrong here (they claim to
|
||||
* support PIO mode 8 !). As mode is coded on 3 bits in
|
||||
* SET FEATURE, limit it to 7 (so limit i to 4).
|
||||
* If higther mode than 7 is found, abort.
|
||||
*/
|
||||
for (i = 4; i >= 0; i--) {
|
||||
for (i = 7; i >= 0; i--) {
|
||||
if ((params.atap_piomode_supp & (1 << i)) == 0)
|
||||
continue;
|
||||
if (i > 4)
|
||||
return;
|
||||
/*
|
||||
* See if mode is accepted.
|
||||
* If the controller can't set its PIO mode,
|
||||
@ -764,8 +766,8 @@ wdc_probe_caps(drvp)
|
||||
AT_POLL) != CMD_OK)
|
||||
continue;
|
||||
if (!printed) {
|
||||
printf("%s: PIO mode %d", drv_dev->dv_xname,
|
||||
i + 3);
|
||||
printf("%s: drive supports PIO mode %d",
|
||||
drv_dev->dv_xname, i + 3);
|
||||
sep = ",";
|
||||
printed = 1;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pciide.c,v 1.14 1998/11/09 09:21:09 bouyer Exp $ */
|
||||
/* $NetBSD: pciide.c,v 1.15 1998/11/11 19:38:27 bouyer Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996, 1998 Christopher G. Demetriou. All rights reserved.
|
||||
@ -172,6 +172,7 @@ int pciide_dma_table_setup __P((struct pciide_softc*, int, int));
|
||||
int pciide_dma_init __P((void*, int, int, void *, size_t, int));
|
||||
void pciide_dma_start __P((void*, int, int, int));
|
||||
int pciide_dma_finish __P((void*, int, int, int));
|
||||
void pciide_print_modes __P((struct pciide_softc *));
|
||||
|
||||
struct pciide_product_desc {
|
||||
u_int32_t ide_product;
|
||||
@ -499,8 +500,11 @@ pciide_attach(parent, self, aux)
|
||||
sc->sc_wdcdev.dma_finish = pciide_dma_finish;
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
} else {
|
||||
printf("%s: pciide0: hardware does not support DMA",
|
||||
sc->sc_wdcdev.sc_dev.dv_xname);
|
||||
}
|
||||
printf("\n");
|
||||
sc->sc_pp->setup_cap(sc);
|
||||
sc->sc_wdcdev.channels = sc->wdc_channels;
|
||||
sc->sc_wdcdev.nchannels = PCIIDE_NUM_CHANNELS;
|
||||
@ -814,15 +818,14 @@ default_setup_chip(sc, pc, tag)
|
||||
if (pciide_dma_table_setup(sc, channel, drive) != 0) {
|
||||
/* Abort DMA setup */
|
||||
printf("%s:%d:%d: can't allocate DMA maps, "
|
||||
"using PIO transferts\n",
|
||||
"using PIO transfers\n",
|
||||
sc->sc_wdcdev.sc_dev.dv_xname,
|
||||
channel, drive);
|
||||
drvp->drive_flags &= ~DRIVE_DMA;
|
||||
}
|
||||
printf("%s:%d:%d: using DMA mode %d\n",
|
||||
printf("%s:%d:%d: using DMA data tranferts\n",
|
||||
sc->sc_wdcdev.sc_dev.dv_xname,
|
||||
channel, drive,
|
||||
drvp->DMA_mode);
|
||||
channel, drive);
|
||||
idedma_ctl |= IDEDMA_CTL_DRV_DMA(drive);
|
||||
}
|
||||
if (idedma_ctl != 0) {
|
||||
@ -1002,15 +1005,8 @@ end: /*
|
||||
if ((drvp[drive].drive_flags & DRIVE) == 0)
|
||||
continue;
|
||||
idetim |= piix_setup_idetim_drvs(&drvp[drive]);
|
||||
printf("%s(%s:%d:%d): using PIO mode %d",
|
||||
drvp[drive].drv_softc->dv_xname,
|
||||
sc->sc_wdcdev.sc_dev.dv_xname,
|
||||
channel, drive, drvp[drive].PIO_mode);
|
||||
if (drvp[drive].drive_flags & DRIVE_DMA) {
|
||||
if (drvp[drive].drive_flags & DRIVE_DMA)
|
||||
idedma_ctl |= IDEDMA_CTL_DRV_DMA(drive);
|
||||
printf(", DMA mode %d", drvp[drive].DMA_mode);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
if (idedma_ctl != 0) {
|
||||
/* Add software bits in status register */
|
||||
@ -1019,6 +1015,7 @@ end: /*
|
||||
idedma_ctl);
|
||||
}
|
||||
}
|
||||
pciide_print_modes(sc);
|
||||
WDCDEBUG_PRINT(("piix_setup_chip: idetim=0x%x, sidetim=0x%x\n",
|
||||
idetim, sidetim), DEBUG_PROBE);
|
||||
pci_conf_write(pc, tag, PIIX_IDETIM, idetim);
|
||||
@ -1110,15 +1107,6 @@ pio: /* use PIO mode */
|
||||
idetim =PIIX_IDETIM_SET(idetim,
|
||||
PIIX_IDETIM_SITRE, channel);
|
||||
}
|
||||
printf("%s(%s:%d:%d): using PIO mode %d",
|
||||
drvp->drv_softc->dv_xname,
|
||||
sc->sc_wdcdev.sc_dev.dv_xname,
|
||||
channel, drive, drvp->PIO_mode);
|
||||
if (drvp->drive_flags & DRIVE_DMA)
|
||||
printf(", DMA mode %d", drvp->DMA_mode);
|
||||
if (drvp->drive_flags & DRIVE_UDMA)
|
||||
printf(", UDMA mode %d", drvp->UDMA_mode);
|
||||
printf("\n");
|
||||
}
|
||||
if (idedma_ctl != 0) {
|
||||
/* Add software bits in status register */
|
||||
@ -1128,6 +1116,7 @@ pio: /* use PIO mode */
|
||||
}
|
||||
}
|
||||
|
||||
pciide_print_modes(sc);
|
||||
WDCDEBUG_PRINT(("piix3_4_setup_chip: idetim=0x%x, sidetim=0x%x",
|
||||
idetim, sidetim), DEBUG_PROBE);
|
||||
if (sc->sc_wdcdev.cap & WDC_CAPABILITY_UDMA) {
|
||||
@ -1341,15 +1330,6 @@ pio: /* setup PIO mode */
|
||||
apollo_pio_rec[mode]);
|
||||
drvp->PIO_mode = mode;
|
||||
drvp->DMA_mode = mode - 2;
|
||||
printf("%s(%s:%d:%d): using PIO mode %d",
|
||||
drvp->drv_softc->dv_xname,
|
||||
sc->sc_wdcdev.sc_dev.dv_xname,
|
||||
channel, drive, drvp->PIO_mode);
|
||||
if (drvp[drive].drive_flags & DRIVE_DMA)
|
||||
printf(", DMA mode %d", drvp->DMA_mode);
|
||||
if (drvp->drive_flags & DRIVE_UDMA)
|
||||
printf(", UDMA mode %d", drvp->UDMA_mode);
|
||||
printf("\n");
|
||||
}
|
||||
if (idedma_ctl != 0) {
|
||||
/* Add software bits in status register */
|
||||
@ -1358,6 +1338,7 @@ pio: /* setup PIO mode */
|
||||
idedma_ctl);
|
||||
}
|
||||
}
|
||||
pciide_print_modes(sc);
|
||||
WDCDEBUG_PRINT(("apollo_setup_chip: APO_DATATIM=0x%x, APO_UDMA=0x%x\n",
|
||||
datatim_reg, udmatim_reg), DEBUG_PROBE);
|
||||
pci_conf_write(pc, tag, APO_DATATIM, datatim_reg);
|
||||
@ -1738,3 +1719,32 @@ pciide_dma_finish(v, channel, drive, flags)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
pciide_print_modes(sc)
|
||||
struct pciide_softc *sc;
|
||||
{
|
||||
int channel, drive;
|
||||
struct channel_softc *chp;
|
||||
struct ata_drive_datas *drvp;
|
||||
|
||||
for (channel = 0; channel < PCIIDE_NUM_CHANNELS; channel++) {
|
||||
chp = &sc->wdc_channels[channel];
|
||||
for (drive = 0; drive < 2; drive++) {
|
||||
drvp = &chp->ch_drive[drive];
|
||||
if ((drvp->drive_flags & DRIVE) == 0)
|
||||
continue;
|
||||
printf("%s(%s:%d:%d): using PIO mode %d",
|
||||
drvp->drv_softc->dv_xname,
|
||||
sc->sc_wdcdev.sc_dev.dv_xname,
|
||||
channel, drive, drvp->PIO_mode);
|
||||
if (drvp->drive_flags & DRIVE_DMA)
|
||||
printf(", DMA mode %d", drvp->DMA_mode);
|
||||
if (drvp->drive_flags & DRIVE_UDMA)
|
||||
printf(", Ultra-DMA mode %d", drvp->UDMA_mode);
|
||||
if (drvp->drive_flags & (DRIVE_DMA | DRIVE_UDMA))
|
||||
printf(" (using DMA data transfers)");
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user