aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/iseries
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-powerpc/iseries')
-rw-r--r--include/asm-powerpc/iseries/hv_call_event.h10
-rw-r--r--include/asm-powerpc/iseries/iommu.h4
-rw-r--r--include/asm-powerpc/iseries/lpar_map.h3
-rw-r--r--include/asm-powerpc/iseries/vio.h116
4 files changed, 129 insertions, 4 deletions
diff --git a/include/asm-powerpc/iseries/hv_call_event.h b/include/asm-powerpc/iseries/hv_call_event.h
index 4cec4762076d..cc029d388e11 100644
--- a/include/asm-powerpc/iseries/hv_call_event.h
+++ b/include/asm-powerpc/iseries/hv_call_event.h
@@ -21,6 +21,9 @@
21#ifndef _ASM_POWERPC_ISERIES_HV_CALL_EVENT_H 21#ifndef _ASM_POWERPC_ISERIES_HV_CALL_EVENT_H
22#define _ASM_POWERPC_ISERIES_HV_CALL_EVENT_H 22#define _ASM_POWERPC_ISERIES_HV_CALL_EVENT_H
23 23
24#include <linux/types.h>
25#include <linux/dma-mapping.h>
26
24#include <asm/iseries/hv_call_sc.h> 27#include <asm/iseries/hv_call_sc.h>
25#include <asm/iseries/hv_types.h> 28#include <asm/iseries/hv_types.h>
26#include <asm/abs_addr.h> 29#include <asm/abs_addr.h>
@@ -113,6 +116,13 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp,
113 eventData3, eventData4, eventData5); 116 eventData3, eventData4, eventData5);
114} 117}
115 118
119extern void *iseries_hv_alloc(size_t size, dma_addr_t *dma_handle, gfp_t flag);
120extern void iseries_hv_free(size_t size, void *vaddr, dma_addr_t dma_handle);
121extern dma_addr_t iseries_hv_map(void *vaddr, size_t size,
122 enum dma_data_direction direction);
123extern void iseries_hv_unmap(dma_addr_t dma_handle, size_t size,
124 enum dma_data_direction direction);
125
116static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event) 126static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event)
117{ 127{
118 return HvCall1(HvCallEventAckLpEvent, virt_to_abs(event)); 128 return HvCall1(HvCallEventAckLpEvent, virt_to_abs(event));
diff --git a/include/asm-powerpc/iseries/iommu.h b/include/asm-powerpc/iseries/iommu.h
index 6e323a13ac30..c59ee7e4bed1 100644
--- a/include/asm-powerpc/iseries/iommu.h
+++ b/include/asm-powerpc/iseries/iommu.h
@@ -22,6 +22,7 @@
22 */ 22 */
23 23
24struct pci_dev; 24struct pci_dev;
25struct vio_dev;
25struct device_node; 26struct device_node;
26struct iommu_table; 27struct iommu_table;
27 28
@@ -34,4 +35,7 @@ extern void iommu_table_getparms_iSeries(unsigned long busno,
34 unsigned char slotno, unsigned char virtbus, 35 unsigned char slotno, unsigned char virtbus,
35 struct iommu_table *tbl); 36 struct iommu_table *tbl);
36 37
38extern struct iommu_table *vio_build_iommu_table_iseries(struct vio_dev *dev);
39extern void iommu_vio_init(void);
40
37#endif /* _ASM_POWERPC_ISERIES_IOMMU_H */ 41#endif /* _ASM_POWERPC_ISERIES_IOMMU_H */
diff --git a/include/asm-powerpc/iseries/lpar_map.h b/include/asm-powerpc/iseries/lpar_map.h
index 2ec384d66abb..5e9f3e128ee2 100644
--- a/include/asm-powerpc/iseries/lpar_map.h
+++ b/include/asm-powerpc/iseries/lpar_map.h
@@ -22,6 +22,8 @@
22 22
23#include <asm/types.h> 23#include <asm/types.h>
24 24
25#endif
26
25/* 27/*
26 * The iSeries hypervisor will set up mapping for one or more 28 * The iSeries hypervisor will set up mapping for one or more
27 * ESID/VSID pairs (in SLB/segment registers) and will set up 29 * ESID/VSID pairs (in SLB/segment registers) and will set up
@@ -56,6 +58,7 @@
56/* Hypervisor initially maps 32MB of the load area */ 58/* Hypervisor initially maps 32MB of the load area */
57#define HvPagesToMap 8192 59#define HvPagesToMap 8192
58 60
61#ifndef __ASSEMBLY__
59struct LparMap { 62struct LparMap {
60 u64 xNumberEsids; // Number of ESID/VSID pairs 63 u64 xNumberEsids; // Number of ESID/VSID pairs
61 u64 xNumberRanges; // Number of VA ranges to map 64 u64 xNumberRanges; // Number of VA ranges to map
diff --git a/include/asm-powerpc/iseries/vio.h b/include/asm-powerpc/iseries/vio.h
index 7a95d296abd1..f9ac0d00b951 100644
--- a/include/asm-powerpc/iseries/vio.h
+++ b/include/asm-powerpc/iseries/vio.h
@@ -51,6 +51,116 @@
51 */ 51 */
52#define VIO_MAX_SUBTYPES 8 52#define VIO_MAX_SUBTYPES 8
53 53
54#define VIOMAXBLOCKDMA 12
55
56struct open_data {
57 u64 disk_size;
58 u16 max_disk;
59 u16 cylinders;
60 u16 tracks;
61 u16 sectors;
62 u16 bytes_per_sector;
63};
64
65struct rw_data {
66 u64 offset;
67 struct {
68 u32 token;
69 u32 reserved;
70 u64 len;
71 } dma_info[VIOMAXBLOCKDMA];
72};
73
74struct vioblocklpevent {
75 struct HvLpEvent event;
76 u32 reserved;
77 u16 version;
78 u16 sub_result;
79 u16 disk;
80 u16 flags;
81 union {
82 struct open_data open_data;
83 struct rw_data rw_data;
84 u64 changed;
85 } u;
86};
87
88#define vioblockflags_ro 0x0001
89
90enum vioblocksubtype {
91 vioblockopen = 0x0001,
92 vioblockclose = 0x0002,
93 vioblockread = 0x0003,
94 vioblockwrite = 0x0004,
95 vioblockflush = 0x0005,
96 vioblockcheck = 0x0007
97};
98
99struct viocdlpevent {
100 struct HvLpEvent event;
101 u32 reserved;
102 u16 version;
103 u16 sub_result;
104 u16 disk;
105 u16 flags;
106 u32 token;
107 u64 offset; /* On open, max number of disks */
108 u64 len; /* On open, size of the disk */
109 u32 block_size; /* Only set on open */
110 u32 media_size; /* Only set on open */
111};
112
113enum viocdsubtype {
114 viocdopen = 0x0001,
115 viocdclose = 0x0002,
116 viocdread = 0x0003,
117 viocdwrite = 0x0004,
118 viocdlockdoor = 0x0005,
119 viocdgetinfo = 0x0006,
120 viocdcheck = 0x0007
121};
122
123struct viotapelpevent {
124 struct HvLpEvent event;
125 u32 reserved;
126 u16 version;
127 u16 sub_type_result;
128 u16 tape;
129 u16 flags;
130 u32 token;
131 u64 len;
132 union {
133 struct {
134 u32 tape_op;
135 u32 count;
136 } op;
137 struct {
138 u32 type;
139 u32 resid;
140 u32 dsreg;
141 u32 gstat;
142 u32 erreg;
143 u32 file_no;
144 u32 block_no;
145 } get_status;
146 struct {
147 u32 block_no;
148 } get_pos;
149 } u;
150};
151
152enum viotapesubtype {
153 viotapeopen = 0x0001,
154 viotapeclose = 0x0002,
155 viotaperead = 0x0003,
156 viotapewrite = 0x0004,
157 viotapegetinfo = 0x0005,
158 viotapeop = 0x0006,
159 viotapegetpos = 0x0007,
160 viotapesetpos = 0x0008,
161 viotapegetstatus = 0x0009
162};
163
54/* 164/*
55 * Each subtype can register a handler to process their events. 165 * Each subtype can register a handler to process their events.
56 * The handler must have this interface. 166 * The handler must have this interface.
@@ -68,6 +178,8 @@ extern void vio_set_hostlp(void);
68extern void *vio_get_event_buffer(int subtype); 178extern void *vio_get_event_buffer(int subtype);
69extern void vio_free_event_buffer(int subtype, void *buffer); 179extern void vio_free_event_buffer(int subtype, void *buffer);
70 180
181extern struct vio_dev *vio_create_viodasd(u32 unit);
182
71extern HvLpIndex viopath_hostLp; 183extern HvLpIndex viopath_hostLp;
72extern HvLpIndex viopath_ourLp; 184extern HvLpIndex viopath_ourLp;
73 185
@@ -150,8 +262,4 @@ enum viochar_rc {
150 viochar_rc_ebusy = 1 262 viochar_rc_ebusy = 1
151}; 263};
152 264
153struct device;
154
155extern struct device *iSeries_vio_dev;
156
157#endif /* _ASM_POWERPC_ISERIES_VIO_H */ 265#endif /* _ASM_POWERPC_ISERIES_VIO_H */