#ifdef CONFIG_64BIT /* "low end" PA8800 machines use ZX1 chipset: PAT PDC and only run 64-bit */ #define ZX1_SUPPORT #endif
#ifdef CONFIG_PROC_FS /* depends on proc fs support. But costs CPU performance */ #undef SBA_COLLECT_STATS #endif
/* ** The number of pdir entries to "free" before issuing ** a read to PCOM register to flush out PCOM writes. ** Interacts with allocation granularity (ie 4 or 8 entries ** allocated and free'd/purged at a time might make this ** less interesting).
*/ #define DELAYED_RESOURCE_CNT 16
#define MAX_IOC 2 /* per Ike. Pluto/Astro only have 1. */ #define ROPES_PER_IOC 8 /* per Ike half or Pluto/Astro */
struct ioc { void __iomem *ioc_hpa; /* I/O MMU base address */ char *res_map; /* resource map, bit == pdir entry */
__le64 *pdir_base; /* physical base address */ unsignedlong ibase; /* pdir IOV Space base - shared w/lba_pci */ unsignedlong imask; /* pdir IOV Space mask - shared w/lba_pci */ #ifdef ZX1_SUPPORT unsignedlong iovp_mask; /* help convert IOVA to IOVP */ #endif unsignedlong *res_hint; /* next avail IOVP - circular search */
spinlock_t res_lock; unsignedint res_bitshift; /* from the LEFT! */ unsignedint res_size; /* size of resource map in bytes */ #ifdef SBA_HINT_SUPPORT /* FIXME : DMA HINTs not used */ unsignedlong hint_mask_pdir; /* bits used for DMA hints */ unsignedint hint_shift_pdir; #endif #if DELAYED_RESOURCE_CNT > 0 int saved_cnt; struct sba_dma_pair {
dma_addr_t iova;
size_t size;
} saved[DELAYED_RESOURCE_CNT]; #endif
#ifdef SBA_COLLECT_STATS #define SBA_SEARCH_SAMPLE 0x100 unsignedlong avg_search[SBA_SEARCH_SAMPLE]; unsignedlong avg_idx; /* current index into avg_search */ unsignedlong used_pages; unsignedlong msingle_calls; unsignedlong msingle_pages; unsignedlong msg_calls; unsignedlong msg_pages; unsignedlong usingle_calls; unsignedlong usingle_pages; unsignedlong usg_calls; unsignedlong usg_pages; #endif /* STUFF We don't need in performance path */ unsignedint pdir_size; /* in bytes, determined by IOV Space size */
};
struct sba_device { struct sba_device *next; /* list of SBA's in system */ struct parisc_device *dev; /* dev found in bus walk */ constchar *name; void __iomem *sba_hpa; /* base address */
spinlock_t sba_lock; unsignedint flags; /* state/functionality enabled */ unsignedint hw_rev; /* HW revision of chip */
struct resource chip_resv; /* MMIO reserved for chip */ struct resource iommu_resv; /* MMIO reserved for iommu */
unsignedint num_ioc; /* number of on-board IOC's */ struct ioc ioc[MAX_IOC];
};
/* list of SBA's in system, see drivers/parisc/sba_iommu.c */ externstruct sba_device *sba_list;
/* ** Offsets into MBIB (Function 0 on Ike and hopefully Astro) ** Firmware programs this stuff. Don't touch it.
*/ #define LMMIO_DIRECT0_BASE 0x300 #define LMMIO_DIRECT0_MASK 0x308 #define LMMIO_DIRECT0_ROUTE 0x310
/* ** IOC supports 4/8/16/64KB page sizes (see TCNFG register) ** It's safer (avoid memory corruption) to keep DMA page mappings ** equivalently sized to VM PAGE_SIZE. ** ** We really can't avoid generating a new mapping for each ** page since the Virtual Coherence Index has to be generated ** and updated for each page. ** ** PAGE_SIZE could be greater than IOVP_SIZE. But not the inverse.
*/ #define IOVP_SIZE PAGE_SIZE #define IOVP_SHIFT PAGE_SHIFT #define IOVP_MASK PAGE_MASK
/* ** I/O SAPIC init function ** Caller knows where an I/O SAPIC is. LBA has an integrated I/O SAPIC. ** Call setup as part of per instance initialization. ** (ie *not* init_module() function unless only one is present.) ** fixup_irq is to initialize PCI IRQ line support and ** virtualize pcidev->irq value. To be called by pci_fixup_bus().
*/ externvoid *iosapic_register(unsignedlong hpa, void __iomem *vaddr); externint iosapic_fixup_irq(void *obj, struct pci_dev *pcidev);
#define LBA_FUNC_ID 0x0000 /* function id */ #define LBA_FCLASS 0x0008 /* function class, bist, header, rev... */ #define LBA_CAPABLE 0x0030 /* capabilities register */
#define LBA_PCI_CFG_ADDR 0x0040 /* poke CFG address here */ #define LBA_PCI_CFG_DATA 0x0048 /* read or write data here */
#define LBA_PMC_MTLT 0x0050 /* Firmware sets this - read only. */ #define LBA_FW_SCRATCH 0x0058 /* Firmware writes the PCI bus number here. */ #define LBA_ERROR_ADDR 0x0070 /* On error, address gets logged here */
/* FIXME: ignore DMA Hint stuff until we can measure performance */ #define LBA_HINT_CFG 0x0310 #define LBA_HINT_BASE 0x0380 /* 14 registers at every 8 bytes. */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.