arch/powerpc/sysdev/cpm2.c
Source file repositories/reference/linux-study-clean/arch/powerpc/sysdev/cpm2.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/sysdev/cpm2.c- Extension
.c- Size
- 8331 bytes
- Lines
- 345
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/errno.hlinux/sched.hlinux/kernel.hlinux/param.hlinux/string.hlinux/mm.hlinux/interrupt.hlinux/module.hlinux/of.hasm/io.hasm/irq.hasm/page.hasm/cpm2.hasm/rheap.hsysdev/fsl_soc.h
Detected Declarations
struct cpm2_ioportsfunction cpm2_resetfunction cpm_commandfunction __cpm2_setbrgfunction cpm2_clk_setupfunction cpm2_smc_clk_setupfunction cpm2_set_pinexport cpm2_immrexport cpm_commandexport __cpm2_setbrg
Annotated Snippet
struct cpm2_ioports {
u32 dir, par, sor, odr, dat;
u32 res[3];
};
void __init cpm2_set_pin(int port, int pin, int flags)
{
struct cpm2_ioports __iomem *iop =
(struct cpm2_ioports __iomem *)&cpm2_immr->im_ioport;
pin = 1 << (31 - pin);
if (flags & CPM_PIN_OUTPUT)
setbits32(&iop[port].dir, pin);
else
clrbits32(&iop[port].dir, pin);
if (!(flags & CPM_PIN_GPIO))
setbits32(&iop[port].par, pin);
else
clrbits32(&iop[port].par, pin);
if (flags & CPM_PIN_SECONDARY)
setbits32(&iop[port].sor, pin);
else
clrbits32(&iop[port].sor, pin);
if (flags & CPM_PIN_OPENDRAIN)
setbits32(&iop[port].odr, pin);
else
clrbits32(&iop[port].odr, pin);
}
Annotation
- Immediate include surface: `linux/errno.h`, `linux/sched.h`, `linux/kernel.h`, `linux/param.h`, `linux/string.h`, `linux/mm.h`, `linux/interrupt.h`, `linux/module.h`.
- Detected declarations: `struct cpm2_ioports`, `function cpm2_reset`, `function cpm_command`, `function __cpm2_setbrg`, `function cpm2_clk_setup`, `function cpm2_smc_clk_setup`, `function cpm2_set_pin`, `export cpm2_immr`, `export cpm_command`, `export __cpm2_setbrg`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.