14 #include <linux/kernel.h>
15 #include <linux/pci.h>
17 #include <linux/string.h>
24 #include <asm/sections.h>
27 #include <asm/pci-bridge.h>
28 #include <asm/machdep.h>
31 #include <asm/iommu.h>
40 #define P5IOC2_TCE_MEMORY 0x01000000
44 unsigned int hwirq,
unsigned int is_64,
49 msg->
data = hwirq - phb->msi_base;
56 static void pnv_pci_init_p5ioc2_msis(
struct pnv_phb *phb)
58 unsigned int bmap_size;
60 "ibm,opal-msi-ranges",
NULL);
74 pr_err(
"PCI %d: Failed to allocate MSI bitmap !\n",
75 phb->
hose->global_number);
78 phb->
msi_setup = pnv_pci_p5ioc2_msi_setup;
79 phb->msi32_support = 0;
80 pr_info(
" Allocated bitmap for %d MSIs (base IRQ 0x%x)\n",
81 phb->msi_count, phb->msi_base);
84 static void pnv_pci_init_p5ioc2_msis(
struct pnv_phb *phb) { }
93 set_iommu_table_base(&pdev->
dev, &phb->
p5ioc2.iommu_table);
97 void *tce_mem,
u64 tce_size)
109 pr_err(
" Missing \"ibm,opal-phbid\" property !\n");
113 pr_devel(
" PHB-ID : 0x%016llx\n", phb_id);
115 pr_devel(
" TCE SZ : 0x%016llx\n", tce_size);
119 pr_err(
" Failed to set TCE memory, OPAL error %lld\n", rc);
128 if (!phb || !phb->
hose) {
129 pr_err(
" Failed to allocate PCI controller\n");
134 phb->
hose->first_busno = 0;
135 phb->
hose->last_busno = 0xff;
136 phb->
hose->private_data = phb;
144 pr_err(
" Failed to map registers !\n");
167 pnv_pci_init_p5ioc2_msis(phb);
172 tce_mem, tce_size, 0);
189 pr_err(
" Missing \"ibm,opal-hubid\" property !\n");
193 pr_info(
" HUB-ID : 0x%016llx\n", hub_id);
202 pr_err(
" Failed to allocate TCE Memory !\n");
205 pr_debug(
" TCE : 0x%016lx..0x%016lx\n",
210 pr_err(
" Failed to allocate TCE memory, OPAL error %lld\n", rc);
223 pr_info(
" Allocating %lld MB of TCE memory per PHB\n",
230 pnv_pci_init_p5ioc2_phb(phbn, tce_mem, tce_per_phb);
231 tce_mem += tce_per_phb;