arch/arm/mach-versatile/integrator_ap.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-versatile/integrator_ap.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-versatile/integrator_ap.c- Extension
.c- Size
- 4465 bytes
- Lines
- 201
- Domain
- Architecture Layer
- Bucket
- arch/arm
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/init.hlinux/syscore_ops.hlinux/amba/bus.hlinux/io.hlinux/irqchip.hlinux/of_irq.hlinux/of_address.hlinux/of_platform.hlinux/uaccess.hlinux/termios.hlinux/mfd/syscon.hlinux/regmap.hasm/mach/arch.hasm/mach/map.hintegrator-hardware.hintegrator-cm.hintegrator.h
Detected Declarations
function ap_map_iofunction irq_suspendfunction irq_resumefunction irq_syscore_initfunction integrator_uart_set_mctrlfunction ap_init_irq_offunction ap_init_ofmodule init irq_syscore_init
Annotated Snippet
device_initcall(irq_syscore_init);
/*
* For the PL010 found in the Integrator/AP some of the UART control is
* implemented in the system controller and accessed using a callback
* from the driver.
*/
static void integrator_uart_set_mctrl(struct amba_device *dev,
void __iomem *base, unsigned int mctrl)
{
unsigned int ctrls = 0, ctrlc = 0, rts_mask, dtr_mask;
u32 phybase = dev->res.start;
int ret;
if (phybase == INTEGRATOR_UART0_BASE) {
/* UART0 */
rts_mask = 1 << 4;
dtr_mask = 1 << 5;
} else {
/* UART1 */
rts_mask = 1 << 6;
dtr_mask = 1 << 7;
}
if (mctrl & TIOCM_RTS)
ctrlc |= rts_mask;
else
ctrls |= rts_mask;
if (mctrl & TIOCM_DTR)
ctrlc |= dtr_mask;
else
ctrls |= dtr_mask;
ret = regmap_write(ap_syscon_map,
INTEGRATOR_SC_CTRLS_OFFSET,
ctrls);
if (ret)
pr_err("MODEM: unable to write PL010 UART CTRLS\n");
ret = regmap_write(ap_syscon_map,
INTEGRATOR_SC_CTRLC_OFFSET,
ctrlc);
if (ret)
pr_err("MODEM: unable to write PL010 UART CRTLC\n");
}
struct amba_pl010_data ap_uart_data = {
.set_mctrl = integrator_uart_set_mctrl,
};
static void __init ap_init_irq_of(void)
{
cm_init();
irqchip_init();
}
/* For the Device Tree, add in the UART callbacks as AUXDATA */
static struct of_dev_auxdata ap_auxdata_lookup[] __initdata = {
OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_UART0_BASE,
"uart0", &ap_uart_data),
OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_UART1_BASE,
"uart1", &ap_uart_data),
{ /* sentinel */ },
};
static const struct of_device_id ap_syscon_match[] = {
{ .compatible = "arm,integrator-ap-syscon"},
{ },
};
static void __init ap_init_of(void)
{
struct device_node *syscon;
of_platform_default_populate(NULL, ap_auxdata_lookup, NULL);
syscon = of_find_matching_node(NULL, ap_syscon_match);
if (!syscon)
return;
ap_syscon_map = syscon_node_to_regmap(syscon);
if (IS_ERR(ap_syscon_map)) {
pr_crit("could not find Integrator/AP system controller\n");
return;
}
}
static const char * ap_dt_board_compat[] = {
"arm,integrator-ap",
NULL,
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/syscore_ops.h`, `linux/amba/bus.h`, `linux/io.h`, `linux/irqchip.h`, `linux/of_irq.h`, `linux/of_address.h`.
- Detected declarations: `function ap_map_io`, `function irq_suspend`, `function irq_resume`, `function irq_syscore_init`, `function integrator_uart_set_mctrl`, `function ap_init_irq_of`, `function ap_init_of`, `module init irq_syscore_init`.
- Atlas domain: Architecture Layer / arch/arm.
- Implementation status: integration 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.