|
Linux Kernel
3.7.1
|
#include <linux/types.h>#include <linux/kernel.h>#include <linux/module.h>#include <linux/spinlock.h>#include <linux/slab.h>#include <linux/init.h>#include <linux/mm.h>#include <linux/string.h>#include <linux/pci.h>#include <linux/proc_fs.h>#include <linux/seq_file.h>#include <linux/acpi.h>#include <linux/efi.h>#include <linux/nodemask.h>#include <linux/bitops.h>#include <linux/crash_dump.h>#include <linux/iommu-helper.h>#include <linux/dma-mapping.h>#include <linux/prefetch.h>#include <asm/delay.h>#include <asm/io.h>#include <asm/page.h>#include <asm/dma.h>#include <asm/acpi-ext.h>Go to the source code of this file.
Data Structures | |
| struct | ioc |
| struct | ioc::sba_dma_pair |
| struct | ioc_iommu |
Macros | |
| #define | PFX "IOC: " |
| #define | ALLOW_IOV_BYPASS |
| #define | ENABLE_MARK_CLEAN |
| #define | SBA_INLINE __inline__ |
| #define | DBG_INIT(x...) |
| #define | DBG_RUN(x...) |
| #define | DBG_RUN_SG(x...) |
| #define | DBG_RES(x...) |
| #define | DBG_BYPASS(x...) |
| #define | ASSERT(expr) |
| #define | DELAYED_RESOURCE_CNT 64 |
| #define | PCI_DEVICE_ID_HP_SX2000_IOC 0x12ec |
| #define | ZX1_IOC_ID ((PCI_DEVICE_ID_HP_ZX1_IOC << 16) | PCI_VENDOR_ID_HP) |
| #define | ZX2_IOC_ID ((PCI_DEVICE_ID_HP_ZX2_IOC << 16) | PCI_VENDOR_ID_HP) |
| #define | REO_IOC_ID ((PCI_DEVICE_ID_HP_REO_IOC << 16) | PCI_VENDOR_ID_HP) |
| #define | SX1000_IOC_ID ((PCI_DEVICE_ID_HP_SX1000_IOC << 16) | PCI_VENDOR_ID_HP) |
| #define | SX2000_IOC_ID ((PCI_DEVICE_ID_HP_SX2000_IOC << 16) | PCI_VENDOR_ID_HP) |
| #define | ZX1_IOC_OFFSET 0x1000 /* ACPI reports SBA, we want IOC */ |
| #define | IOC_FUNC_ID 0x000 |
| #define | IOC_FCLASS 0x008 /* function class, bist, header, rev... */ |
| #define | IOC_IBASE 0x300 /* IO TLB */ |
| #define | IOC_IMASK 0x308 |
| #define | IOC_PCOM 0x310 |
| #define | IOC_TCNFG 0x318 |
| #define | IOC_PDIR_BASE 0x320 |
| #define | IOC_ROPE0_CFG 0x500 |
| #define | IOC_ROPE_AO 0x10 /* Allow "Relaxed Ordering" */ |
| #define | ZX1_SBA_IOMMU_COOKIE 0x0000badbadc0ffeeUL |
| #define | sba_sg_address(sg) sg_virt((sg)) |
| #define | GET_IOC(dev) NULL |
| #define | DMA_CHUNK_SIZE (BITS_PER_LONG*iovp_size) |
| #define | ROUNDUP(x, y) ((x + ((y)-1)) & ~((y)-1)) |
| #define | READ_REG(addr) __raw_readq(addr) |
| #define | WRITE_REG(val, addr) __raw_writeq(val, addr) |
| #define | PAGES_PER_RANGE 1 /* could increase this to 4 or 8 if needed */ |
| #define | SBA_IOVA(ioc, iovp, offset) ((ioc->ibase) | (iovp) | (offset)) |
| #define | SBA_IOVP(ioc, iova) ((iova) & ~(ioc->ibase)) |
| #define | PDIR_ENTRY_SIZE sizeof(u64) |
| #define | PDIR_INDEX(iovp) ((iovp)>>iovp_shift) |
| #define | RESMAP_MASK(n) ~(~0UL << (n)) |
| #define | RESMAP_IDX_MASK (sizeof(unsigned long) - 1) |
| #define | sba_io_pdir_entry(pdir_ptr, vba) |
| #define | PIDE_FLAG 0x1UL |
| #define | DMA_CONTIG(__X, __Y) (((((unsigned long) __X) | ((unsigned long) __Y)) << (BITS_PER_LONG - iovp_shift)) == 0UL) |
| #define | sba_map_ioc_to_node(ioc, handle) |
Typedefs | |
| typedef void( | initfunc )(struct ioc *) |
Functions | |
| int | swiotlb_late_init_with_default_size (size_t size) |
| void | sba_unmap_single_attrs (struct device *dev, dma_addr_t iova, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) |
| subsys_initcall (sba_init) | |
| __setup ("nosbagart", nosbagart) | |
| __setup ("sbapagesize=", sba_page_override) | |
| void | sba_dma_init (void) |
Variables | |
| struct dma_map_ops | swiotlb_dma_ops |
| struct dma_map_ops | sba_dma_ops |
| #define ALLOW_IOV_BYPASS |
Definition at line 68 of file sba_iommu.c.
| #define ASSERT | ( | expr | ) |
Definition at line 151 of file sba_iommu.c.
| #define DBG_BYPASS | ( | x... | ) |
Definition at line 141 of file sba_iommu.c.
| #define DBG_INIT | ( | x... | ) |
Definition at line 116 of file sba_iommu.c.
| #define DBG_RES | ( | x... | ) |
Definition at line 135 of file sba_iommu.c.
| #define DBG_RUN | ( | x... | ) |
Definition at line 122 of file sba_iommu.c.
| #define DBG_RUN_SG | ( | x... | ) |
Definition at line 128 of file sba_iommu.c.
| #define DELAYED_RESOURCE_CNT 64 |
Definition at line 161 of file sba_iommu.c.
| #define DMA_CHUNK_SIZE (BITS_PER_LONG*iovp_size) |
Definition at line 271 of file sba_iommu.c.
| #define DMA_CONTIG | ( | __X, | |
| __Y | |||
| ) | (((((unsigned long) __X) | ((unsigned long) __Y)) << (BITS_PER_LONG - iovp_shift)) == 0UL) |
Definition at line 1303 of file sba_iommu.c.
| #define ENABLE_MARK_CLEAN |
Definition at line 90 of file sba_iommu.c.
Definition at line 261 of file sba_iommu.c.
| #define IOC_FCLASS 0x008 /* function class, bist, header, rev... */ |
Definition at line 174 of file sba_iommu.c.
| #define IOC_FUNC_ID 0x000 |
Definition at line 173 of file sba_iommu.c.
| #define IOC_IBASE 0x300 /* IO TLB */ |
Definition at line 175 of file sba_iommu.c.
| #define IOC_IMASK 0x308 |
Definition at line 176 of file sba_iommu.c.
| #define IOC_PCOM 0x310 |
Definition at line 177 of file sba_iommu.c.
| #define IOC_PDIR_BASE 0x320 |
Definition at line 179 of file sba_iommu.c.
| #define IOC_ROPE0_CFG 0x500 |
Definition at line 181 of file sba_iommu.c.
| #define IOC_ROPE_AO 0x10 /* Allow "Relaxed Ordering" */ |
Definition at line 182 of file sba_iommu.c.
| #define IOC_TCNFG 0x318 |
Definition at line 178 of file sba_iommu.c.
Definition at line 432 of file sba_iommu.c.
| #define PCI_DEVICE_ID_HP_SX2000_IOC 0x12ec |
Definition at line 163 of file sba_iommu.c.
Definition at line 438 of file sba_iommu.c.
| #define PDIR_INDEX | ( | iovp | ) | ((iovp)>>iovp_shift) |
Definition at line 440 of file sba_iommu.c.
| #define PFX "IOC: " |
Definition at line 51 of file sba_iommu.c.
| #define PIDE_FLAG 0x1UL |
Definition at line 1208 of file sba_iommu.c.
| #define READ_REG | ( | addr | ) | __raw_readq(addr) |
Definition at line 282 of file sba_iommu.c.
| #define REO_IOC_ID ((PCI_DEVICE_ID_HP_REO_IOC << 16) | PCI_VENDOR_ID_HP) |
Definition at line 167 of file sba_iommu.c.
Definition at line 443 of file sba_iommu.c.
| #define RESMAP_MASK | ( | n | ) | ~(~0UL << (n)) |
Definition at line 442 of file sba_iommu.c.
| #define SBA_INLINE __inline__ |
Definition at line 110 of file sba_iommu.c.
| #define sba_io_pdir_entry | ( | pdir_ptr, | |
| vba | |||
| ) |
sba_io_pdir_entry - fill in one IO PDIR entry : pointer to IO PDIR entry : Virtual CPU address of buffer to map
SBA Mapping Routine
Given a virtual address (vba, arg1) sba_io_pdir_entry() loads the I/O PDIR entry pointed to by pdir_ptr (arg0). Each IO Pdir entry consists of 8 bytes as shown below (LSB == bit 0):
63 40 11 7 0 +-+------------------—+-------------------------------—+-—+-----—+ |V| U | PPN[39:12] | U | FF | +-+------------------—+-------------------------------—+-—+-----—+
V == Valid Bit U == Unused PPN == Physical Page Number
The physical address fields are filled with the results of virt_to_phys() on the vba.
Definition at line 799 of file sba_iommu.c.
Definition at line 435 of file sba_iommu.c.
Definition at line 2041 of file sba_iommu.c.
Definition at line 251 of file sba_iommu.c.
| #define SX1000_IOC_ID ((PCI_DEVICE_ID_HP_SX1000_IOC << 16) | PCI_VENDOR_ID_HP) |
Definition at line 168 of file sba_iommu.c.
| #define SX2000_IOC_ID ((PCI_DEVICE_ID_HP_SX2000_IOC << 16) | PCI_VENDOR_ID_HP) |
Definition at line 169 of file sba_iommu.c.
| #define WRITE_REG | ( | val, | |
| addr | |||
| ) | __raw_writeq(val, addr) |
Definition at line 283 of file sba_iommu.c.
| #define ZX1_IOC_ID ((PCI_DEVICE_ID_HP_ZX1_IOC << 16) | PCI_VENDOR_ID_HP) |
Definition at line 165 of file sba_iommu.c.
| #define ZX1_IOC_OFFSET 0x1000 /* ACPI reports SBA, we want IOC */ |
Definition at line 171 of file sba_iommu.c.
| #define ZX1_SBA_IOMMU_COOKIE 0x0000badbadc0ffeeUL |
Definition at line 186 of file sba_iommu.c.
| #define ZX2_IOC_ID ((PCI_DEVICE_ID_HP_ZX2_IOC << 16) | PCI_VENDOR_ID_HP) |
Definition at line 166 of file sba_iommu.c.
Definition at line 1795 of file sba_iommu.c.
| __setup | ( | "nosbagart" | , |
| nosbagart | |||
| ) |
| __setup | ( | ) |
Definition at line 2230 of file sba_iommu.c.
| void sba_unmap_single_attrs | ( | struct device * | dev, |
| dma_addr_t | iova, | ||
| size_t | size, | ||
| enum dma_data_direction | dir, | ||
| struct dma_attrs * | attrs | ||
| ) |
Definition at line 1117 of file sba_iommu.c.
| subsys_initcall | ( | sba_init | ) |
| struct dma_map_ops sba_dma_ops |
Definition at line 2215 of file sba_iommu.c.
| struct dma_map_ops swiotlb_dma_ops |
Definition at line 33 of file pci-swiotlb.c.
1.8.2