int HandleRestartCP(void *data)
{
#ifdef CONFIG_KONA_SECURE_MEMC
	u32 *memc_handle;
#endif
	IPC_DEBUG(DBG_INFO, "enter\n");

	IPC_DEBUG(DBG_INFO, "call local_irq_disable()\n");
	local_irq_disable();

	IPC_DEBUG(DBG_INFO, "resetting CP\n");
	ResetCP();

	/* reload CP */
	IPC_DEBUG(DBG_INFO, "reloading CP\n");
	ReloadCP();

	IPC_DEBUG(DBG_INFO, "rebooting CP\n");
	/* reboot CP; this will also wipe IPC shared memory */
	cpStart(1);

	IPC_DEBUG(DBG_INFO, "call local_irq_enable()\n");
	local_irq_enable();
	enable_irq(IRQ_IPC_C2A);

	IPC_DEBUG(DBG_INFO, "re-init IPC\n");
	/* reinitialize IPC, and wait for IPC sync with CP */
	if (ipcs_reinitialize_ipc()) {
		IPC_DEBUG(DBG_ERROR, "ipcs_reinitialize_ipc failed\n");
		/* CP didn't re-sync, so crash AP here */
		BUG();
	}

	/* give CP some time to boot; without this delay, we hang
	 * on the CAPI2_PhoneCtrlApi_ProcessPowerUpReq() from RIL
	 */
	msleep(2000);

	/* notify clients that we're back in business... */
	IPC_DEBUG(DBG_INFO, "notifying clients CP reset is complete\n");
	HandleCPResetDone();
	IPC_DEBUG(DBG_INFO, "notification done, exiting reset thread\n");

#ifdef CONFIG_KONA_SECURE_MEMC
	memc_handle = get_secure_memc_handle();

	if (!memc_handle)
		pr_err("Failed to get secure memc handle\n");
	else if (do_revoke_region_access(memc_handle, AP))
		pr_err("Failed to revoke access for AP\n");
#endif

	/* done with thread */
	do_exit(0);
}
Пример #2
0
int HandleRestartCP(void *data)
{
	IPC_DEBUG(DBG_INFO, "enter\n");

	IPC_DEBUG(DBG_INFO, "call local_irq_disable()\n");
	local_irq_disable();

	IPC_DEBUG(DBG_INFO, "resetting CP\n");
	ResetCP();

	/* reload CP */
	IPC_DEBUG(DBG_INFO, "reloading CP\n");
	ReloadCP();

	IPC_DEBUG(DBG_INFO, "rebooting CP\n");
	/* reboot CP; this will also wipe IPC shared memory */
	Comms_Start(1);

	IPC_DEBUG(DBG_INFO, "call local_irq_enable()\n");
	local_irq_enable();
	enable_irq(IRQ_IPC_C2A);

	IPC_DEBUG(DBG_INFO, "re-init IPC\n");
	/* reinitialize IPC, and wait for IPC sync with CP */
	if (ipcs_reinitialize_ipc()) {
		IPC_DEBUG(DBG_ERROR, "ipcs_reinitialize_ipc failed\n");
		/* CP didn't re-sync, so crash AP here */
		BUG();
	}

	/* give CP some time to boot; without this delay, we hang
	 * on the CAPI2_PhoneCtrlApi_ProcessPowerUpReq() from RIL
	 */
	msleep(2000);

	/* notify clients that we're back in business... */
	IPC_DEBUG(DBG_INFO, "notifying clients CP reset is complete\n");
	HandleCPResetDone();
	IPC_DEBUG(DBG_INFO, "notification done, exiting reset thread\n");

	/* done with thread */
	do_exit(0);
}