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_sun4v.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_sun4v.c')
-rw-r--r-- | arch/sparc64/kernel/pci_sun4v.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c new file mode 100644 index 000000000000..c1a077196c57 --- /dev/null +++ b/arch/sparc64/kernel/pci_sun4v.c | |||
@@ -0,0 +1,74 @@ | |||
1 | /* pci_sun4v.c: SUN4V specific PCI controller support. | ||
2 | * | ||
3 | * Copyright (C) 2006 David S. Miller (davem@davemloft.net) | ||
4 | */ | ||
5 | |||
6 | #include <linux/kernel.h> | ||
7 | #include <linux/types.h> | ||
8 | #include <linux/pci.h> | ||
9 | #include <linux/init.h> | ||
10 | #include <linux/slab.h> | ||
11 | #include <linux/interrupt.h> | ||
12 | |||
13 | #include <asm/pbm.h> | ||
14 | #include <asm/iommu.h> | ||
15 | #include <asm/irq.h> | ||
16 | #include <asm/upa.h> | ||
17 | #include <asm/pstate.h> | ||
18 | #include <asm/oplib.h> | ||
19 | #include <asm/hypervisor.h> | ||
20 | |||
21 | #include "pci_impl.h" | ||
22 | #include "iommu_common.h" | ||
23 | |||
24 | static void *pci_4v_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp) | ||
25 | { | ||
26 | return NULL; | ||
27 | } | ||
28 | |||
29 | static void pci_4v_free_consistent(struct pci_dev *pdev, size_t size, void *cpu, dma_addr_t dvma) | ||
30 | { | ||
31 | } | ||
32 | |||
33 | static dma_addr_t pci_4v_map_single(struct pci_dev *pdev, void *ptr, size_t sz, int direction) | ||
34 | { | ||
35 | return 0; | ||
36 | } | ||
37 | |||
38 | static void pci_4v_unmap_single(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int direction) | ||
39 | { | ||
40 | } | ||
41 | |||
42 | static int pci_4v_map_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction) | ||
43 | { | ||
44 | return nelems; | ||
45 | } | ||
46 | |||
47 | static void pci_4v_unmap_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction) | ||
48 | { | ||
49 | } | ||
50 | |||
51 | static void pci_4v_dma_sync_single_for_cpu(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int direction) | ||
52 | { | ||
53 | } | ||
54 | |||
55 | static void pci_4v_dma_sync_sg_for_cpu(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction) | ||
56 | { | ||
57 | } | ||
58 | |||
59 | struct pci_iommu_ops pci_sun4v_iommu_ops = { | ||
60 | .alloc_consistent = pci_4v_alloc_consistent, | ||
61 | .free_consistent = pci_4v_free_consistent, | ||
62 | .map_single = pci_4v_map_single, | ||
63 | .unmap_single = pci_4v_unmap_single, | ||
64 | .map_sg = pci_4v_map_sg, | ||
65 | .unmap_sg = pci_4v_unmap_sg, | ||
66 | .dma_sync_single_for_cpu = pci_4v_dma_sync_single_for_cpu, | ||
67 | .dma_sync_sg_for_cpu = pci_4v_dma_sync_sg_for_cpu, | ||
68 | }; | ||
69 | |||
70 | void sun4v_pci_init(int node, char *model_name) | ||
71 | { | ||
72 | prom_printf("sun4v_pci_init: Implement me.\n"); | ||
73 | prom_halt(); | ||
74 | } | ||