fsl_pci.c (74194cdaac41f6dfaacd9433f739dcbd83125d0b) | fsl_pci.c (11ddce15451eb5e3cb2c951dc5c8d86a2802017a) |
---|---|
1/* 2 * MPC83xx/85xx/86xx PCI/PCIE support routing. 3 * 4 * Copyright 2007-2012 Freescale Semiconductor, Inc. 5 * Copyright 2008-2009 MontaVista Software, Inc. 6 * 7 * Initial author: Xianghua Xiao <x.xiao@freescale.com> 8 * Recode: ZHANG WEI <wei.zhang@freescale.com> --- 119 unchanged lines hidden (view full) --- 128 hose->controller_ops.dma_dev_setup = pci_dma_dev_setup_swiotlb; 129 set_pci_dma_ops(&powerpc_swiotlb_dma_ops); 130 } 131} 132#else 133static inline void setup_swiotlb_ops(struct pci_controller *hose) {} 134#endif 135 | 1/* 2 * MPC83xx/85xx/86xx PCI/PCIE support routing. 3 * 4 * Copyright 2007-2012 Freescale Semiconductor, Inc. 5 * Copyright 2008-2009 MontaVista Software, Inc. 6 * 7 * Initial author: Xianghua Xiao <x.xiao@freescale.com> 8 * Recode: ZHANG WEI <wei.zhang@freescale.com> --- 119 unchanged lines hidden (view full) --- 128 hose->controller_ops.dma_dev_setup = pci_dma_dev_setup_swiotlb; 129 set_pci_dma_ops(&powerpc_swiotlb_dma_ops); 130 } 131} 132#else 133static inline void setup_swiotlb_ops(struct pci_controller *hose) {} 134#endif 135 |
136static int fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask) | 136static void fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask) |
137{ | 137{ |
138 if (!dev->dma_mask || !dma_supported(dev, dma_mask)) 139 return -EIO; 140 | |
141 /* 142 * Fix up PCI devices that are able to DMA to the large inbound 143 * mapping that allows addressing any RAM address from across PCI. 144 */ 145 if (dev_is_pci(dev) && dma_mask >= pci64_dma_offset * 2 - 1) { 146 dev->bus_dma_mask = 0; 147 set_dma_ops(dev, &dma_nommu_ops); 148 set_dma_offset(dev, pci64_dma_offset); 149 } | 138 /* 139 * Fix up PCI devices that are able to DMA to the large inbound 140 * mapping that allows addressing any RAM address from across PCI. 141 */ 142 if (dev_is_pci(dev) && dma_mask >= pci64_dma_offset * 2 - 1) { 143 dev->bus_dma_mask = 0; 144 set_dma_ops(dev, &dma_nommu_ops); 145 set_dma_offset(dev, pci64_dma_offset); 146 } |
150 151 *dev->dma_mask = dma_mask; 152 return 0; | |
153} 154 155static int setup_one_atmu(struct ccsr_pci __iomem *pci, 156 unsigned int index, const struct resource *res, 157 resource_size_t offset) 158{ 159 resource_size_t pci_addr = res->start - offset; 160 resource_size_t phys_addr = res->start; --- 1194 unchanged lines hidden --- | 147} 148 149static int setup_one_atmu(struct ccsr_pci __iomem *pci, 150 unsigned int index, const struct resource *res, 151 resource_size_t offset) 152{ 153 resource_size_t pci_addr = res->start - offset; 154 resource_size_t phys_addr = res->start; --- 1194 unchanged lines hidden --- |