arch/arm/mach-omap1/serial.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-omap1/serial.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-omap1/serial.c- Extension
.c- Size
- 5738 bytes
- Lines
- 247
- 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.
- 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/gpio/machine.hlinux/gpio/consumer.hlinux/module.hlinux/kernel.hlinux/init.hlinux/irq.hlinux/delay.hlinux/serial.hlinux/tty.hlinux/serial_8250.hlinux/serial_reg.hlinux/clk.hlinux/io.hasm/mach-types.hcommon.hserial.hmux.hpm.hsoc.h
Detected Declarations
function omap_serial_infunction omap_serial_outpfunction omap_serial_resetfunction omap_serial_initfunction omap_serial_wake_interruptfunction omap_serial_wake_triggerfunction omap_serial_set_port_wakeupfunction omap_serial_wakeup_initfunction omap_init
Annotated Snippet
if (!serial_platform_data[i].membase) {
printk(KERN_ERR "Could not ioremap uart%i\n", i);
continue;
}
switch (i) {
case 0:
uart1_ck = clk_get(NULL, "uart1_ck");
if (IS_ERR(uart1_ck))
printk("Could not get uart1_ck\n");
else {
clk_prepare_enable(uart1_ck);
if (cpu_is_omap15xx())
clk_set_rate(uart1_ck, 12000000);
}
break;
case 1:
uart2_ck = clk_get(NULL, "uart2_ck");
if (IS_ERR(uart2_ck))
printk("Could not get uart2_ck\n");
else {
clk_prepare_enable(uart2_ck);
if (cpu_is_omap15xx())
clk_set_rate(uart2_ck, 12000000);
else
clk_set_rate(uart2_ck, 48000000);
}
break;
case 2:
uart3_ck = clk_get(NULL, "uart3_ck");
if (IS_ERR(uart3_ck))
printk("Could not get uart3_ck\n");
else {
clk_prepare_enable(uart3_ck);
if (cpu_is_omap15xx())
clk_set_rate(uart3_ck, 12000000);
}
break;
}
omap_serial_reset(&serial_platform_data[i]);
}
}
#ifdef CONFIG_OMAP_SERIAL_WAKE
static irqreturn_t omap_serial_wake_interrupt(int irq, void *dev_id)
{
/* Need to do something with serial port right after wake-up? */
return IRQ_HANDLED;
}
/*
* Reroutes serial RX lines to GPIO lines for the duration of
* sleep to allow waking up the device from serial port even
* in deep sleep.
*/
void omap_serial_wake_trigger(int enable)
{
if (!cpu_is_omap16xx())
return;
if (uart1_ck != NULL) {
if (enable)
omap_cfg_reg(V14_16XX_GPIO37);
else
omap_cfg_reg(V14_16XX_UART1_RX);
}
if (uart2_ck != NULL) {
if (enable)
omap_cfg_reg(R9_16XX_GPIO18);
else
omap_cfg_reg(R9_16XX_UART2_RX);
}
if (uart3_ck != NULL) {
if (enable)
omap_cfg_reg(L14_16XX_GPIO49);
else
omap_cfg_reg(L14_16XX_UART3_RX);
}
}
static void __init omap_serial_set_port_wakeup(int idx)
{
struct gpio_desc *d;
int ret;
d = gpiod_get_index(NULL, "wakeup", idx, GPIOD_IN);
if (IS_ERR(d)) {
pr_err("Unable to get UART wakeup GPIO descriptor\n");
return;
}
Annotation
- Immediate include surface: `linux/gpio/machine.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/kernel.h`, `linux/init.h`, `linux/irq.h`, `linux/delay.h`, `linux/serial.h`.
- Detected declarations: `function omap_serial_in`, `function omap_serial_outp`, `function omap_serial_reset`, `function omap_serial_init`, `function omap_serial_wake_interrupt`, `function omap_serial_wake_trigger`, `function omap_serial_set_port_wakeup`, `function omap_serial_wakeup_init`, `function omap_init`.
- Atlas domain: Architecture Layer / arch/arm.
- Implementation status: source 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.