arch/arm/mach-omap2/pm34xx.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-omap2/pm34xx.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-omap2/pm34xx.c- Extension
.c- Size
- 14936 bytes
- Lines
- 593
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/cpu_pm.hlinux/pm.hlinux/suspend.hlinux/interrupt.hlinux/module.hlinux/list.hlinux/err.hlinux/clk.hlinux/delay.hlinux/slab.hlinux/of.hlinux/cpuidle.htrace/events/power.hasm/fncpy.hasm/suspend.hasm/system_misc.hclockdomain.hpowerdomain.hsoc.hcommon.hcm3xxx.hcm-regbits-34xx.hprm-regbits-34xx.hprm3xxx.hpm.hsdrc.homap-secure.hsram.hcontrol.hvc.h
Detected Declarations
struct power_statefunction omap3_core_save_contextfunction omap3_core_restore_contextfunction omap3_save_secure_ram_contextfunction _prcm_int_handle_iofunction _prcm_int_handle_wakeupfunction omap34xx_save_contextfunction omap34xx_do_sram_idlefunction omap_sram_idlefunction pwrdm_read_prev_pwrstfunction omap3_pm_idlefunction omap3_pm_suspendfunction prcm_setup_regsfunction omap3_pm_off_mode_enablefunction list_for_each_entryfunction omap3_pm_get_suspend_statefunction list_for_each_entryfunction omap3_pm_set_suspend_statefunction list_for_each_entryfunction pwrdms_setupfunction omap_push_sram_idlefunction pm_errata_configurefunction omap3_pm_check_pmicfunction omap3_pm_init
Annotated Snippet
struct power_state {
struct powerdomain *pwrdm;
u32 next_state;
#ifdef CONFIG_SUSPEND
u32 saved_state;
#endif
struct list_head node;
};
static LIST_HEAD(pwrst_list);
void (*omap3_do_wfi_sram)(void);
static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
static struct powerdomain *core_pwrdm, *per_pwrdm;
static void omap3_core_save_context(void)
{
omap3_ctrl_save_padconf();
/*
* Force write last pad into memory, as this can fail in some
* cases according to errata 1.157, 1.185
*/
omap_ctrl_writel(omap_ctrl_readl(OMAP343X_PADCONF_ETK_D14),
OMAP343X_CONTROL_MEM_WKUP + 0x2a0);
/* Save the Interrupt controller context */
omap_intc_save_context();
/* Save the system control module context, padconf already save above*/
omap3_control_save_context();
}
static void omap3_core_restore_context(void)
{
/* Restore the control module context, padconf restored by h/w */
omap3_control_restore_context();
/* Restore the interrupt controller context */
omap_intc_restore_context();
}
/*
* FIXME: This function should be called before entering off-mode after
* OMAP3 secure services have been accessed. Currently it is only called
* once during boot sequence, but this works as we are not using secure
* services.
*/
static void omap3_save_secure_ram_context(void)
{
u32 ret;
int mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
/*
* MPU next state must be set to POWER_ON temporarily,
* otherwise the WFI executed inside the ROM code
* will hang the system.
*/
pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
ret = omap3_save_secure_ram(omap3_secure_ram_storage,
OMAP3_SAVE_SECURE_RAM_SZ);
pwrdm_set_next_pwrst(mpu_pwrdm, mpu_next_state);
/* Following is for error tracking, it should not happen */
if (ret) {
pr_err("save_secure_sram() returns %08x\n", ret);
while (1)
;
}
}
}
static irqreturn_t _prcm_int_handle_io(int irq, void *unused)
{
int c;
c = omap_prm_clear_mod_irqs(WKUP_MOD, 1, OMAP3430_ST_IO_MASK |
OMAP3430_ST_IO_CHAIN_MASK);
return c ? IRQ_HANDLED : IRQ_NONE;
}
static irqreturn_t _prcm_int_handle_wakeup(int irq, void *unused)
{
int c;
/*
* Clear all except ST_IO and ST_IO_CHAIN for wkup module,
* these are handled in a separate handler to avoid acking
* IO events before parsing in mux code
*/
Annotation
- Immediate include surface: `linux/cpu_pm.h`, `linux/pm.h`, `linux/suspend.h`, `linux/interrupt.h`, `linux/module.h`, `linux/list.h`, `linux/err.h`, `linux/clk.h`.
- Detected declarations: `struct power_state`, `function omap3_core_save_context`, `function omap3_core_restore_context`, `function omap3_save_secure_ram_context`, `function _prcm_int_handle_io`, `function _prcm_int_handle_wakeup`, `function omap34xx_save_context`, `function omap34xx_do_sram_idle`, `function omap_sram_idle`, `function pwrdm_read_prev_pwrst`.
- Atlas domain: Architecture Layer / arch/arm.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.