arch/arm/mach-s3c/pm-s3c64xx.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-s3c/pm-s3c64xx.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-s3c/pm-s3c64xx.c- Extension
.c- Size
- 7279 bytes
- Lines
- 318
- 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/init.hlinux/suspend.hlinux/serial_core.hlinux/io.hlinux/gpio.hlinux/pm_domain.hmap.hirqs.hcpu.hdevs.hpm.hwakeup-mask.hregs-gpio.hregs-clock.hgpio-samsung.hregs-gpio-memport-s3c64xx.hregs-modem-s3c64xx.hregs-sys-s3c64xx.hregs-syscon-power-s3c64xx.h
Detected Declarations
struct s3c64xx_pm_domainfunction s3c64xx_pd_offfunction s3c64xx_pd_onfunction s3c_pm_configure_extintfunction s3c_pm_restore_corefunction s3c_pm_save_corefunction s3c64xx_cpu_suspendfunction s3c64xx_pm_preparefunction s3c64xx_pm_initfunction s3c64xx_pm_initcall
Annotated Snippet
struct s3c64xx_pm_domain {
char *const name;
u32 ena;
u32 pwr_stat;
struct generic_pm_domain pd;
};
static int s3c64xx_pd_off(struct generic_pm_domain *domain)
{
struct s3c64xx_pm_domain *pd;
u32 val;
pd = container_of(domain, struct s3c64xx_pm_domain, pd);
val = __raw_readl(S3C64XX_NORMAL_CFG);
val &= ~(pd->ena);
__raw_writel(val, S3C64XX_NORMAL_CFG);
return 0;
}
static int s3c64xx_pd_on(struct generic_pm_domain *domain)
{
struct s3c64xx_pm_domain *pd;
u32 val;
long retry = 1000000L;
pd = container_of(domain, struct s3c64xx_pm_domain, pd);
val = __raw_readl(S3C64XX_NORMAL_CFG);
val |= pd->ena;
__raw_writel(val, S3C64XX_NORMAL_CFG);
/* Not all domains provide power status readback */
if (pd->pwr_stat) {
do {
cpu_relax();
if (__raw_readl(S3C64XX_BLK_PWR_STAT) & pd->pwr_stat)
break;
} while (retry--);
if (!retry) {
pr_err("Failed to start domain %s\n", pd->name);
return -EBUSY;
}
}
return 0;
}
static struct s3c64xx_pm_domain s3c64xx_pm_irom = {
.name = "IROM",
.ena = S3C64XX_NORMALCFG_IROM_ON,
.pd = {
.power_off = s3c64xx_pd_off,
.power_on = s3c64xx_pd_on,
},
};
static struct s3c64xx_pm_domain s3c64xx_pm_etm = {
.name = "ETM",
.ena = S3C64XX_NORMALCFG_DOMAIN_ETM_ON,
.pwr_stat = S3C64XX_BLKPWRSTAT_ETM,
.pd = {
.power_off = s3c64xx_pd_off,
.power_on = s3c64xx_pd_on,
},
};
static struct s3c64xx_pm_domain s3c64xx_pm_s = {
.name = "S",
.ena = S3C64XX_NORMALCFG_DOMAIN_S_ON,
.pwr_stat = S3C64XX_BLKPWRSTAT_S,
.pd = {
.power_off = s3c64xx_pd_off,
.power_on = s3c64xx_pd_on,
},
};
static struct s3c64xx_pm_domain s3c64xx_pm_f = {
.name = "F",
.ena = S3C64XX_NORMALCFG_DOMAIN_F_ON,
.pwr_stat = S3C64XX_BLKPWRSTAT_F,
.pd = {
.power_off = s3c64xx_pd_off,
.power_on = s3c64xx_pd_on,
},
};
static struct s3c64xx_pm_domain s3c64xx_pm_p = {
Annotation
- Immediate include surface: `linux/init.h`, `linux/suspend.h`, `linux/serial_core.h`, `linux/io.h`, `linux/gpio.h`, `linux/pm_domain.h`, `map.h`, `irqs.h`.
- Detected declarations: `struct s3c64xx_pm_domain`, `function s3c64xx_pd_off`, `function s3c64xx_pd_on`, `function s3c_pm_configure_extint`, `function s3c_pm_restore_core`, `function s3c_pm_save_core`, `function s3c64xx_cpu_suspend`, `function s3c64xx_pm_prepare`, `function s3c64xx_pm_init`, `function s3c64xx_pm_initcall`.
- 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.