staticint am33xx_check_off_mode_enable(void)
{ if (enable_off_mode)
pr_warn("WARNING: This platform does not support off-mode, entering DeepSleep suspend.\n");
/* off mode not supported on am335x so return 0 always */ return 0;
}
staticint am43xx_check_off_mode_enable(void)
{ /* * Check for am437x-gp-evm which has the right Hardware design to * support this mode reliably.
*/ if (of_machine_is_compatible("ti,am437x-gp-evm") && enable_off_mode) return enable_off_mode; elseif (enable_off_mode)
pr_warn("WARNING: This platform does not support off-mode, entering DeepSleep suspend.\n");
if ((!gfx_pwrdm) || (!per_pwrdm) || (!mpu_pwrdm)) return -ENODEV;
(void)clkdm_for_each(omap_pm_clkdms_setup, NULL);
/* CEFUSE domain can be turned off post bootup */
cefuse_pwrdm = pwrdm_lookup("cefuse_pwrdm"); if (!cefuse_pwrdm)
pr_err("PM: Failed to get cefuse_pwrdm\n"); elseif (omap_type() != OMAP2_DEVICE_TYPE_GP)
pr_info("PM: Leaving EFUSE power domain active\n"); else
omap_set_pwrdm_state(cefuse_pwrdm, PWRDM_POWER_OFF);
staticvoid amx3_post_suspend_common(void)
{ int status; /* * Because gfx_pwrdm is the only one under MPU control, * comment on transition status
*/
status = pwrdm_read_pwrst(gfx_pwrdm); if (status != PWRDM_POWER_OFF)
pr_err("PM: GFX domain did not transition: %x\n", status);
}
staticint am33xx_suspend(unsignedint state, int (*fn)(unsignedlong), unsignedlong args)
{ int ret = 0;
amx3_pre_suspend_common();
ret = cpu_suspend(args, fn);
amx3_post_suspend_common();
/* * BUG: GFX_L4LS clock domain needs to be woken up to * ensure thet L4LS clock domain does not get stuck in * transition. If that happens L3 module does not get * disabled, thereby leading to PER power domain * transition failing
*/
staticint am43xx_suspend(unsignedint state, int (*fn)(unsignedlong), unsignedlong args)
{ int ret = 0;
/* Suspend secure side on HS devices */ if (omap_type() != OMAP2_DEVICE_TYPE_GP) { if (optee_available)
omap_smccc_smc(AM43xx_PPA_SVC_PM_SUSPEND, 0); else
omap_secure_dispatcher(AM43xx_PPA_SVC_PM_SUSPEND,
FLAG_START_CRITICAL,
0, 0, 0, 0, 0);
}
amx3_pre_suspend_common();
scu_power_mode(scu_base, SCU_PM_POWEROFF);
ret = cpu_suspend(args, fn);
scu_power_mode(scu_base, SCU_PM_NORMAL);
if (!am43xx_check_off_mode_enable())
amx3_post_suspend_common();
/* * Resume secure side on HS devices. * * Note that even on systems with OP-TEE available this resume call is * issued to the ROM. This is because upon waking from suspend the ROM * is restored as the secure monitor. On systems with OP-TEE ROM will * restore OP-TEE during this call.
*/ if (omap_type() != OMAP2_DEVICE_TYPE_GP)
omap_secure_dispatcher(AM43xx_PPA_SVC_PM_RESUME,
FLAG_START_CRITICAL,
0, 0, 0, 0, 0);
return ret;
}
staticint am33xx_cpu_suspend(int (*fn)(unsignedlong), unsignedlong args)
{ int ret = 0;
if (omap_irq_pending() || need_resched()) return ret;
ret = cpu_suspend(args, fn);
return ret;
}
staticint am43xx_cpu_suspend(int (*fn)(unsignedlong), unsignedlong args)
{ int ret = 0;
if (!scu_base) return 0;
scu_power_mode(scu_base, SCU_PM_DORMANT);
ret = cpu_suspend(args, fn);
scu_power_mode(scu_base, SCU_PM_NORMAL);
#ifdef CONFIG_SUSPEND /* * Block system suspend initially. Later on pm33xx sets up it's own * platform_suspend_ops after probe. That depends also on loaded * wkup_m3_ipc and booted am335x-pm-firmware.elf.
*/ staticint amx3_suspend_block(suspend_state_t state)
{
pr_warn("PM not initialized for pm33xx, wkup_m3_ipc, or am335x-pm-firmware.elf\n");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.