Commit e7efa217 authored by David Mosberger's avatar David Mosberger

ia64: Get rid of pci_dma_bus_is_phys in favor of ia64_max_iommu_merge_mask.

parent 0a943740
...@@ -1682,6 +1682,10 @@ ioc_init(u64 hpa, void *handle) ...@@ -1682,6 +1682,10 @@ ioc_init(u64 hpa, void *handle)
ioc_resource_init(ioc); ioc_resource_init(ioc);
ioc_sac_init(ioc); ioc_sac_init(ioc);
if ((long) ~IOVP_MASK > (long) ia64_max_iommu_merge_mask)
ia64_max_iommu_merge_mask = ~IOVP_MASK;
MAX_DMA_ADDRESS = ~0UL;
printk(KERN_INFO PFX printk(KERN_INFO PFX
"%s %d.%d HPA 0x%lx IOVA space %dMb at 0x%lx\n", "%s %d.%d HPA 0x%lx IOVA space %dMb at 0x%lx\n",
ioc->name, (ioc->rev >> 4) & 0xF, ioc->rev & 0xF, ioc->name, (ioc->rev >> 4) & 0xF, ioc->rev & 0xF,
...@@ -1933,9 +1937,6 @@ static struct acpi_driver acpi_sba_ioc_driver = { ...@@ -1933,9 +1937,6 @@ static struct acpi_driver acpi_sba_ioc_driver = {
static int __init static int __init
sba_init(void) sba_init(void)
{ {
pci_dma_bus_is_phys = 0; /* suppress bounce buffer in block/net layers */
MAX_DMA_ADDRESS = ~0UL;
acpi_bus_register_driver(&acpi_sba_ioc_driver); acpi_bus_register_driver(&acpi_sba_ioc_driver);
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
......
...@@ -68,7 +68,16 @@ unsigned int num_io_spaces; ...@@ -68,7 +68,16 @@ unsigned int num_io_spaces;
unsigned char aux_device_present = 0xaa; /* XXX remove this when legacy I/O is gone */ unsigned char aux_device_present = 0xaa; /* XXX remove this when legacy I/O is gone */
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
int pci_dma_bus_is_phys = 1; /* default to direct mapping, unless we detect hw I/O MMU */ /*
* The merge_mask variable needs to be set to (max(iommu_page_size(iommu)) - 1). This
* mask specifies a mask of address bits that must be 0 in order for two buffers to be
* mergeable by the I/O MMU (i.e., the end address of the first buffer and the start
* address of the second buffer must be aligned to (merge_mask+1) in order to be
* mergeable). By default, we assume there is no I/O MMU which can merge physically
* discontiguous buffers, so we set the merge_mask to ~0UL, which corresponds to a iommu
* page-size of 2^64.
*/
unsigned long ia64_max_iommu_merge_mask = ~0UL;
#endif #endif
#define COMMAND_LINE_SIZE 512 #define COMMAND_LINE_SIZE 512
......
...@@ -413,8 +413,17 @@ extern void __ia64_memset_c_io (unsigned long, unsigned long, long); ...@@ -413,8 +413,17 @@ extern void __ia64_memset_c_io (unsigned long, unsigned long, long);
# endif /* __KERNEL__ */ # endif /* __KERNEL__ */
/* Argh, another magic macro... ;-( */ /*
extern int pci_dma_bus_is_phys; * It makes no sense at all to have this BIO_VMERGE_BOUNDARY macro here. Should be
#define BIO_VMERGE_BOUNDARY (pci_dma_bus_is_phys ? 0 : PAGE_SIZE) * replaced by dma_merge_mask() or something of that sort. Note: the only way
* BIO_VMERGE_BOUNDARY is used is to mask off bits. Effectively, our definition gets
* expanded into:
*
* addr & ((ia64_max_iommu_merge_mask + 1) - 1) == (addr & ia64_max_iommu_vmerge_mask)
*
* which is precisely what we want.
*/
extern unsigned long ia64_max_iommu_merge_mask;
#define BIO_VMERGE_BOUNDARY (ia64_max_iommu_merge_mask + 1)
#endif /* _ASM_IA64_IO_H */ #endif /* _ASM_IA64_IO_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment