/**
*	Function Name:	DSPDRV_Init
*
*	Description: Initialize DSP driver
*
*	Notes:
*
******************************************************************************/
void DSPDRV_Init()
{
	UInt32 *dsp_shared_mem;
	int rc;
	AP_SharedMem_t *shared_mem;
	UInt16 temp;


	aTrace(LOG_AUDIO_DSP, "DSPDRV_Init:\n");

	/* get DSP AP shared memory */
	dsp_shared_mem = ioremap_nocache(AP_SH_BASE, AP_SH_SIZE);

	if (dsp_shared_mem == NULL) {
		aTrace(LOG_AUDIO_DSP,
		"\n\r\t* mapping shared memory failed\n\r");
		return;
	}

	shared_mem = (AP_SharedMem_t *) dsp_shared_mem;

	temp = shared_mem->shared_dsp_support_chip_reg_ap_int;

	/* initialize DSP AP shared memory */
	VPSHAREDMEM_Init(dsp_shared_mem);

	shared_mem->shared_dsp_support_chip_reg_ap_int = temp;

	/* Create Tasklet */
	tasklet_init(&(dsp_drv.task), dsp_thread_proc,
		     (unsigned long)(&dsp_drv));

	/* enable AP to DSP interrupt */
	IRQ_EnableRIPInt();
	/* enable DSP to AP interrupt */
	IRQ_Enable_BModem_Interrupt();

	/* Plug in the ISR enables  IRQ198 */
	rc = request_irq(COMMS_SUBS6_IRQ, rip_isr,
			IRQF_DISABLED | IRQF_NO_SUSPEND,
			 "bcm215xx-dsp", &(dsp_drv));

	if (rc < 0) {
		aTrace(LOG_AUDIO_DSP,
		       "RIPISR: %s failed to attach interrupt, rc = %d\n",
		       __func__, rc);
		return;
	}

	CSL_VPU_Enable();

	return;
}
/**
*	Function Name:	DSPDRV_Init
*
*	Description: Initialize DSP driver
*
*	Notes:
*
******************************************************************************/
void DSPDRV_Init()
{
	UInt32 *dsp_shared_mem;
	int rc;

	aTrace(LOG_AUDIO_DSP, "DSPDRV_Init:\n");

	dsp_drv.h = chal_intc_init(KONA_BINTC_BASE_ADDR);

	dsp_shared_mem = DSPDRV_GetSharedMemoryAddress();

	VPSHAREDMEM_Init(dsp_shared_mem);

	/* temporary to open CP DSP shared memory structure on AP */
	cp_shared_mem = ioremap_nocache(CP_SH_BASE, CP_SH_SIZE);

	/* Create Tasklet */
	tasklet_init(&(dsp_drv.task), dsp_thread_proc,
		     (unsigned long)(&dsp_drv));

	IRQ_EnableRIPInt();
	IRQ_Enable_BModem_Interrupt(BMIRQ23, 6);

	/* Plug in the ISR enables  IRQ198 */
	rc = request_irq(COMMS_SUBS6_IRQ, rip_isr,
			IRQF_DISABLED | IRQF_NO_SUSPEND,
			 "bcm215xx-dsp", &(dsp_drv));

	if (rc < 0) {
		aTrace(LOG_AUDIO_DSP,
		       "RIPISR: %s failed to attach interrupt, rc = %d\n",
		       __func__, rc);
		return;
	}

	CSL_VPU_Enable();

	return;
}
Exemplo n.º 3
0
static void IRQ_TriggerRIPInt(void)
{
	 void __iomem *chipreg_base = (void __iomem *)(KONA_CHIPREG_VA);

	 /* Forcing new interrupt in case DSP woke up after the Interrupt */
	 /* was enabled */
	 if ((vp_shared_mem->shared_ap_support_chip_reg_ap_int == 0) &&
		 (vp_shared_mem->shared_dsp_support_chip_reg_ap_int == 1))
		 IRQ_EnableRIPInt();

	 if (vp_shared_mem->shared_ap_support_chip_reg_ap_int) {
		 aTrace(LOG_AUDIO_DSP, "\n\r\t*IRQ_TriggerRIPInt: New Int*\n\r");
		 writel((1<<CHIPREG_OUTPUT12), (chipreg_base +
		 	CHIPREG_MDM_SW_INTR_SET_OFFSET));
	 } else {
		 aTrace(LOG_AUDIO_DSP, "\n\r\t*IRQ_TriggerRIPInt: Old Int*\n\r");
		 *(volatile UInt32*)(KONA_BINTC_BASE_ADDR +
		 BINTC_ISWIR1_OFFSET) = 1<<(IRQ_TO_BMIRQ(AP_RIP_IRQ)-32);
	 }


	return;
}