arch/arm/mach-omap2/pm33xx-core.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-omap2/pm33xx-core.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-omap2/pm33xx-core.c- Extension
.c- Size
- 9881 bytes
- Lines
- 443
- Domain
- Architecture Layer
- Bucket
- arch/arm
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cpuidle.hlinux/platform_data/pm33xx.hlinux/suspend.hasm/cpuidle.hasm/smp_scu.hasm/suspend.hlinux/errno.hlinux/clk.hlinux/cpu.hlinux/platform_data/gpio-omap.hlinux/wkup_m3_ipc.hlinux/of.hlinux/rtc.hcm33xx.hcommon.hcontrol.hclockdomain.hiomap.hpm.hpowerdomain.hprm33xx.hsoc.hsram.homap-secure.h
Detected Declarations
struct amx3_idle_statefunction am43xx_map_scufunction am33xx_check_off_mode_enablefunction am43xx_check_off_mode_enablefunction amx3_common_initfunction am33xx_suspend_initfunction am43xx_suspend_initfunction amx3_suspend_deinitfunction amx3_pre_suspend_commonfunction amx3_post_suspend_commonfunction am33xx_suspendfunction am43xx_suspendfunction am33xx_cpu_suspendfunction am43xx_cpu_suspendfunction amx3_begin_suspendfunction amx3_finish_suspendfunction am43xx_save_contextfunction am33xx_restore_contextfunction am43xx_restore_contextfunction amx3_suspend_blockfunction amx3_pm_validfunction amx3_block_suspendfunction amx3_block_suspendfunction amx3_idle_initfunction amx3_idle_enter
Annotated Snippet
struct amx3_idle_state {
int wfi_flags;
};
static struct amx3_idle_state *idle_states;
static int am43xx_map_scu(void)
{
scu_base = ioremap(scu_a9_get_base(), SZ_256);
if (!scu_base)
return -ENOMEM;
return 0;
}
static int 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;
}
static int 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;
else if (enable_off_mode)
pr_warn("WARNING: This platform does not support off-mode, entering DeepSleep suspend.\n");
return 0;
}
static int amx3_common_init(int (*idle)(u32 wfi_flags))
{
gfx_pwrdm = pwrdm_lookup("gfx_pwrdm");
per_pwrdm = pwrdm_lookup("per_pwrdm");
mpu_pwrdm = pwrdm_lookup("mpu_pwrdm");
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");
else if (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);
idle_fn = idle;
return 0;
}
static int am33xx_suspend_init(int (*idle)(u32 wfi_flags))
{
gfx_l4ls_clkdm = clkdm_lookup("gfx_l4ls_gfx_clkdm");
if (!gfx_l4ls_clkdm) {
pr_err("PM: Cannot lookup gfx_l4ls_clkdm clockdomains\n");
return -ENODEV;
}
return amx3_common_init(idle);
}
static int am43xx_suspend_init(int (*idle)(u32 wfi_flags))
{
int ret = 0;
ret = am43xx_map_scu();
if (ret) {
pr_err("PM: Could not ioremap SCU\n");
return ret;
}
ret = amx3_common_init(idle);
return ret;
}
Annotation
- Immediate include surface: `linux/cpuidle.h`, `linux/platform_data/pm33xx.h`, `linux/suspend.h`, `asm/cpuidle.h`, `asm/smp_scu.h`, `asm/suspend.h`, `linux/errno.h`, `linux/clk.h`.
- Detected declarations: `struct amx3_idle_state`, `function am43xx_map_scu`, `function am33xx_check_off_mode_enable`, `function am43xx_check_off_mode_enable`, `function amx3_common_init`, `function am33xx_suspend_init`, `function am43xx_suspend_init`, `function amx3_suspend_deinit`, `function amx3_pre_suspend_common`, `function amx3_post_suspend_common`.
- Atlas domain: Architecture Layer / arch/arm.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.