/* some regions of the IO address space do not get translated, so we must not give devices IO addresses in those regions. The regions are the 640KB-1MB region and the two PCI peripheral memory holes. Reserve all of them in the IOMMU bitmap to avoid giving them out later.  */
static void __init calgary_reserve_regions(struct pci_dev *dev)
/* some regions of the IO address space do not get translated, so we must not give devices IO addresses in those regions. The regions are the 640KB-1MB region and the two PCI peripheral memory holes. Reserve all of them in the IOMMU bitmap to avoid giving them out later.  */
static void __init calgary_reserve_regions(struct pci_dev *dev)
{
	unsigned int npages;
	u64 start;
	struct iommu_table *tbl = pci_iommu(dev->bus);
	iommu_range_reserve(tbl, DMA_ERROR_CODE, EMERGENCY_PAGES);
	if (is_calgary(dev->device)) {
		start = (640 * 1024);
		npages = ((1024 - 640) * 1024) >> PAGE_SHIFT;
	} else {
		start = 0;
		npages = (1 * 1024 * 1024) >> PAGE_SHIFT;
	}
	iommu_range_reserve(tbl, start, npages);
	calgary_reserve_peripheral_mem_1(dev);
	calgary_reserve_peripheral_mem_2(dev);
}