arch/arm/mach-omap2/omap-mpuss-lowpower.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-omap2/omap-mpuss-lowpower.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-omap2/omap-mpuss-lowpower.c- Extension
.c- Size
- 13827 bytes
- Lines
- 502
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cpuidle.hlinux/kernel.hlinux/io.hlinux/errno.hlinux/linkage.hlinux/smp.hasm/cacheflush.hasm/tlbflush.hasm/smp_scu.hasm/suspend.hasm/virt.hasm/hardware/cache-l2x0.hsoc.hcommon.homap44xx.homap4-sar-layout.hpm.hprcm_mpu44xx.hprcm_mpu54xx.hprminst44xx.hprcm44xx.hprm44xx.hprm-regbits-44xx.h
Detected Declarations
struct omap4_cpu_pm_infostruct cpu_pm_opsfunction default_finish_suspendfunction dummy_cpu_resumefunction set_cpu_wakeup_addrfunction scu_pwrst_preparefunction mpuss_clear_prev_logic_pwrstfunction cpu_clear_prev_logic_pwrstfunction l2x0_pwrst_preparefunction save_l2x0_contextfunction save_l2x0_contextfunction omap4_hotplug_cpufunction enable_mercury_retention_modefunction omap4_mpuss_initfunction omap4_get_cpu1_ns_pa_addrfunction clockdomains_init
Annotated Snippet
struct omap4_cpu_pm_info {
struct powerdomain *pwrdm;
void __iomem *scu_sar_addr;
void __iomem *wkup_sar_addr;
void __iomem *l2x0_sar_addr;
};
/**
* struct cpu_pm_ops - CPU pm operations
* @finish_suspend: CPU suspend finisher function pointer
* @resume: CPU resume function pointer
* @scu_prepare: CPU Snoop Control program function pointer
* @hotplug_restart: CPU restart function pointer
*
* Structure holds functions pointer for CPU low power operations like
* suspend, resume and scu programming.
*/
struct cpu_pm_ops {
int (*finish_suspend)(unsigned long cpu_state);
void (*resume)(void);
void (*scu_prepare)(unsigned int cpu_id, unsigned int cpu_state);
void (*hotplug_restart)(void);
};
static DEFINE_PER_CPU(struct omap4_cpu_pm_info, omap4_pm_info);
static struct powerdomain *mpuss_pd;
static u32 cpu_context_offset;
static int default_finish_suspend(unsigned long cpu_state)
{
omap_do_wfi();
return 0;
}
static void dummy_cpu_resume(void)
{}
static void dummy_scu_prepare(unsigned int cpu_id, unsigned int cpu_state)
{}
static struct cpu_pm_ops omap_pm_ops = {
.finish_suspend = default_finish_suspend,
.resume = dummy_cpu_resume,
.scu_prepare = dummy_scu_prepare,
.hotplug_restart = dummy_cpu_resume,
};
/*
* Program the wakeup routine address for the CPU0 and CPU1
* used for OFF or DORMANT wakeup.
*/
static inline void set_cpu_wakeup_addr(unsigned int cpu_id, u32 addr)
{
struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu_id);
if (pm_info->wkup_sar_addr)
writel_relaxed(addr, pm_info->wkup_sar_addr);
}
/*
* Store the SCU power status value to scratchpad memory
*/
static void scu_pwrst_prepare(unsigned int cpu_id, unsigned int cpu_state)
{
struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu_id);
u32 scu_pwr_st;
switch (cpu_state) {
case PWRDM_POWER_RET:
scu_pwr_st = SCU_PM_DORMANT;
break;
case PWRDM_POWER_OFF:
scu_pwr_st = SCU_PM_POWEROFF;
break;
case PWRDM_POWER_ON:
case PWRDM_POWER_INACTIVE:
default:
scu_pwr_st = SCU_PM_NORMAL;
break;
}
if (pm_info->scu_sar_addr)
writel_relaxed(scu_pwr_st, pm_info->scu_sar_addr);
}
/* Helper functions for MPUSS OSWR */
static inline void mpuss_clear_prev_logic_pwrst(void)
{
u32 reg;
Annotation
- Immediate include surface: `linux/cpuidle.h`, `linux/kernel.h`, `linux/io.h`, `linux/errno.h`, `linux/linkage.h`, `linux/smp.h`, `asm/cacheflush.h`, `asm/tlbflush.h`.
- Detected declarations: `struct omap4_cpu_pm_info`, `struct cpu_pm_ops`, `function default_finish_suspend`, `function dummy_cpu_resume`, `function set_cpu_wakeup_addr`, `function scu_pwrst_prepare`, `function mpuss_clear_prev_logic_pwrst`, `function cpu_clear_prev_logic_pwrst`, `function l2x0_pwrst_prepare`, `function save_l2x0_context`.
- 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.