diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-02-10 00:32:07 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-03-20 04:12:10 -0500 |
commit | 8f6a93a196ba6c569c3e8daa6e81cca7e3ba81b1 (patch) | |
tree | 80d4747608148c56fd8c67baf016ad4fc58610ea /arch/sparc64/kernel/pci.c | |
parent | 4cce4b7cc56abc3d7b269d09224b8297aad15138 (diff) |
[SPARC64]: Beginnings of SUN4V PCI controller support.
Abstract out IOMMU operations so that we can have a different
set of calls on sun4v, which needs to do things through
hypervisor calls.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/pci.c')
-rw-r--r-- | arch/sparc64/kernel/pci.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index 2ff7c32ab0ce..95ffa9418620 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c | |||
@@ -188,6 +188,7 @@ extern void psycho_init(int, char *); | |||
188 | extern void schizo_init(int, char *); | 188 | extern void schizo_init(int, char *); |
189 | extern void schizo_plus_init(int, char *); | 189 | extern void schizo_plus_init(int, char *); |
190 | extern void tomatillo_init(int, char *); | 190 | extern void tomatillo_init(int, char *); |
191 | extern void sun4v_pci_init(int, char *); | ||
191 | 192 | ||
192 | static struct { | 193 | static struct { |
193 | char *model_name; | 194 | char *model_name; |
@@ -204,6 +205,7 @@ static struct { | |||
204 | { "pci108e,8002", schizo_plus_init }, | 205 | { "pci108e,8002", schizo_plus_init }, |
205 | { "SUNW,tomatillo", tomatillo_init }, | 206 | { "SUNW,tomatillo", tomatillo_init }, |
206 | { "pci108e,a801", tomatillo_init }, | 207 | { "pci108e,a801", tomatillo_init }, |
208 | { "SUNW,sun4v-pci", sun4v_pci_init }, | ||
207 | }; | 209 | }; |
208 | #define PCI_NUM_CONTROLLER_TYPES (sizeof(pci_controller_table) / \ | 210 | #define PCI_NUM_CONTROLLER_TYPES (sizeof(pci_controller_table) / \ |
209 | sizeof(pci_controller_table[0])) | 211 | sizeof(pci_controller_table[0])) |
@@ -283,6 +285,12 @@ int __init pcic_present(void) | |||
283 | return pci_controller_scan(pci_is_controller); | 285 | return pci_controller_scan(pci_is_controller); |
284 | } | 286 | } |
285 | 287 | ||
288 | struct pci_iommu_ops *pci_iommu_ops; | ||
289 | EXPORT_SYMBOL(pci_iommu_ops); | ||
290 | |||
291 | extern struct pci_iommu_ops pci_sun4u_iommu_ops, | ||
292 | pci_sun4v_iommu_ops; | ||
293 | |||
286 | /* Find each controller in the system, attach and initialize | 294 | /* Find each controller in the system, attach and initialize |
287 | * software state structure for each and link into the | 295 | * software state structure for each and link into the |
288 | * pci_controller_root. Setup the controller enough such | 296 | * pci_controller_root. Setup the controller enough such |
@@ -290,6 +298,11 @@ int __init pcic_present(void) | |||
290 | */ | 298 | */ |
291 | static void __init pci_controller_probe(void) | 299 | static void __init pci_controller_probe(void) |
292 | { | 300 | { |
301 | if (tlb_type == hypervisor) | ||
302 | pci_iommu_ops = &pci_sun4v_iommu_ops; | ||
303 | else | ||
304 | pci_iommu_ops = &pci_sun4u_iommu_ops; | ||
305 | |||
293 | printk("PCI: Probing for controllers.\n"); | 306 | printk("PCI: Probing for controllers.\n"); |
294 | 307 | ||
295 | pci_controller_scan(pci_controller_init); | 308 | pci_controller_scan(pci_controller_init); |