diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-powerpc/cell-regs.h | 315 | ||||
-rw-r--r-- | include/asm-powerpc/cputable.h | 1 | ||||
-rw-r--r-- | include/asm-powerpc/iseries/hv_call_event.h | 10 | ||||
-rw-r--r-- | include/asm-powerpc/iseries/iommu.h | 4 | ||||
-rw-r--r-- | include/asm-powerpc/iseries/vio.h | 116 | ||||
-rw-r--r-- | include/asm-powerpc/machdep.h | 2 | ||||
-rw-r--r-- | include/asm-powerpc/vio.h | 5 |
7 files changed, 443 insertions, 10 deletions
diff --git a/include/asm-powerpc/cell-regs.h b/include/asm-powerpc/cell-regs.h new file mode 100644 index 000000000000..fd6fd00434ef --- /dev/null +++ b/include/asm-powerpc/cell-regs.h | |||
@@ -0,0 +1,315 @@ | |||
1 | /* | ||
2 | * cbe_regs.h | ||
3 | * | ||
4 | * This file is intended to hold the various register definitions for CBE | ||
5 | * on-chip system devices (memory controller, IO controller, etc...) | ||
6 | * | ||
7 | * (C) Copyright IBM Corporation 2001,2006 | ||
8 | * | ||
9 | * Authors: Maximino Aguilar (maguilar@us.ibm.com) | ||
10 | * David J. Erb (djerb@us.ibm.com) | ||
11 | * | ||
12 | * (c) 2006 Benjamin Herrenschmidt <benh@kernel.crashing.org>, IBM Corp. | ||
13 | */ | ||
14 | |||
15 | #ifndef CBE_REGS_H | ||
16 | #define CBE_REGS_H | ||
17 | |||
18 | #include <asm/cell-pmu.h> | ||
19 | |||
20 | /* | ||
21 | * | ||
22 | * Some HID register definitions | ||
23 | * | ||
24 | */ | ||
25 | |||
26 | /* CBE specific HID0 bits */ | ||
27 | #define HID0_CBE_THERM_WAKEUP 0x0000020000000000ul | ||
28 | #define HID0_CBE_SYSERR_WAKEUP 0x0000008000000000ul | ||
29 | #define HID0_CBE_THERM_INT_EN 0x0000000400000000ul | ||
30 | #define HID0_CBE_SYSERR_INT_EN 0x0000000200000000ul | ||
31 | |||
32 | #define MAX_CBE 2 | ||
33 | |||
34 | /* | ||
35 | * | ||
36 | * Pervasive unit register definitions | ||
37 | * | ||
38 | */ | ||
39 | |||
40 | union spe_reg { | ||
41 | u64 val; | ||
42 | u8 spe[8]; | ||
43 | }; | ||
44 | |||
45 | union ppe_spe_reg { | ||
46 | u64 val; | ||
47 | struct { | ||
48 | u32 ppe; | ||
49 | u32 spe; | ||
50 | }; | ||
51 | }; | ||
52 | |||
53 | |||
54 | struct cbe_pmd_regs { | ||
55 | /* Debug Bus Control */ | ||
56 | u64 pad_0x0000; /* 0x0000 */ | ||
57 | |||
58 | u64 group_control; /* 0x0008 */ | ||
59 | |||
60 | u8 pad_0x0010_0x00a8 [0x00a8 - 0x0010]; /* 0x0010 */ | ||
61 | |||
62 | u64 debug_bus_control; /* 0x00a8 */ | ||
63 | |||
64 | u8 pad_0x00b0_0x0100 [0x0100 - 0x00b0]; /* 0x00b0 */ | ||
65 | |||
66 | u64 trace_aux_data; /* 0x0100 */ | ||
67 | u64 trace_buffer_0_63; /* 0x0108 */ | ||
68 | u64 trace_buffer_64_127; /* 0x0110 */ | ||
69 | u64 trace_address; /* 0x0118 */ | ||
70 | u64 ext_tr_timer; /* 0x0120 */ | ||
71 | |||
72 | u8 pad_0x0128_0x0400 [0x0400 - 0x0128]; /* 0x0128 */ | ||
73 | |||
74 | /* Performance Monitor */ | ||
75 | u64 pm_status; /* 0x0400 */ | ||
76 | u64 pm_control; /* 0x0408 */ | ||
77 | u64 pm_interval; /* 0x0410 */ | ||
78 | u64 pm_ctr[4]; /* 0x0418 */ | ||
79 | u64 pm_start_stop; /* 0x0438 */ | ||
80 | u64 pm07_control[8]; /* 0x0440 */ | ||
81 | |||
82 | u8 pad_0x0480_0x0800 [0x0800 - 0x0480]; /* 0x0480 */ | ||
83 | |||
84 | /* Thermal Sensor Registers */ | ||
85 | union spe_reg ts_ctsr1; /* 0x0800 */ | ||
86 | u64 ts_ctsr2; /* 0x0808 */ | ||
87 | union spe_reg ts_mtsr1; /* 0x0810 */ | ||
88 | u64 ts_mtsr2; /* 0x0818 */ | ||
89 | union spe_reg ts_itr1; /* 0x0820 */ | ||
90 | u64 ts_itr2; /* 0x0828 */ | ||
91 | u64 ts_gitr; /* 0x0830 */ | ||
92 | u64 ts_isr; /* 0x0838 */ | ||
93 | u64 ts_imr; /* 0x0840 */ | ||
94 | union spe_reg tm_cr1; /* 0x0848 */ | ||
95 | u64 tm_cr2; /* 0x0850 */ | ||
96 | u64 tm_simr; /* 0x0858 */ | ||
97 | union ppe_spe_reg tm_tpr; /* 0x0860 */ | ||
98 | union spe_reg tm_str1; /* 0x0868 */ | ||
99 | u64 tm_str2; /* 0x0870 */ | ||
100 | union ppe_spe_reg tm_tsr; /* 0x0878 */ | ||
101 | |||
102 | /* Power Management */ | ||
103 | u64 pmcr; /* 0x0880 */ | ||
104 | #define CBE_PMD_PAUSE_ZERO_CONTROL 0x10000 | ||
105 | u64 pmsr; /* 0x0888 */ | ||
106 | |||
107 | /* Time Base Register */ | ||
108 | u64 tbr; /* 0x0890 */ | ||
109 | |||
110 | u8 pad_0x0898_0x0c00 [0x0c00 - 0x0898]; /* 0x0898 */ | ||
111 | |||
112 | /* Fault Isolation Registers */ | ||
113 | u64 checkstop_fir; /* 0x0c00 */ | ||
114 | u64 recoverable_fir; /* 0x0c08 */ | ||
115 | u64 spec_att_mchk_fir; /* 0x0c10 */ | ||
116 | u32 fir_mode_reg; /* 0x0c18 */ | ||
117 | u8 pad_0x0c1c_0x0c20 [4]; /* 0x0c1c */ | ||
118 | #define CBE_PMD_FIR_MODE_M8 0x00800 | ||
119 | u64 fir_enable_mask; /* 0x0c20 */ | ||
120 | |||
121 | u8 pad_0x0c28_0x0ca8 [0x0ca8 - 0x0c28]; /* 0x0c28 */ | ||
122 | u64 ras_esc_0; /* 0x0ca8 */ | ||
123 | u8 pad_0x0cb0_0x1000 [0x1000 - 0x0cb0]; /* 0x0cb0 */ | ||
124 | }; | ||
125 | |||
126 | extern struct cbe_pmd_regs __iomem *cbe_get_pmd_regs(struct device_node *np); | ||
127 | extern struct cbe_pmd_regs __iomem *cbe_get_cpu_pmd_regs(int cpu); | ||
128 | |||
129 | /* | ||
130 | * PMU shadow registers | ||
131 | * | ||
132 | * Many of the registers in the performance monitoring unit are write-only, | ||
133 | * so we need to save a copy of what we write to those registers. | ||
134 | * | ||
135 | * The actual data counters are read/write. However, writing to the counters | ||
136 | * only takes effect if the PMU is enabled. Otherwise the value is stored in | ||
137 | * a hardware latch until the next time the PMU is enabled. So we save a copy | ||
138 | * of the counter values if we need to read them back while the PMU is | ||
139 | * disabled. The counter_value_in_latch field is a bitmap indicating which | ||
140 | * counters currently have a value waiting to be written. | ||
141 | */ | ||
142 | |||
143 | struct cbe_pmd_shadow_regs { | ||
144 | u32 group_control; | ||
145 | u32 debug_bus_control; | ||
146 | u32 trace_address; | ||
147 | u32 ext_tr_timer; | ||
148 | u32 pm_status; | ||
149 | u32 pm_control; | ||
150 | u32 pm_interval; | ||
151 | u32 pm_start_stop; | ||
152 | u32 pm07_control[NR_CTRS]; | ||
153 | |||
154 | u32 pm_ctr[NR_PHYS_CTRS]; | ||
155 | u32 counter_value_in_latch; | ||
156 | }; | ||
157 | |||
158 | extern struct cbe_pmd_shadow_regs *cbe_get_pmd_shadow_regs(struct device_node *np); | ||
159 | extern struct cbe_pmd_shadow_regs *cbe_get_cpu_pmd_shadow_regs(int cpu); | ||
160 | |||
161 | /* | ||
162 | * | ||
163 | * IIC unit register definitions | ||
164 | * | ||
165 | */ | ||
166 | |||
167 | struct cbe_iic_pending_bits { | ||
168 | u32 data; | ||
169 | u8 flags; | ||
170 | u8 class; | ||
171 | u8 source; | ||
172 | u8 prio; | ||
173 | }; | ||
174 | |||
175 | #define CBE_IIC_IRQ_VALID 0x80 | ||
176 | #define CBE_IIC_IRQ_IPI 0x40 | ||
177 | |||
178 | struct cbe_iic_thread_regs { | ||
179 | struct cbe_iic_pending_bits pending; | ||
180 | struct cbe_iic_pending_bits pending_destr; | ||
181 | u64 generate; | ||
182 | u64 prio; | ||
183 | }; | ||
184 | |||
185 | struct cbe_iic_regs { | ||
186 | u8 pad_0x0000_0x0400[0x0400 - 0x0000]; /* 0x0000 */ | ||
187 | |||
188 | /* IIC interrupt registers */ | ||
189 | struct cbe_iic_thread_regs thread[2]; /* 0x0400 */ | ||
190 | |||
191 | u64 iic_ir; /* 0x0440 */ | ||
192 | #define CBE_IIC_IR_PRIO(x) (((x) & 0xf) << 12) | ||
193 | #define CBE_IIC_IR_DEST_NODE(x) (((x) & 0xf) << 4) | ||
194 | #define CBE_IIC_IR_DEST_UNIT(x) ((x) & 0xf) | ||
195 | #define CBE_IIC_IR_IOC_0 0x0 | ||
196 | #define CBE_IIC_IR_IOC_1S 0xb | ||
197 | #define CBE_IIC_IR_PT_0 0xe | ||
198 | #define CBE_IIC_IR_PT_1 0xf | ||
199 | |||
200 | u64 iic_is; /* 0x0448 */ | ||
201 | #define CBE_IIC_IS_PMI 0x2 | ||
202 | |||
203 | u8 pad_0x0450_0x0500[0x0500 - 0x0450]; /* 0x0450 */ | ||
204 | |||
205 | /* IOC FIR */ | ||
206 | u64 ioc_fir_reset; /* 0x0500 */ | ||
207 | u64 ioc_fir_set; /* 0x0508 */ | ||
208 | u64 ioc_checkstop_enable; /* 0x0510 */ | ||
209 | u64 ioc_fir_error_mask; /* 0x0518 */ | ||
210 | u64 ioc_syserr_enable; /* 0x0520 */ | ||
211 | u64 ioc_fir; /* 0x0528 */ | ||
212 | |||
213 | u8 pad_0x0530_0x1000[0x1000 - 0x0530]; /* 0x0530 */ | ||
214 | }; | ||
215 | |||
216 | extern struct cbe_iic_regs __iomem *cbe_get_iic_regs(struct device_node *np); | ||
217 | extern struct cbe_iic_regs __iomem *cbe_get_cpu_iic_regs(int cpu); | ||
218 | |||
219 | |||
220 | struct cbe_mic_tm_regs { | ||
221 | u8 pad_0x0000_0x0040[0x0040 - 0x0000]; /* 0x0000 */ | ||
222 | |||
223 | u64 mic_ctl_cnfg2; /* 0x0040 */ | ||
224 | #define CBE_MIC_ENABLE_AUX_TRC 0x8000000000000000LL | ||
225 | #define CBE_MIC_DISABLE_PWR_SAV_2 0x0200000000000000LL | ||
226 | #define CBE_MIC_DISABLE_AUX_TRC_WRAP 0x0100000000000000LL | ||
227 | #define CBE_MIC_ENABLE_AUX_TRC_INT 0x0080000000000000LL | ||
228 | |||
229 | u64 pad_0x0048; /* 0x0048 */ | ||
230 | |||
231 | u64 mic_aux_trc_base; /* 0x0050 */ | ||
232 | u64 mic_aux_trc_max_addr; /* 0x0058 */ | ||
233 | u64 mic_aux_trc_cur_addr; /* 0x0060 */ | ||
234 | u64 mic_aux_trc_grf_addr; /* 0x0068 */ | ||
235 | u64 mic_aux_trc_grf_data; /* 0x0070 */ | ||
236 | |||
237 | u64 pad_0x0078; /* 0x0078 */ | ||
238 | |||
239 | u64 mic_ctl_cnfg_0; /* 0x0080 */ | ||
240 | #define CBE_MIC_DISABLE_PWR_SAV_0 0x8000000000000000LL | ||
241 | |||
242 | u64 pad_0x0088; /* 0x0088 */ | ||
243 | |||
244 | u64 slow_fast_timer_0; /* 0x0090 */ | ||
245 | u64 slow_next_timer_0; /* 0x0098 */ | ||
246 | |||
247 | u8 pad_0x00a0_0x00f8[0x00f8 - 0x00a0]; /* 0x00a0 */ | ||
248 | u64 mic_df_ecc_address_0; /* 0x00f8 */ | ||
249 | |||
250 | u8 pad_0x0100_0x01b8[0x01b8 - 0x0100]; /* 0x0100 */ | ||
251 | u64 mic_df_ecc_address_1; /* 0x01b8 */ | ||
252 | |||
253 | u64 mic_ctl_cnfg_1; /* 0x01c0 */ | ||
254 | #define CBE_MIC_DISABLE_PWR_SAV_1 0x8000000000000000LL | ||
255 | |||
256 | u64 pad_0x01c8; /* 0x01c8 */ | ||
257 | |||
258 | u64 slow_fast_timer_1; /* 0x01d0 */ | ||
259 | u64 slow_next_timer_1; /* 0x01d8 */ | ||
260 | |||
261 | u8 pad_0x01e0_0x0208[0x0208 - 0x01e0]; /* 0x01e0 */ | ||
262 | u64 mic_exc; /* 0x0208 */ | ||
263 | #define CBE_MIC_EXC_BLOCK_SCRUB 0x0800000000000000ULL | ||
264 | #define CBE_MIC_EXC_FAST_SCRUB 0x0100000000000000ULL | ||
265 | |||
266 | u64 mic_mnt_cfg; /* 0x0210 */ | ||
267 | #define CBE_MIC_MNT_CFG_CHAN_0_POP 0x0002000000000000ULL | ||
268 | #define CBE_MIC_MNT_CFG_CHAN_1_POP 0x0004000000000000ULL | ||
269 | |||
270 | u64 mic_df_config; /* 0x0218 */ | ||
271 | #define CBE_MIC_ECC_DISABLE_0 0x4000000000000000ULL | ||
272 | #define CBE_MIC_ECC_REP_SINGLE_0 0x2000000000000000ULL | ||
273 | #define CBE_MIC_ECC_DISABLE_1 0x0080000000000000ULL | ||
274 | #define CBE_MIC_ECC_REP_SINGLE_1 0x0040000000000000ULL | ||
275 | |||
276 | u8 pad_0x0220_0x0230[0x0230 - 0x0220]; /* 0x0220 */ | ||
277 | u64 mic_fir; /* 0x0230 */ | ||
278 | #define CBE_MIC_FIR_ECC_SINGLE_0_ERR 0x0200000000000000ULL | ||
279 | #define CBE_MIC_FIR_ECC_MULTI_0_ERR 0x0100000000000000ULL | ||
280 | #define CBE_MIC_FIR_ECC_SINGLE_1_ERR 0x0080000000000000ULL | ||
281 | #define CBE_MIC_FIR_ECC_MULTI_1_ERR 0x0040000000000000ULL | ||
282 | #define CBE_MIC_FIR_ECC_ERR_MASK 0xffff000000000000ULL | ||
283 | #define CBE_MIC_FIR_ECC_SINGLE_0_CTE 0x0000020000000000ULL | ||
284 | #define CBE_MIC_FIR_ECC_MULTI_0_CTE 0x0000010000000000ULL | ||
285 | #define CBE_MIC_FIR_ECC_SINGLE_1_CTE 0x0000008000000000ULL | ||
286 | #define CBE_MIC_FIR_ECC_MULTI_1_CTE 0x0000004000000000ULL | ||
287 | #define CBE_MIC_FIR_ECC_CTE_MASK 0x0000ffff00000000ULL | ||
288 | #define CBE_MIC_FIR_ECC_SINGLE_0_RESET 0x0000000002000000ULL | ||
289 | #define CBE_MIC_FIR_ECC_MULTI_0_RESET 0x0000000001000000ULL | ||
290 | #define CBE_MIC_FIR_ECC_SINGLE_1_RESET 0x0000000000800000ULL | ||
291 | #define CBE_MIC_FIR_ECC_MULTI_1_RESET 0x0000000000400000ULL | ||
292 | #define CBE_MIC_FIR_ECC_RESET_MASK 0x00000000ffff0000ULL | ||
293 | #define CBE_MIC_FIR_ECC_SINGLE_0_SET 0x0000000000000200ULL | ||
294 | #define CBE_MIC_FIR_ECC_MULTI_0_SET 0x0000000000000100ULL | ||
295 | #define CBE_MIC_FIR_ECC_SINGLE_1_SET 0x0000000000000080ULL | ||
296 | #define CBE_MIC_FIR_ECC_MULTI_1_SET 0x0000000000000040ULL | ||
297 | #define CBE_MIC_FIR_ECC_SET_MASK 0x000000000000ffffULL | ||
298 | u64 mic_fir_debug; /* 0x0238 */ | ||
299 | |||
300 | u8 pad_0x0240_0x1000[0x1000 - 0x0240]; /* 0x0240 */ | ||
301 | }; | ||
302 | |||
303 | extern struct cbe_mic_tm_regs __iomem *cbe_get_mic_tm_regs(struct device_node *np); | ||
304 | extern struct cbe_mic_tm_regs __iomem *cbe_get_cpu_mic_tm_regs(int cpu); | ||
305 | |||
306 | /* some utility functions to deal with SMT */ | ||
307 | extern u32 cbe_get_hw_thread_id(int cpu); | ||
308 | extern u32 cbe_cpu_to_node(int cpu); | ||
309 | extern u32 cbe_node_to_cpu(int node); | ||
310 | |||
311 | /* Init this module early */ | ||
312 | extern void cbe_regs_init(void); | ||
313 | |||
314 | |||
315 | #endif /* CBE_REGS_H */ | ||
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h index c9b8f64bbb45..d913f460e710 100644 --- a/include/asm-powerpc/cputable.h +++ b/include/asm-powerpc/cputable.h | |||
@@ -57,6 +57,7 @@ enum powerpc_pmc_type { | |||
57 | PPC_PMC_PA6T = 2, | 57 | PPC_PMC_PA6T = 2, |
58 | }; | 58 | }; |
59 | 59 | ||
60 | /* NOTE WELL: Update identify_cpu() if fields are added or removed! */ | ||
60 | struct cpu_spec { | 61 | struct cpu_spec { |
61 | /* CPU is matched via (PVR & pvr_mask) == pvr_value */ | 62 | /* CPU is matched via (PVR & pvr_mask) == pvr_value */ |
62 | unsigned int pvr_mask; | 63 | unsigned int pvr_mask; |
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 | ||
119 | extern void *iseries_hv_alloc(size_t size, dma_addr_t *dma_handle, gfp_t flag); | ||
120 | extern void iseries_hv_free(size_t size, void *vaddr, dma_addr_t dma_handle); | ||
121 | extern dma_addr_t iseries_hv_map(void *vaddr, size_t size, | ||
122 | enum dma_data_direction direction); | ||
123 | extern void iseries_hv_unmap(dma_addr_t dma_handle, size_t size, | ||
124 | enum dma_data_direction direction); | ||
125 | |||
116 | static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event) | 126 | static 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 | ||
24 | struct pci_dev; | 24 | struct pci_dev; |
25 | struct vio_dev; | ||
25 | struct device_node; | 26 | struct device_node; |
26 | struct iommu_table; | 27 | struct 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 | ||
38 | extern struct iommu_table *vio_build_iommu_table_iseries(struct vio_dev *dev); | ||
39 | extern 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/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 | |||
56 | struct 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 | |||
65 | struct rw_data { | ||
66 | u64 offset; | ||
67 | struct { | ||
68 | u32 token; | ||
69 | u32 reserved; | ||
70 | u64 len; | ||
71 | } dma_info[VIOMAXBLOCKDMA]; | ||
72 | }; | ||
73 | |||
74 | struct 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 | |||
90 | enum vioblocksubtype { | ||
91 | vioblockopen = 0x0001, | ||
92 | vioblockclose = 0x0002, | ||
93 | vioblockread = 0x0003, | ||
94 | vioblockwrite = 0x0004, | ||
95 | vioblockflush = 0x0005, | ||
96 | vioblockcheck = 0x0007 | ||
97 | }; | ||
98 | |||
99 | struct 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 | |||
113 | enum viocdsubtype { | ||
114 | viocdopen = 0x0001, | ||
115 | viocdclose = 0x0002, | ||
116 | viocdread = 0x0003, | ||
117 | viocdwrite = 0x0004, | ||
118 | viocdlockdoor = 0x0005, | ||
119 | viocdgetinfo = 0x0006, | ||
120 | viocdcheck = 0x0007 | ||
121 | }; | ||
122 | |||
123 | struct 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 | |||
152 | enum 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); | |||
68 | extern void *vio_get_event_buffer(int subtype); | 178 | extern void *vio_get_event_buffer(int subtype); |
69 | extern void vio_free_event_buffer(int subtype, void *buffer); | 179 | extern void vio_free_event_buffer(int subtype, void *buffer); |
70 | 180 | ||
181 | extern struct vio_dev *vio_create_viodasd(u32 unit); | ||
182 | |||
71 | extern HvLpIndex viopath_hostLp; | 183 | extern HvLpIndex viopath_hostLp; |
72 | extern HvLpIndex viopath_ourLp; | 184 | extern 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 | ||
153 | struct device; | ||
154 | |||
155 | extern struct device *iSeries_vio_dev; | ||
156 | |||
157 | #endif /* _ASM_POWERPC_ISERIES_VIO_H */ | 265 | #endif /* _ASM_POWERPC_ISERIES_VIO_H */ |
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h index 71c6e7eb2a26..cc7c17f16a9a 100644 --- a/include/asm-powerpc/machdep.h +++ b/include/asm-powerpc/machdep.h | |||
@@ -99,7 +99,7 @@ struct machdep_calls { | |||
99 | #endif /* CONFIG_PPC64 */ | 99 | #endif /* CONFIG_PPC64 */ |
100 | 100 | ||
101 | int (*probe)(void); | 101 | int (*probe)(void); |
102 | void (*setup_arch)(void); | 102 | void (*setup_arch)(void); /* Optional, may be NULL */ |
103 | void (*init_early)(void); | 103 | void (*init_early)(void); |
104 | /* Optional, may be NULL. */ | 104 | /* Optional, may be NULL. */ |
105 | void (*show_cpuinfo)(struct seq_file *m); | 105 | void (*show_cpuinfo)(struct seq_file *m); |
diff --git a/include/asm-powerpc/vio.h b/include/asm-powerpc/vio.h index 598d111e8098..9204c15839c5 100644 --- a/include/asm-powerpc/vio.h +++ b/include/asm-powerpc/vio.h | |||
@@ -53,17 +53,12 @@ struct vio_dev { | |||
53 | }; | 53 | }; |
54 | 54 | ||
55 | struct vio_driver { | 55 | struct vio_driver { |
56 | struct list_head node; | ||
57 | const struct vio_device_id *id_table; | 56 | const struct vio_device_id *id_table; |
58 | int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); | 57 | int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); |
59 | int (*remove)(struct vio_dev *dev); | 58 | int (*remove)(struct vio_dev *dev); |
60 | void (*shutdown)(struct vio_dev *dev); | ||
61 | unsigned long driver_data; | ||
62 | struct device_driver driver; | 59 | struct device_driver driver; |
63 | }; | 60 | }; |
64 | 61 | ||
65 | extern struct dma_mapping_ops vio_dma_ops; | ||
66 | |||
67 | extern int vio_register_driver(struct vio_driver *drv); | 62 | extern int vio_register_driver(struct vio_driver *drv); |
68 | extern void vio_unregister_driver(struct vio_driver *drv); | 63 | extern void vio_unregister_driver(struct vio_driver *drv); |
69 | 64 | ||