示例#1
0
/**
* @fn abe_connect_cbpr_dmareq_port()
*
*  Operations : enables the data echange between a DMA and the ABE through the
*	CBPr registers of AESS.
*
*   Parameters :
*   id: port name
*   f : desired data format
*   d : desired dma_request line (0..7)
*   a : returned pointer to the base address of the CBPr register and number of
*	samples to exchange during a DMA_request.
*
* @see	ABE_API.h
*/
void abe_connect_cbpr_dmareq_port(abe_port_id id, abe_data_format_t *f, abe_uint32 d, abe_dma_t *returned_dma_t)
{
	_lock_enter
	_log(id_connect_cbpr_dmareq_port,id,f->f,f->samp_format)

	abe_port[id] = ((abe_port_t *)abe_port_init)[id];

	abe_port[id].format = *f;
	abe_port[id].protocol.protocol_switch = DMAREQ_PORT_PROT;
	abe_port[id].protocol.p.prot_dmareq.iter = abe_dma_port_iteration(f);
	abe_port[id].protocol.p.prot_dmareq.dma_addr = ABE_DMASTATUS_RAW;
	abe_port[id].protocol.p.prot_dmareq.dma_data = (1 << d);

	abe_port[id].status = RUN_P;

	/* load the micro-task parameters */
	abe_init_io_tasks(id, &((abe_port [id]).format), &((abe_port [id]).protocol));

	/* load the dma_t with physical information from AE memory mapping */
	abe_init_dma_t(id, &((abe_port [id]).protocol));

	/* load the ATC descriptors - disabled */
	abe_init_atc(id);

	/* return the dma pointer address */
	abe_read_port_address(id, returned_dma_t);

	_lock_exit
}
示例#2
0
/*
 *  ABE_HW_CONFIGURATION
 *
 *  Parameter  :
 *
 *  Operations :
 *
 *
 *  Return value :
 *
 */
void abe_hw_configuration()
{
	abe_uint32 atc_reg;
	abe_port_protocol_t *protocol;
	abe_data_format_t format;

	/* initializes the ABE ATC descriptors in DMEM - MCPDM_UL */
	protocol = &(abe_port[PDM_UL_PORT].protocol);   format = abe_port[PDM_UL_PORT].format;
	abe_init_atc(PDM_UL_PORT);
	abe_init_io_tasks(PDM_UL_PORT, &format, protocol);

	/* initializes the ABE ATC descriptors in DMEM - MCPDM_DL */
	protocol = &(abe_port[PDM_DL1_PORT].protocol);	format = abe_port[PDM_DL1_PORT].format;
	abe_init_atc(PDM_DL1_PORT);
	abe_init_io_tasks(PDM_DL1_PORT, &format, protocol);

	/* one DMIC port enabled = all DMICs enabled, since there is a single DMIC path for all DMICs */
	protocol = &(abe_port[DMIC_PORT1].protocol);	format = abe_port[DMIC_PORT1].format;
	abe_init_atc(DMIC_PORT1);
	abe_init_io_tasks(DMIC_PORT1, &format, protocol);

	/* enables the DMAreq from AESS  AESS_DMAENABLE_SET = 255 */
	atc_reg = 0xFF;
	abe_block_copy(COPY_FROM_HOST_TO_ABE, ABE_ATC, 0x60, &atc_reg, 4);

#if 0
	/* let the EVENT be configured once the ports are already programmed */
	/* enables EVENT_GENERATOR_START=6C from McPDM */
	atc_reg = 0x01;
	abe_block_copy(COPY_FROM_HOST_TO_ABE, ABE_ATC, 0x6C, &atc_reg, 4);

	// set McPDM_DL as EVENT_SOURCE_SELECTION
	event = 0L;						// source = DMAreq
	abe_block_copy(COPY_FROM_HOST_TO_ABE, ABE_ATC, 0x70, &event, 4);

	event = 2L;						// source = MCPDM_DL to AUDIO_ENGINE_SCHEDULER
	abe_block_copy(COPY_FROM_HOST_TO_ABE, ABE_ATC, 0x74, &event, 4);
#endif
}
示例#3
0
/*
 *  ABE_ENABLE_DATA_TRANSFER
 *
 *  Parameter  :
 *	p: port indentifier
 *
 *  Operations :
 *	enables the ATC descriptor
 *	reset ATC pointers
 *	enable the IO task (@f <> 0)
 *
 *  Return value :
 *	None.
 */
void abe_enable_data_transfer(abe_port_id id)
{
	abe_port_protocol_t *protocol;
	abe_data_format_t format;

	_lock_enter
	_log(id_enable_data_transfer,id,0,0)

	abe_clean_temporary_buffers(id);

	if (id == PDM_UL_PORT) {
		/* initializes the ABE ATC descriptors in DMEM - MCPDM_UL */
		protocol = &(abe_port[PDM_UL_PORT].protocol);
		format = abe_port[PDM_UL_PORT].format;
		abe_init_atc(PDM_UL_PORT);
		abe_init_io_tasks(PDM_UL_PORT, &format, protocol);
	}
	if (id == PDM_DL_PORT) {
		/* initializes the ABE ATC descriptors in DMEM - MCPDM_DL */
		protocol = &(abe_port[PDM_DL_PORT].protocol);
		format = abe_port[PDM_DL_PORT].format;
		abe_init_atc(PDM_DL_PORT);
		abe_init_io_tasks(PDM_DL_PORT, &format, protocol);
	}
	if (id == DMIC_PORT) {
		/* one DMIC port enabled = all DMICs enabled,
		 * since there is a single DMIC path for all DMICs */
		protocol = &(abe_port[DMIC_PORT].protocol);
		format = abe_port[DMIC_PORT].format;
		abe_init_atc(DMIC_PORT);
		abe_init_io_tasks(DMIC_PORT, &format, protocol);
	}

	/* local host variable status= "port is running" */
	abe_port[id].status = RUN_P;
	/* enable DMA requests */
	abe_enable_dma_request(id);
	_lock_exit
}
示例#4
0
/*
 *  ABE_DISABLE_DATA_TRANSFER
 *
 *  Parameter  :
 *	p: port indentifier
 *
 *  Operations :
 *	disables the ATC descriptor and stop IO/port activities
 *	disable the IO task (@f = 0)
 *	clear ATC DMEM buffer, ATC enabled
 *
 *  Return value :
 *	None.
 */
void abe_disable_data_transfer(abe_port_id id)
{
	_lock_enter
	_log(id_disable_data_transfer,id,0,0)

	/* local host variable status= "port is running" */
	abe_port[id].status = IDLE_P;
	/* disable DMA requests */
	abe_disable_dma_request(id);
	/* disable ATC transfers */
	abe_init_atc(id);
	abe_clean_temporary_buffers(id);

	_lock_exit

}