diff options
Diffstat (limited to 'arch/tile/gxio/iorpc_mpipe.c')
-rw-r--r-- | arch/tile/gxio/iorpc_mpipe.c | 90 |
1 files changed, 44 insertions, 46 deletions
diff --git a/arch/tile/gxio/iorpc_mpipe.c b/arch/tile/gxio/iorpc_mpipe.c index 4f8f3d619c4a..e19325c4c431 100644 --- a/arch/tile/gxio/iorpc_mpipe.c +++ b/arch/tile/gxio/iorpc_mpipe.c | |||
@@ -21,7 +21,7 @@ struct alloc_buffer_stacks_param { | |||
21 | unsigned int flags; | 21 | unsigned int flags; |
22 | }; | 22 | }; |
23 | 23 | ||
24 | int gxio_mpipe_alloc_buffer_stacks(gxio_mpipe_context_t * context, | 24 | int gxio_mpipe_alloc_buffer_stacks(gxio_mpipe_context_t *context, |
25 | unsigned int count, unsigned int first, | 25 | unsigned int count, unsigned int first, |
26 | unsigned int flags) | 26 | unsigned int flags) |
27 | { | 27 | { |
@@ -45,7 +45,7 @@ struct init_buffer_stack_aux_param { | |||
45 | unsigned int buffer_size_enum; | 45 | unsigned int buffer_size_enum; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | int gxio_mpipe_init_buffer_stack_aux(gxio_mpipe_context_t * context, | 48 | int gxio_mpipe_init_buffer_stack_aux(gxio_mpipe_context_t *context, |
49 | void *mem_va, size_t mem_size, | 49 | void *mem_va, size_t mem_size, |
50 | unsigned int mem_flags, unsigned int stack, | 50 | unsigned int mem_flags, unsigned int stack, |
51 | unsigned int buffer_size_enum) | 51 | unsigned int buffer_size_enum) |
@@ -80,7 +80,7 @@ struct alloc_notif_rings_param { | |||
80 | unsigned int flags; | 80 | unsigned int flags; |
81 | }; | 81 | }; |
82 | 82 | ||
83 | int gxio_mpipe_alloc_notif_rings(gxio_mpipe_context_t * context, | 83 | int gxio_mpipe_alloc_notif_rings(gxio_mpipe_context_t *context, |
84 | unsigned int count, unsigned int first, | 84 | unsigned int count, unsigned int first, |
85 | unsigned int flags) | 85 | unsigned int flags) |
86 | { | 86 | { |
@@ -102,7 +102,7 @@ struct init_notif_ring_aux_param { | |||
102 | unsigned int ring; | 102 | unsigned int ring; |
103 | }; | 103 | }; |
104 | 104 | ||
105 | int gxio_mpipe_init_notif_ring_aux(gxio_mpipe_context_t * context, void *mem_va, | 105 | int gxio_mpipe_init_notif_ring_aux(gxio_mpipe_context_t *context, void *mem_va, |
106 | size_t mem_size, unsigned int mem_flags, | 106 | size_t mem_size, unsigned int mem_flags, |
107 | unsigned int ring) | 107 | unsigned int ring) |
108 | { | 108 | { |
@@ -133,7 +133,7 @@ struct request_notif_ring_interrupt_param { | |||
133 | unsigned int ring; | 133 | unsigned int ring; |
134 | }; | 134 | }; |
135 | 135 | ||
136 | int gxio_mpipe_request_notif_ring_interrupt(gxio_mpipe_context_t * context, | 136 | int gxio_mpipe_request_notif_ring_interrupt(gxio_mpipe_context_t *context, |
137 | int inter_x, int inter_y, | 137 | int inter_x, int inter_y, |
138 | int inter_ipi, int inter_event, | 138 | int inter_ipi, int inter_event, |
139 | unsigned int ring) | 139 | unsigned int ring) |
@@ -158,7 +158,7 @@ struct enable_notif_ring_interrupt_param { | |||
158 | unsigned int ring; | 158 | unsigned int ring; |
159 | }; | 159 | }; |
160 | 160 | ||
161 | int gxio_mpipe_enable_notif_ring_interrupt(gxio_mpipe_context_t * context, | 161 | int gxio_mpipe_enable_notif_ring_interrupt(gxio_mpipe_context_t *context, |
162 | unsigned int ring) | 162 | unsigned int ring) |
163 | { | 163 | { |
164 | struct enable_notif_ring_interrupt_param temp; | 164 | struct enable_notif_ring_interrupt_param temp; |
@@ -179,7 +179,7 @@ struct alloc_notif_groups_param { | |||
179 | unsigned int flags; | 179 | unsigned int flags; |
180 | }; | 180 | }; |
181 | 181 | ||
182 | int gxio_mpipe_alloc_notif_groups(gxio_mpipe_context_t * context, | 182 | int gxio_mpipe_alloc_notif_groups(gxio_mpipe_context_t *context, |
183 | unsigned int count, unsigned int first, | 183 | unsigned int count, unsigned int first, |
184 | unsigned int flags) | 184 | unsigned int flags) |
185 | { | 185 | { |
@@ -201,7 +201,7 @@ struct init_notif_group_param { | |||
201 | gxio_mpipe_notif_group_bits_t bits; | 201 | gxio_mpipe_notif_group_bits_t bits; |
202 | }; | 202 | }; |
203 | 203 | ||
204 | int gxio_mpipe_init_notif_group(gxio_mpipe_context_t * context, | 204 | int gxio_mpipe_init_notif_group(gxio_mpipe_context_t *context, |
205 | unsigned int group, | 205 | unsigned int group, |
206 | gxio_mpipe_notif_group_bits_t bits) | 206 | gxio_mpipe_notif_group_bits_t bits) |
207 | { | 207 | { |
@@ -223,7 +223,7 @@ struct alloc_buckets_param { | |||
223 | unsigned int flags; | 223 | unsigned int flags; |
224 | }; | 224 | }; |
225 | 225 | ||
226 | int gxio_mpipe_alloc_buckets(gxio_mpipe_context_t * context, unsigned int count, | 226 | int gxio_mpipe_alloc_buckets(gxio_mpipe_context_t *context, unsigned int count, |
227 | unsigned int first, unsigned int flags) | 227 | unsigned int first, unsigned int flags) |
228 | { | 228 | { |
229 | struct alloc_buckets_param temp; | 229 | struct alloc_buckets_param temp; |
@@ -244,7 +244,7 @@ struct init_bucket_param { | |||
244 | MPIPE_LBL_INIT_DAT_BSTS_TBL_t bucket_info; | 244 | MPIPE_LBL_INIT_DAT_BSTS_TBL_t bucket_info; |
245 | }; | 245 | }; |
246 | 246 | ||
247 | int gxio_mpipe_init_bucket(gxio_mpipe_context_t * context, unsigned int bucket, | 247 | int gxio_mpipe_init_bucket(gxio_mpipe_context_t *context, unsigned int bucket, |
248 | MPIPE_LBL_INIT_DAT_BSTS_TBL_t bucket_info) | 248 | MPIPE_LBL_INIT_DAT_BSTS_TBL_t bucket_info) |
249 | { | 249 | { |
250 | struct init_bucket_param temp; | 250 | struct init_bucket_param temp; |
@@ -265,7 +265,7 @@ struct alloc_edma_rings_param { | |||
265 | unsigned int flags; | 265 | unsigned int flags; |
266 | }; | 266 | }; |
267 | 267 | ||
268 | int gxio_mpipe_alloc_edma_rings(gxio_mpipe_context_t * context, | 268 | int gxio_mpipe_alloc_edma_rings(gxio_mpipe_context_t *context, |
269 | unsigned int count, unsigned int first, | 269 | unsigned int count, unsigned int first, |
270 | unsigned int flags) | 270 | unsigned int flags) |
271 | { | 271 | { |
@@ -288,7 +288,7 @@ struct init_edma_ring_aux_param { | |||
288 | unsigned int channel; | 288 | unsigned int channel; |
289 | }; | 289 | }; |
290 | 290 | ||
291 | int gxio_mpipe_init_edma_ring_aux(gxio_mpipe_context_t * context, void *mem_va, | 291 | int gxio_mpipe_init_edma_ring_aux(gxio_mpipe_context_t *context, void *mem_va, |
292 | size_t mem_size, unsigned int mem_flags, | 292 | size_t mem_size, unsigned int mem_flags, |
293 | unsigned int ring, unsigned int channel) | 293 | unsigned int ring, unsigned int channel) |
294 | { | 294 | { |
@@ -315,7 +315,7 @@ int gxio_mpipe_init_edma_ring_aux(gxio_mpipe_context_t * context, void *mem_va, | |||
315 | EXPORT_SYMBOL(gxio_mpipe_init_edma_ring_aux); | 315 | EXPORT_SYMBOL(gxio_mpipe_init_edma_ring_aux); |
316 | 316 | ||
317 | 317 | ||
318 | int gxio_mpipe_commit_rules(gxio_mpipe_context_t * context, const void *blob, | 318 | int gxio_mpipe_commit_rules(gxio_mpipe_context_t *context, const void *blob, |
319 | size_t blob_size) | 319 | size_t blob_size) |
320 | { | 320 | { |
321 | const void *params = blob; | 321 | const void *params = blob; |
@@ -332,7 +332,7 @@ struct register_client_memory_param { | |||
332 | unsigned int flags; | 332 | unsigned int flags; |
333 | }; | 333 | }; |
334 | 334 | ||
335 | int gxio_mpipe_register_client_memory(gxio_mpipe_context_t * context, | 335 | int gxio_mpipe_register_client_memory(gxio_mpipe_context_t *context, |
336 | unsigned int iotlb, HV_PTE pte, | 336 | unsigned int iotlb, HV_PTE pte, |
337 | unsigned int flags) | 337 | unsigned int flags) |
338 | { | 338 | { |
@@ -355,7 +355,7 @@ struct link_open_aux_param { | |||
355 | unsigned int flags; | 355 | unsigned int flags; |
356 | }; | 356 | }; |
357 | 357 | ||
358 | int gxio_mpipe_link_open_aux(gxio_mpipe_context_t * context, | 358 | int gxio_mpipe_link_open_aux(gxio_mpipe_context_t *context, |
359 | _gxio_mpipe_link_name_t name, unsigned int flags) | 359 | _gxio_mpipe_link_name_t name, unsigned int flags) |
360 | { | 360 | { |
361 | struct link_open_aux_param temp; | 361 | struct link_open_aux_param temp; |
@@ -374,7 +374,7 @@ struct link_close_aux_param { | |||
374 | int mac; | 374 | int mac; |
375 | }; | 375 | }; |
376 | 376 | ||
377 | int gxio_mpipe_link_close_aux(gxio_mpipe_context_t * context, int mac) | 377 | int gxio_mpipe_link_close_aux(gxio_mpipe_context_t *context, int mac) |
378 | { | 378 | { |
379 | struct link_close_aux_param temp; | 379 | struct link_close_aux_param temp; |
380 | struct link_close_aux_param *params = &temp; | 380 | struct link_close_aux_param *params = &temp; |
@@ -393,7 +393,7 @@ struct link_set_attr_aux_param { | |||
393 | int64_t val; | 393 | int64_t val; |
394 | }; | 394 | }; |
395 | 395 | ||
396 | int gxio_mpipe_link_set_attr_aux(gxio_mpipe_context_t * context, int mac, | 396 | int gxio_mpipe_link_set_attr_aux(gxio_mpipe_context_t *context, int mac, |
397 | uint32_t attr, int64_t val) | 397 | uint32_t attr, int64_t val) |
398 | { | 398 | { |
399 | struct link_set_attr_aux_param temp; | 399 | struct link_set_attr_aux_param temp; |
@@ -415,8 +415,8 @@ struct get_timestamp_aux_param { | |||
415 | uint64_t cycles; | 415 | uint64_t cycles; |
416 | }; | 416 | }; |
417 | 417 | ||
418 | int gxio_mpipe_get_timestamp_aux(gxio_mpipe_context_t * context, uint64_t * sec, | 418 | int gxio_mpipe_get_timestamp_aux(gxio_mpipe_context_t *context, uint64_t *sec, |
419 | uint64_t * nsec, uint64_t * cycles) | 419 | uint64_t *nsec, uint64_t *cycles) |
420 | { | 420 | { |
421 | int __result; | 421 | int __result; |
422 | struct get_timestamp_aux_param temp; | 422 | struct get_timestamp_aux_param temp; |
@@ -440,7 +440,7 @@ struct set_timestamp_aux_param { | |||
440 | uint64_t cycles; | 440 | uint64_t cycles; |
441 | }; | 441 | }; |
442 | 442 | ||
443 | int gxio_mpipe_set_timestamp_aux(gxio_mpipe_context_t * context, uint64_t sec, | 443 | int gxio_mpipe_set_timestamp_aux(gxio_mpipe_context_t *context, uint64_t sec, |
444 | uint64_t nsec, uint64_t cycles) | 444 | uint64_t nsec, uint64_t cycles) |
445 | { | 445 | { |
446 | struct set_timestamp_aux_param temp; | 446 | struct set_timestamp_aux_param temp; |
@@ -460,8 +460,7 @@ struct adjust_timestamp_aux_param { | |||
460 | int64_t nsec; | 460 | int64_t nsec; |
461 | }; | 461 | }; |
462 | 462 | ||
463 | int gxio_mpipe_adjust_timestamp_aux(gxio_mpipe_context_t * context, | 463 | int gxio_mpipe_adjust_timestamp_aux(gxio_mpipe_context_t *context, int64_t nsec) |
464 | int64_t nsec) | ||
465 | { | 464 | { |
466 | struct adjust_timestamp_aux_param temp; | 465 | struct adjust_timestamp_aux_param temp; |
467 | struct adjust_timestamp_aux_param *params = &temp; | 466 | struct adjust_timestamp_aux_param *params = &temp; |
@@ -475,25 +474,6 @@ int gxio_mpipe_adjust_timestamp_aux(gxio_mpipe_context_t * context, | |||
475 | 474 | ||
476 | EXPORT_SYMBOL(gxio_mpipe_adjust_timestamp_aux); | 475 | EXPORT_SYMBOL(gxio_mpipe_adjust_timestamp_aux); |
477 | 476 | ||
478 | struct adjust_timestamp_freq_param { | ||
479 | int32_t ppb; | ||
480 | }; | ||
481 | |||
482 | int gxio_mpipe_adjust_timestamp_freq(gxio_mpipe_context_t * context, | ||
483 | int32_t ppb) | ||
484 | { | ||
485 | struct adjust_timestamp_freq_param temp; | ||
486 | struct adjust_timestamp_freq_param *params = &temp; | ||
487 | |||
488 | params->ppb = ppb; | ||
489 | |||
490 | return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params, | ||
491 | sizeof(*params), | ||
492 | GXIO_MPIPE_OP_ADJUST_TIMESTAMP_FREQ); | ||
493 | } | ||
494 | |||
495 | EXPORT_SYMBOL(gxio_mpipe_adjust_timestamp_freq); | ||
496 | |||
497 | struct config_edma_ring_blks_param { | 477 | struct config_edma_ring_blks_param { |
498 | unsigned int ering; | 478 | unsigned int ering; |
499 | unsigned int max_blks; | 479 | unsigned int max_blks; |
@@ -501,7 +481,7 @@ struct config_edma_ring_blks_param { | |||
501 | unsigned int db; | 481 | unsigned int db; |
502 | }; | 482 | }; |
503 | 483 | ||
504 | int gxio_mpipe_config_edma_ring_blks(gxio_mpipe_context_t * context, | 484 | int gxio_mpipe_config_edma_ring_blks(gxio_mpipe_context_t *context, |
505 | unsigned int ering, unsigned int max_blks, | 485 | unsigned int ering, unsigned int max_blks, |
506 | unsigned int min_snf_blks, unsigned int db) | 486 | unsigned int min_snf_blks, unsigned int db) |
507 | { | 487 | { |
@@ -520,11 +500,29 @@ int gxio_mpipe_config_edma_ring_blks(gxio_mpipe_context_t * context, | |||
520 | 500 | ||
521 | EXPORT_SYMBOL(gxio_mpipe_config_edma_ring_blks); | 501 | EXPORT_SYMBOL(gxio_mpipe_config_edma_ring_blks); |
522 | 502 | ||
503 | struct adjust_timestamp_freq_param { | ||
504 | int32_t ppb; | ||
505 | }; | ||
506 | |||
507 | int gxio_mpipe_adjust_timestamp_freq(gxio_mpipe_context_t *context, int32_t ppb) | ||
508 | { | ||
509 | struct adjust_timestamp_freq_param temp; | ||
510 | struct adjust_timestamp_freq_param *params = &temp; | ||
511 | |||
512 | params->ppb = ppb; | ||
513 | |||
514 | return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params, | ||
515 | sizeof(*params), | ||
516 | GXIO_MPIPE_OP_ADJUST_TIMESTAMP_FREQ); | ||
517 | } | ||
518 | |||
519 | EXPORT_SYMBOL(gxio_mpipe_adjust_timestamp_freq); | ||
520 | |||
523 | struct arm_pollfd_param { | 521 | struct arm_pollfd_param { |
524 | union iorpc_pollfd pollfd; | 522 | union iorpc_pollfd pollfd; |
525 | }; | 523 | }; |
526 | 524 | ||
527 | int gxio_mpipe_arm_pollfd(gxio_mpipe_context_t * context, int pollfd_cookie) | 525 | int gxio_mpipe_arm_pollfd(gxio_mpipe_context_t *context, int pollfd_cookie) |
528 | { | 526 | { |
529 | struct arm_pollfd_param temp; | 527 | struct arm_pollfd_param temp; |
530 | struct arm_pollfd_param *params = &temp; | 528 | struct arm_pollfd_param *params = &temp; |
@@ -541,7 +539,7 @@ struct close_pollfd_param { | |||
541 | union iorpc_pollfd pollfd; | 539 | union iorpc_pollfd pollfd; |
542 | }; | 540 | }; |
543 | 541 | ||
544 | int gxio_mpipe_close_pollfd(gxio_mpipe_context_t * context, int pollfd_cookie) | 542 | int gxio_mpipe_close_pollfd(gxio_mpipe_context_t *context, int pollfd_cookie) |
545 | { | 543 | { |
546 | struct close_pollfd_param temp; | 544 | struct close_pollfd_param temp; |
547 | struct close_pollfd_param *params = &temp; | 545 | struct close_pollfd_param *params = &temp; |
@@ -558,7 +556,7 @@ struct get_mmio_base_param { | |||
558 | HV_PTE base; | 556 | HV_PTE base; |
559 | }; | 557 | }; |
560 | 558 | ||
561 | int gxio_mpipe_get_mmio_base(gxio_mpipe_context_t * context, HV_PTE *base) | 559 | int gxio_mpipe_get_mmio_base(gxio_mpipe_context_t *context, HV_PTE *base) |
562 | { | 560 | { |
563 | int __result; | 561 | int __result; |
564 | struct get_mmio_base_param temp; | 562 | struct get_mmio_base_param temp; |
@@ -579,7 +577,7 @@ struct check_mmio_offset_param { | |||
579 | unsigned long size; | 577 | unsigned long size; |
580 | }; | 578 | }; |
581 | 579 | ||
582 | int gxio_mpipe_check_mmio_offset(gxio_mpipe_context_t * context, | 580 | int gxio_mpipe_check_mmio_offset(gxio_mpipe_context_t *context, |
583 | unsigned long offset, unsigned long size) | 581 | unsigned long offset, unsigned long size) |
584 | { | 582 | { |
585 | struct check_mmio_offset_param temp; | 583 | struct check_mmio_offset_param temp; |