diff options
author | sos <sos@FreeBSD.org> | 2007-04-08 19:18:51 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2007-04-08 19:18:51 +0000 |
commit | 5b98ea3bb85bd726dac504e939d66e84204b7450 (patch) | |
tree | 405e034151402816899c019df286b954b219da72 /sys/dev | |
parent | 04099f707e05f6e860d2b0ca1079407711ba9a6b (diff) | |
download | FreeBSD-src-5b98ea3bb85bd726dac504e939d66e84204b7450.zip FreeBSD-src-5b98ea3bb85bd726dac504e939d66e84204b7450.tar.gz |
Hopefully unbreak the 64bit DMA support this time.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ata/ata-all.h | 2 | ||||
-rw-r--r-- | sys/dev/ata/ata-chipset.c | 7 | ||||
-rw-r--r-- | sys/dev/ata/ata-dma.c | 11 |
3 files changed, 9 insertions, 11 deletions
diff --git a/sys/dev/ata/ata-all.h b/sys/dev/ata/ata-all.h index 31da23b..2c56373 100644 --- a/sys/dev/ata/ata-all.h +++ b/sys/dev/ata/ata-all.h @@ -441,11 +441,11 @@ struct ata_dma { u_int32_t segsize; /* DMA SG list segment size */ u_int32_t max_iosize; /* DMA data max IO size */ u_int32_t cur_iosize; /* DMA data current IO size */ + u_int64_t max_address; /* highest DMA'able address */ int flags; #define ATA_DMA_READ 0x01 /* transaction is a read */ #define ATA_DMA_LOADED 0x02 /* DMA tables etc loaded */ #define ATA_DMA_ACTIVE 0x04 /* DMA transfer in progress */ -#define ATA_DMA_64BIT 0x10 /* supports 64bit addressing */ void (*alloc)(device_t dev); void (*free)(device_t dev); diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c index 66de3bd..e37083c 100644 --- a/sys/dev/ata/ata-chipset.c +++ b/sys/dev/ata/ata-chipset.c @@ -776,7 +776,7 @@ ata_ahci_dmainit(device_t dev) ch->dma->setprd = ata_ahci_dmasetprd; ch->dma->max_iosize = 8192 * DEV_BSIZE; if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_64BIT) - ch->dma->flags |= ATA_DMA_64BIT; + ch->dma->max_address = BUS_SPACE_MAXADDR; } } @@ -2734,7 +2734,7 @@ ata_marvell_edma_dmainit(device_t dev) ch->dma->setprd = ata_marvell_edma_dmasetprd; if (ATA_INL(ctlr->r_res1, 0x00d00) & 0x00000004) - ch->dma->flags |= ATA_DMA_64BIT; + ch->dma->max_address = BUS_SPACE_MAXADDR; } } @@ -4816,8 +4816,7 @@ ata_siiprb_dmainit(device_t dev) if (ch->dma) { /* note start and stop are not used here */ ch->dma->setprd = ata_siiprb_dmasetprd; - - ch->dma->flags |= ATA_DMA_64BIT; + ch->dma->max_address = BUS_SPACE_MAXADDR; } } diff --git a/sys/dev/ata/ata-dma.c b/sys/dev/ata/ata-dma.c index 4627856..a9b7a22 100644 --- a/sys/dev/ata/ata-dma.c +++ b/sys/dev/ata/ata-dma.c @@ -78,6 +78,7 @@ ata_dmainit(device_t dev) ch->dma->boundary = 128 * DEV_BSIZE; ch->dma->segsize = 128 * DEV_BSIZE; ch->dma->max_iosize = 128 * DEV_BSIZE; + ch->dma->max_address = BUS_SPACE_MAXADDR_32BIT; } } @@ -95,24 +96,22 @@ ata_dmaalloc(device_t dev) { struct ata_channel *ch = device_get_softc(dev); struct ata_dc_cb_args ccba; - int maxaddr = (ch->dma->flags & ATA_DMA_64BIT ? - BUS_SPACE_MAXADDR : BUS_SPACE_MAXADDR_32BIT); if (bus_dma_tag_create(bus_get_dma_tag(dev), ch->dma->alignment, 0, - maxaddr, BUS_SPACE_MAXADDR, + ch->dma->max_address, BUS_SPACE_MAXADDR, NULL, NULL, ch->dma->max_iosize, ATA_DMA_ENTRIES, ch->dma->segsize, 0, NULL, NULL, &ch->dma->dmatag)) goto error; if (bus_dma_tag_create(ch->dma->dmatag, PAGE_SIZE, PAGE_SIZE, - maxaddr, BUS_SPACE_MAXADDR, + ch->dma->max_address, BUS_SPACE_MAXADDR, NULL, NULL, MAXTABSZ, 1, MAXTABSZ, 0, NULL, NULL, &ch->dma->sg_tag)) goto error; if (bus_dma_tag_create(ch->dma->dmatag,ch->dma->alignment,ch->dma->boundary, - maxaddr, BUS_SPACE_MAXADDR, + ch->dma->max_address, BUS_SPACE_MAXADDR, NULL, NULL, ch->dma->max_iosize, ATA_DMA_ENTRIES, ch->dma->segsize, 0, NULL, NULL, &ch->dma->data_tag)) @@ -133,7 +132,7 @@ ata_dmaalloc(device_t dev) goto error; if (bus_dma_tag_create(ch->dma->dmatag, PAGE_SIZE, 64 * 1024, - maxaddr, BUS_SPACE_MAXADDR, + ch->dma->max_address, BUS_SPACE_MAXADDR, NULL, NULL, MAXWSPCSZ, 1, MAXWSPCSZ, 0, NULL, NULL, &ch->dma->work_tag)) goto error; |