Hopefully unbreak the 64bit DMA support this time.
This commit is contained in:
parent
04099f707e
commit
5b98ea3bb8
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user