Lines Matching refs:operation

220  * @defgroup DMAE_Operation DMAE operation 
230 * @param source the source of the operation
231 * @param dest the destination of the operation
233 * operation whould be written to host
235 * @param b_resume_prev TRUE if this operation should resume a
236 * previous operation, FALSE if the source
238 * @param b_change_endianity TRUE if the operation should
275 * @param source the source of the operation
276 * @param dest the destination of the operation
277 * @param length the length, in DWORDS, of the operation
304 * @param context the context of the operation
341 OUT lm_dmae_operation_t* operation)
354 mm_mem_zero(operation, sizeof(lm_dmae_operation_t));
356 operation->mode = LM_DMAE_MODE_SINGLE_BLOCK;
357 operation->b_replicate_source = replicate_source;
358 operation->le32_swap = le32_swap;
359 operation->context = context;
360 operation->b_sync = TRUE;
362 operation->blocks[0].source = source;
363 operation->blocks[0].dest = dest;
364 operation->blocks[0].length = length;
367 operation->context,
368 &operation->main_cmd,
369 &operation->blocks[0],
384 * @param operation the operation which the command is a part of
392 lm_dmae_operation_t* operation,
395 lm_dmae_address_t source = lm_dmae_address( operation->executer_paddr.as_u64 ,LM_DMAE_ADDRESS_HOST_PHYS);
396 lm_dmae_address_t dest = lm_dmae_address( DMAE_REG_CMD_MEM + operation->context->executer_channel*DMAE_CMD_SIZE*sizeof(u32_t),
400 command->opcode = lm_dmae_opcode(pdev, source, dest, FALSE, TRUE, operation->context->change_endianity);
404 // Special handling for E1 HW DMAE operation: we give here the size we are writing MINUS 1,
417 command->comp_addr_lo = lm_dmae_idx_to_go_cmd(operation->context->executer_channel) / 4;
429 lm_dmae_operation_t* operation = NULL;
436 operation = mm_alloc_phys_mem(pdev, sizeof(lm_dmae_operation_t), &operation_phys_addr, PHYS_MEM_TYPE_NONCACHED, LM_RESOURCE_COMMON);
438 if (CHK_NULL(operation))
444 mm_mem_zero(operation, sizeof(lm_dmae_operation_t));
446 operation->mode = LM_DMAE_MODE_SGL;
447 operation->context = context;
448 operation->b_sync = b_sync;
452 operation->executer_paddr = executer_phys_addr;
454 lm_dmae_initialize_sgl_loader_command(pdev, operation, &operation->main_cmd);
455 return operation;
459 lm_dmae_operation_t* operation,
475 new_sge_idx = operation->next_free_block;
477 if (new_sge_idx >= ARRSIZE(operation->blocks))
479 DbgBreakMsg("Too many SGEs in DMAE operation");
483 if (0 != operation->next_free_block)
485 last_sge_idx = operation->next_free_block-1;
486 last_sge = &operation->executer_cmd[last_sge_idx];
490 last_sge->comp_addr_lo = lm_dmae_idx_to_go_cmd(operation->context->main_channel) / 4;
496 operation->blocks[new_sge_idx].source = source;
497 operation->blocks[new_sge_idx].dest = dest;
498 operation->blocks[new_sge_idx].length = length;
501 operation->context,
502 &operation->executer_cmd[new_sge_idx],
503 &operation->blocks[new_sge_idx],
510 operation->next_free_block++;
515 void lm_dmae_operation_clear_all_sges(lm_dmae_operation_t* operation)
517 DbgBreakIf(LM_DMAE_MODE_SGL != operation->mode);
519 operation->next_free_block = 0;
522 u8_t lm_dmae_operation_is_complete(IN lm_dmae_operation_t* operation)
524 return operation->context->completion_word != operation->command_id;
528 * Wait for an operation to finish. Note that this function
533 * @param operation the operation to wait for
536 * LM_STATUS_TIMEOUT if the operation did not finish in
541 lm_dmae_operation_wait(struct _lm_device_t* pdev, lm_dmae_operation_t* operation)
547 while (!lm_dmae_operation_is_complete(operation))
554 "Timed-out waiting for operation %d to complete. Completion word is 0x%x expected 0x%x.\n",(u64_t)operation->command_id,
555 (u64_t)operation->context->completion_word,
556 (u64_t)operation->context->completion_value);
570 if (LM_STATUS_SUCCESS != lm_dmae_context_reset(operation->context))
715 lm_status_t lm_dmae_context_execute(struct _lm_device_t* pdev, lm_dmae_context_t *context, lm_dmae_operation_t *operation)
726 lm_status = lm_dmae_context_execute_unsafe(pdev, context,operation);
732 //we'll let the caller decide if DbgBreak should be called when lm_reset_is_inprogress interrupts a DMAE operation.
818 * Execute an SGL operation without acquiring the
823 * @param context the context that executes the operation
824 * @param operation the operation to execute
827 * LM_STATUS_TIMEOUT if the operation did not finish in
830 lm_status_t lm_dmae_context_execute_sgl(struct _lm_device_t* pdev, lm_dmae_context_t *context, lm_dmae_operation_t *operation)
834 context->completion_word = operation->command_id;
836 lm_dmae_post_command(pdev, context->main_channel, &operation->main_cmd);
838 if (operation->b_sync)
840 lm_status = lm_dmae_operation_wait(pdev, operation);
855 * Note: This function modifies operation->main_cmd.
859 * @param context the context that executes the operation
860 * @param operation the operation to execute
862 * sub-operation. This value overrides
863 * whatever is stored in operation
865 * sub-operation. This value overrides
866 * whatever is stored in operation
867 * @param length the length of the current sub-operation. This
868 * value overrides whatever is stored in operation
871 * LM_STATUS_TIMEOUT if the operation did not finish in
877 lm_dmae_operation_t *operation,
892 switch (operation->blocks[0].source.type)
897 operation->main_cmd.src_addr_hi = src_addr.as_u32.high;
898 operation->main_cmd.src_addr_lo = src_addr.as_u32.low;
903 operation->main_cmd.src_addr_hi = context->intermediate_buffer_paddr.as_u32.high;
904 operation->main_cmd.src_addr_lo = context->intermediate_buffer_paddr.as_u32.low;
907 if (operation->le32_swap)
918 DbgBreakMsg("Unknown source address type for DMAE operation.\n");
924 switch (operation->blocks[0].dest.type)
929 operation->main_cmd.dst_addr_hi = dst_addr.as_u32.high;
930 operation->main_cmd.dst_addr_lo = dst_addr.as_u32.low;
935 operation->main_cmd.dst_addr_hi = context->intermediate_buffer_paddr.as_u32.high;
936 operation->main_cmd.dst_addr_lo = context->intermediate_buffer_paddr.as_u32.low;
941 DbgBreakMsg("Unknown destination address type for DMAE operation.\n");
949 context->completion_word = operation->command_id;
951 operation->main_cmd.len = length;
953 lm_dmae_post_command(pdev, context->main_channel, &operation->main_cmd);
955 lm_status = lm_dmae_operation_wait(pdev, operation);
963 if (operation->blocks[0].dest.type == LM_DMAE_ADDRESS_HOST_VIRT)
972 * Execute a single-block operation without acquiring the
977 * @param context the context that executes the operation
978 * @param operation the operation to execute
981 * LM_STATUS_TIMEOUT if the operation did not finish in
985 lm_dmae_context_execute_single_block(struct _lm_device_t* pdev, lm_dmae_context_t *context, lm_dmae_operation_t *operation)
997 const u16_t length_limit = (operation->blocks[0].dest.type != LM_DMAE_ADDRESS_GRC) ? min( DMAE_MAX_READ_SIZE, DMAE_MAX_RW_SIZE(pdev) ) : DMAE_MAX_RW_SIZE(pdev) ;
1003 cnt_split = operation->blocks[0].length / length_limit;
1004 length_mod = operation->blocks[0].length % length_limit;
1006 src_addr.as_u64 = lm_dmae_address_native_offset(&operation->blocks[0].source);
1009 dst_addr.as_u64 = lm_dmae_address_native_offset(&operation->blocks[0].dest);
1015 if ( CHK_NULL(pdev) || ERR_IF( 0 == operation->blocks[0].length ) )
1024 if( !operation->b_replicate_source )
1026 if (operation->blocks[0].source.type == LM_DMAE_ADDRESS_GRC)
1036 if (operation->blocks[0].dest.type == LM_DMAE_ADDRESS_GRC)
1050 lm_status = lm_dmae_context_execute_sub_operation(pdev, context, operation, src_addr_split, dst_addr_split, length_current);
1061 lm_status_t lm_dmae_context_execute_unsafe(struct _lm_device_t* pdev, lm_dmae_context_t *context, lm_dmae_operation_t *operation)
1070 DbgBreakIf(context->mode != operation->mode);
1072 operation->command_id = lm_dmae_context_advance_command_id(context);
1078 lm_status = lm_dmae_context_execute_single_block(pdev, context, operation);
1083 lm_status = lm_dmae_context_execute_sgl(pdev, context, operation);
1207 lm_dmae_operation_t operation = {0};
1215 lm_status = lm_dmae_operation_create(pdev, source, dest, length, replicate_source, le32_swap, context, &operation);
1221 lm_status = lm_dmae_context_execute(pdev, context, &operation);
1234 lm_dmae_operation_t operation = {0};
1239 lm_status = lm_dmae_operation_create(pdev, source, dest, length, FALSE, FALSE, context, &operation);
1245 lm_status = lm_dmae_context_execute(pdev, context, &operation);
1259 lm_dmae_operation_t operation = {0};
1267 lm_status = lm_dmae_operation_create(pdev, source, dest, length, FALSE, le32_swap, context, &operation);
1273 lm_status = lm_dmae_context_execute(pdev, context, &operation);
1286 lm_dmae_operation_t operation = {0};
1289 lm_status = lm_dmae_operation_create(pdev, source, dest, length, FALSE, FALSE, context, &operation);
1295 lm_status = lm_dmae_context_execute_unsafe(pdev, context, &operation);
1298 //if the operation failed due to lm_reset_is_inprogress, treat it as success.