diff options
Diffstat (limited to 'arch/powerpc/platforms/powernv/pci.h')
| -rw-r--r-- | arch/powerpc/platforms/powernv/pci.h | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h index 8b37b28e3831..8e36da379252 100644 --- a/arch/powerpc/platforms/powernv/pci.h +++ b/arch/powerpc/platforms/powernv/pci.h | |||
| @@ -8,9 +8,6 @@ | |||
| 8 | 8 | ||
| 9 | struct pci_dn; | 9 | struct pci_dn; |
| 10 | 10 | ||
| 11 | /* Maximum possible number of ATSD MMIO registers per NPU */ | ||
| 12 | #define NV_NMMU_ATSD_REGS 8 | ||
| 13 | |||
| 14 | enum pnv_phb_type { | 11 | enum pnv_phb_type { |
| 15 | PNV_PHB_IODA1 = 0, | 12 | PNV_PHB_IODA1 = 0, |
| 16 | PNV_PHB_IODA2 = 1, | 13 | PNV_PHB_IODA2 = 1, |
| @@ -65,6 +62,7 @@ struct pnv_ioda_pe { | |||
| 65 | 62 | ||
| 66 | /* "Base" iommu table, ie, 4K TCEs, 32-bit DMA */ | 63 | /* "Base" iommu table, ie, 4K TCEs, 32-bit DMA */ |
| 67 | struct iommu_table_group table_group; | 64 | struct iommu_table_group table_group; |
| 65 | struct npu_comp *npucomp; | ||
| 68 | 66 | ||
| 69 | /* 64-bit TCE bypass region */ | 67 | /* 64-bit TCE bypass region */ |
| 70 | bool tce_bypass_enabled; | 68 | bool tce_bypass_enabled; |
| @@ -106,20 +104,14 @@ struct pnv_phb { | |||
| 106 | struct dentry *dbgfs; | 104 | struct dentry *dbgfs; |
| 107 | #endif | 105 | #endif |
| 108 | 106 | ||
| 109 | #ifdef CONFIG_PCI_MSI | ||
| 110 | unsigned int msi_base; | 107 | unsigned int msi_base; |
| 111 | unsigned int msi32_support; | 108 | unsigned int msi32_support; |
| 112 | struct msi_bitmap msi_bmp; | 109 | struct msi_bitmap msi_bmp; |
| 113 | #endif | ||
| 114 | int (*msi_setup)(struct pnv_phb *phb, struct pci_dev *dev, | 110 | int (*msi_setup)(struct pnv_phb *phb, struct pci_dev *dev, |
| 115 | unsigned int hwirq, unsigned int virq, | 111 | unsigned int hwirq, unsigned int virq, |
| 116 | unsigned int is_64, struct msi_msg *msg); | 112 | unsigned int is_64, struct msi_msg *msg); |
| 117 | void (*dma_dev_setup)(struct pnv_phb *phb, struct pci_dev *pdev); | 113 | void (*dma_dev_setup)(struct pnv_phb *phb, struct pci_dev *pdev); |
| 118 | void (*fixup_phb)(struct pci_controller *hose); | ||
| 119 | int (*init_m64)(struct pnv_phb *phb); | 114 | int (*init_m64)(struct pnv_phb *phb); |
| 120 | void (*reserve_m64_pe)(struct pci_bus *bus, | ||
| 121 | unsigned long *pe_bitmap, bool all); | ||
| 122 | struct pnv_ioda_pe *(*pick_m64_pe)(struct pci_bus *bus, bool all); | ||
| 123 | int (*get_pe_state)(struct pnv_phb *phb, int pe_no); | 115 | int (*get_pe_state)(struct pnv_phb *phb, int pe_no); |
| 124 | void (*freeze_pe)(struct pnv_phb *phb, int pe_no); | 116 | void (*freeze_pe)(struct pnv_phb *phb, int pe_no); |
| 125 | int (*unfreeze_pe)(struct pnv_phb *phb, int pe_no, int opt); | 117 | int (*unfreeze_pe)(struct pnv_phb *phb, int pe_no, int opt); |
| @@ -180,19 +172,6 @@ struct pnv_phb { | |||
| 180 | unsigned int diag_data_size; | 172 | unsigned int diag_data_size; |
| 181 | u8 *diag_data; | 173 | u8 *diag_data; |
| 182 | 174 | ||
| 183 | /* Nvlink2 data */ | ||
| 184 | struct npu { | ||
| 185 | int index; | ||
| 186 | __be64 *mmio_atsd_regs[NV_NMMU_ATSD_REGS]; | ||
| 187 | unsigned int mmio_atsd_count; | ||
| 188 | |||
| 189 | /* Bitmask for MMIO register usage */ | ||
| 190 | unsigned long mmio_atsd_usage; | ||
| 191 | |||
| 192 | /* Do we need to explicitly flush the nest mmu? */ | ||
| 193 | bool nmmu_flush; | ||
| 194 | } npu; | ||
| 195 | |||
| 196 | int p2p_target_count; | 175 | int p2p_target_count; |
| 197 | }; | 176 | }; |
| 198 | 177 | ||
| @@ -210,6 +189,7 @@ extern void pnv_pci_init_ioda_hub(struct device_node *np); | |||
| 210 | extern void pnv_pci_init_ioda2_phb(struct device_node *np); | 189 | extern void pnv_pci_init_ioda2_phb(struct device_node *np); |
| 211 | extern void pnv_pci_init_npu_phb(struct device_node *np); | 190 | extern void pnv_pci_init_npu_phb(struct device_node *np); |
| 212 | extern void pnv_pci_init_npu2_opencapi_phb(struct device_node *np); | 191 | extern void pnv_pci_init_npu2_opencapi_phb(struct device_node *np); |
| 192 | extern void pnv_npu2_map_lpar(struct pnv_ioda_pe *gpe, unsigned long msr); | ||
| 213 | extern void pnv_pci_reset_secondary_bus(struct pci_dev *dev); | 193 | extern void pnv_pci_reset_secondary_bus(struct pci_dev *dev); |
| 214 | extern int pnv_eeh_phb_reset(struct pci_controller *hose, int option); | 194 | extern int pnv_eeh_phb_reset(struct pci_controller *hose, int option); |
| 215 | 195 | ||
| @@ -220,6 +200,8 @@ extern void pnv_teardown_msi_irqs(struct pci_dev *pdev); | |||
| 220 | extern struct pnv_ioda_pe *pnv_ioda_get_pe(struct pci_dev *dev); | 200 | extern struct pnv_ioda_pe *pnv_ioda_get_pe(struct pci_dev *dev); |
| 221 | extern void pnv_set_msi_irq_chip(struct pnv_phb *phb, unsigned int virq); | 201 | extern void pnv_set_msi_irq_chip(struct pnv_phb *phb, unsigned int virq); |
| 222 | extern void pnv_pci_ioda2_set_bypass(struct pnv_ioda_pe *pe, bool enable); | 202 | extern void pnv_pci_ioda2_set_bypass(struct pnv_ioda_pe *pe, bool enable); |
| 203 | extern unsigned long pnv_pci_ioda2_get_table_size(__u32 page_shift, | ||
| 204 | __u64 window_size, __u32 levels); | ||
| 223 | extern int pnv_eeh_post_init(void); | 205 | extern int pnv_eeh_post_init(void); |
| 224 | 206 | ||
| 225 | extern void pe_level_printk(const struct pnv_ioda_pe *pe, const char *level, | 207 | extern void pe_level_printk(const struct pnv_ioda_pe *pe, const char *level, |
| @@ -235,12 +217,10 @@ extern void pe_level_printk(const struct pnv_ioda_pe *pe, const char *level, | |||
| 235 | extern void pnv_npu_try_dma_set_bypass(struct pci_dev *gpdev, bool bypass); | 217 | extern void pnv_npu_try_dma_set_bypass(struct pci_dev *gpdev, bool bypass); |
| 236 | extern void pnv_pci_ioda2_tce_invalidate_entire(struct pnv_phb *phb, bool rm); | 218 | extern void pnv_pci_ioda2_tce_invalidate_entire(struct pnv_phb *phb, bool rm); |
| 237 | extern struct pnv_ioda_pe *pnv_pci_npu_setup_iommu(struct pnv_ioda_pe *npe); | 219 | extern struct pnv_ioda_pe *pnv_pci_npu_setup_iommu(struct pnv_ioda_pe *npe); |
| 238 | extern long pnv_npu_set_window(struct pnv_ioda_pe *npe, int num, | 220 | extern struct iommu_table_group *pnv_try_setup_npu_table_group( |
| 239 | struct iommu_table *tbl); | 221 | struct pnv_ioda_pe *pe); |
| 240 | extern long pnv_npu_unset_window(struct pnv_ioda_pe *npe, int num); | 222 | extern struct iommu_table_group *pnv_npu_compound_attach( |
| 241 | extern void pnv_npu_take_ownership(struct pnv_ioda_pe *npe); | 223 | struct pnv_ioda_pe *pe); |
| 242 | extern void pnv_npu_release_ownership(struct pnv_ioda_pe *npe); | ||
| 243 | extern int pnv_npu2_init(struct pnv_phb *phb); | ||
| 244 | 224 | ||
| 245 | /* pci-ioda-tce.c */ | 225 | /* pci-ioda-tce.c */ |
| 246 | #define POWERNV_IOMMU_DEFAULT_LEVELS 1 | 226 | #define POWERNV_IOMMU_DEFAULT_LEVELS 1 |
