[Linux-ia64] Re: 64 Bits DMA Addresses for Alloc Consistent Interfaces.

From: Jesse Barnes <jbarnes_at_sgi.com>
Date: 2003-05-16 10:37:56
On Thu, May 15, 2003 at 07:31:20PM -0500, James Bottomley wrote:
> > A cost sensitive PCI-X device may wish to use 32-bit addressing in
> > it's descriptors in order to keep pin counts down etc.
> 
> This is certainly a property of the aic79xx driver (only using 32 bit
> descriptor tables).  It has this nice code in the driver for doing it:
> 
> aic79xx.c:
> 
> 	/*
> 	 * Although we can dma data above 4GB, our
> 	 * "consistent" memory is below 4GB for
> 	 * space efficiency reasons (only need a 4byte
> 	 * address).  For this reason, we have to reset
> 	 * our dma mask when doing allocations.
> 	 */
> 	if (ahd->dev_softc != NULL)
> 		ahd_pci_set_dma_mask(ahd->dev_softc, 0xFFFFFFFF);
> 	*vaddr = pci_alloc_consistent(ahd->dev_softc,
> 				      dmat->maxsize, &map->bus_addr);
> 	if (ahd->dev_softc != NULL)
> 		ahd_pci_set_dma_mask(ahd->dev_softc,
> 				     ahd->platform_data->hw_dma_mask);
> 
> And it comes in PCI-X flavours.

Ah, ok (set_dma_mask vs. alloc_consistent bugs aside).  I think there
was some confusion about the fact that the PCI-X spec. says that cards
must support DAC vs. them actually supporting 64 bit DMA addresses.
They all have to do the former, but not the latter.  Also, using an
IOMMU is different than using direct mapping.  Our hw can do both for
PCI cards that only handle 32 bit DMA addresses.  IOMMU mapping allows
you to map pages anywhere in memory, while direct mapping gives you a
static 2GB window into system memory.

Hope this clears things up a little.

Thanks,
Jesse
Received on Thu May 15 17:38:46 2003

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:14 EST