Exemple #1
0
int am33xx_do_sram_cpuidle(u32 wfi_flags, u32 m3_flags)
{
	struct am33xx_suspend_params params;
	int ret;

	/* Start with the default flags */
	memcpy(&params, &susp_params, sizeof(params));

	/* Clear bits configurable through this call */
	params.wfi_flags &= ~(WFI_SELF_REFRESH | WFI_WAKE_M3 | WFI_SAVE_EMIF |
							WFI_DISABLE_EMIF);

	/* Don't enter these states if the M3 isn't available */
	if (am33xx_pm->state != M3_STATE_INITED)
		wfi_flags &= ~WFI_WAKE_M3;

	/* Set bits that have been passed */
	params.wfi_flags |= wfi_flags;

	if (wfi_flags & WFI_WAKE_M3) {
		am33xx_pm->ipc.reg1 = IPC_CMD_IDLE;
		am33xx_pm->ipc.reg2 = DS_IPC_DEFAULT;
		am33xx_pm->ipc.reg3 = m3_flags;
		am33xx_pm->ipc.reg5 = DS_IPC_DEFAULT;
		wkup_m3_pm_set_cmd(&am33xx_pm->ipc);
		ret = wkup_m3_ping_noirq();
		if (ret < 0)
			return ret;
	}

	am33xx_do_wfi_sram(&params);
	return 0;
}
Exemple #2
0
int am33xx_do_sram_cpuidle_customized(u32 wfi_flags, u32 m3_flags, u32 state)
{
        struct am33xx_suspend_params params;
        //struct wkup_m3_wakeup_src wakeup_src;
	//ktime_t time_start, time_end;
	//s64 diff;
        int ret;

        /* Start with the default flags */
        memcpy(&params, &susp_params, sizeof(params));

        /* Clear bits configurable through this call */
        params.wfi_flags &= ~(WFI_SELF_REFRESH | WFI_WAKE_M3 | WFI_SAVE_EMIF |
                                                        WFI_DISABLE_EMIF);

        /* Don't enter these states if the M3 isn't available */
        if (am33xx_pm->state != M3_STATE_INITED)
                wfi_flags &= ~WFI_WAKE_M3;

        /* Set bits that have been passed */
        params.wfi_flags |= wfi_flags;

        if (wfi_flags & WFI_WAKE_M3) {
                am33xx_pm->ipc.reg1 = IPC_CMD_IDLE;
                am33xx_pm->ipc.reg2 = DS_IPC_DEFAULT;
                am33xx_pm->ipc.reg3 = m3_flags;
                am33xx_pm->ipc.reg5 = DS_IPC_DEFAULT;
		am33xx_pm->ipc.reg7 = 0xA5A50000 | state;
                wkup_m3_pm_set_cmd(&am33xx_pm->ipc);
                ret = wkup_m3_ping_noirq();
                if (ret < 0)
                        return ret;
        }
        //time_start = ktime_get();
        am33xx_do_wfi_sram(&params);
	//time_end = ktime_get();
	//diff = ktime_to_us(ktime_sub(time_end, time_start));
	/* print the wakeup reason */
	//wakeup_src = wkup_m3_wake_src();

	//pr_info("PM: Wakeup source %s time %d\n", wakeup_src.src, (int)diff);

        return 0;
}
Exemple #3
0
static int am33xx_do_sram_idle(long unsigned int arg)
{
	am33xx_do_wfi_sram((struct am33xx_suspend_params *)arg);
	return 0;
}
Exemple #4
0
int am33xx_rtc_only_idle(unsigned long wfi_flags)
{
	rtc_power_off_program(omap_rtc);
	am33xx_do_wfi_sram(wfi_flags);
	return 0;
}
Exemple #5
0
static int am33xx_do_sram_idle(long unsigned int state)
{
	am33xx_do_wfi_sram();
	return 0;
}
static int am33xx_do_sram_idle(long unsigned int state)
{
	am33xx_do_wfi_sram(&suspend_cfg_param_list[0]);

	return 0;
}