arch/powerpc/platforms/83xx/suspend.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/83xx/suspend.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/83xx/suspend.c- Extension
.c- Size
- 8847 bytes
- Lines
- 434
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pm.hlinux/types.hlinux/ioport.hlinux/interrupt.hlinux/wait.hlinux/sched/signal.hlinux/kthread.hlinux/freezer.hlinux/suspend.hlinux/fsl_devices.hlinux/of_address.hlinux/of_irq.hlinux/platform_device.hlinux/export.hasm/reg.hasm/io.hasm/time.hasm/mpc6xx.hasm/switch_to.hsysdev/fsl_soc.h
Detected Declarations
struct mpc83xx_pmcstruct mpc83xx_rcwstruct mpc83xx_clockstruct mpc83xx_syscrstruct mpc83xx_savedstruct pmc_typefunction fsl_deep_sleepfunction mpc83xx_change_statefunction pmc_irq_handlerfunction mpc83xx_suspend_restore_regsfunction mpc83xx_suspend_save_regsfunction mpc83xx_suspend_enterfunction mpc83xx_suspend_endfunction mpc83xx_suspend_validfunction mpc83xx_suspend_beginfunction agent_thread_fnfunction mpc83xx_set_agentfunction mpc83xx_is_pci_agentfunction pmc_probeexport fsl_deep_sleep
Annotated Snippet
struct mpc83xx_pmc {
u32 config;
#define PMCCR_DLPEN 2 /* DDR SDRAM low power enable */
#define PMCCR_SLPEN 1 /* System low power enable */
u32 event;
u32 mask;
/* All but PMCI are deep-sleep only */
#define PMCER_GPIO 0x100
#define PMCER_PCI 0x080
#define PMCER_USB 0x040
#define PMCER_ETSEC1 0x020
#define PMCER_ETSEC2 0x010
#define PMCER_TIMER 0x008
#define PMCER_INT1 0x004
#define PMCER_INT2 0x002
#define PMCER_PMCI 0x001
#define PMCER_ALL 0x1FF
/* deep-sleep only */
u32 config1;
#define PMCCR1_USE_STATE 0x80000000
#define PMCCR1_PME_EN 0x00000080
#define PMCCR1_ASSERT_PME 0x00000040
#define PMCCR1_POWER_OFF 0x00000020
/* deep-sleep only */
u32 config2;
};
struct mpc83xx_rcw {
u32 rcwlr;
u32 rcwhr;
};
struct mpc83xx_clock {
u32 spmr;
u32 occr;
u32 sccr;
};
struct mpc83xx_syscr {
__be32 sgprl;
__be32 sgprh;
__be32 spridr;
__be32 :32;
__be32 spcr;
__be32 sicrl;
__be32 sicrh;
};
struct mpc83xx_saved {
u32 sicrl;
u32 sicrh;
u32 sccr;
};
struct pmc_type {
int has_deep_sleep;
};
static int has_deep_sleep, deep_sleeping;
static int pmc_irq;
static struct mpc83xx_pmc __iomem *pmc_regs;
static struct mpc83xx_clock __iomem *clock_regs;
static struct mpc83xx_syscr __iomem *syscr_regs;
static struct mpc83xx_saved saved_regs;
static int is_pci_agent, wake_from_pci;
static phys_addr_t immrbase;
static int pci_pm_state;
static DECLARE_WAIT_QUEUE_HEAD(agent_wq);
int fsl_deep_sleep(void)
{
return deep_sleeping;
}
EXPORT_SYMBOL(fsl_deep_sleep);
static int mpc83xx_change_state(void)
{
u32 curr_state;
u32 reg_cfg1 = in_be32(&pmc_regs->config1);
if (is_pci_agent) {
pci_pm_state = (reg_cfg1 & PMCCR1_NEXT_STATE) >>
PMCCR1_NEXT_STATE_SHIFT;
curr_state = reg_cfg1 & PMCCR1_CURR_STATE;
if (curr_state != pci_pm_state) {
reg_cfg1 &= ~PMCCR1_CURR_STATE;
Annotation
- Immediate include surface: `linux/pm.h`, `linux/types.h`, `linux/ioport.h`, `linux/interrupt.h`, `linux/wait.h`, `linux/sched/signal.h`, `linux/kthread.h`, `linux/freezer.h`.
- Detected declarations: `struct mpc83xx_pmc`, `struct mpc83xx_rcw`, `struct mpc83xx_clock`, `struct mpc83xx_syscr`, `struct mpc83xx_saved`, `struct pmc_type`, `function fsl_deep_sleep`, `function mpc83xx_change_state`, `function pmc_irq_handler`, `function mpc83xx_suspend_restore_regs`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: integration 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.