arch/arm/plat-orion/common.c
Source file repositories/reference/linux-study-clean/arch/arm/plat-orion/common.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/plat-orion/common.c- Extension
.c- Size
- 22892 bytes
- Lines
- 827
- 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/kernel.hlinux/init.hlinux/platform_device.hlinux/dma-mapping.hlinux/serial_8250.hlinux/ata_platform.hlinux/clk.hlinux/clkdev.hlinux/mv643xx_eth.hlinux/mv643xx_i2c.hlinux/platform_data/dma-mv_xor.hlinux/platform_data/usb-ehci-orion.hplat/common.hlinux/phy.h
Detected Declarations
function orion_clkdev_addfunction orion_clkdev_initfunction fill_resourcesfunction fill_resources_irqfunction uart_get_clk_ratefunction uart_completefunction orion_uart0_initfunction orion_uart1_initfunction orion_uart2_initfunction orion_uart3_initfunction orion_rtc_initfunction ge_completefunction orion_ge00_initfunction orion_ge01_initfunction orion_ge10_initfunction orion_ge11_initfunction orion_i2c_initfunction orion_i2c_1_initfunction orion_spi_initfunction orion_spi_1_initfunction orion_xor0_initfunction orion_xor1_initfunction orion_ehci_initfunction orion_ehci_1_initfunction orion_ehci_2_initfunction orion_sata_initfunction orion_crypto_init
Annotated Snippet
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <linux/serial_8250.h>
#include <linux/ata_platform.h>
#include <linux/clk.h>
#include <linux/clkdev.h>
#include <linux/mv643xx_eth.h>
#include <linux/mv643xx_i2c.h>
#include <linux/platform_data/dma-mv_xor.h>
#include <linux/platform_data/usb-ehci-orion.h>
#include <plat/common.h>
#include <linux/phy.h>
/* Create a clkdev entry for a given device/clk */
void __init orion_clkdev_add(const char *con_id, const char *dev_id,
struct clk *clk)
{
clkdev_create(clk, con_id, "%s", dev_id);
}
/* Create clkdev entries for all orion platforms except kirkwood.
Kirkwood has gated clocks for some of its peripherals, so creates
its own clkdev entries. For all the other orion devices, create
clkdev entries to the tclk. */
void __init orion_clkdev_init(struct clk *tclk)
{
orion_clkdev_add(NULL, "orion_spi.0", tclk);
orion_clkdev_add(NULL, "orion_spi.1", tclk);
orion_clkdev_add(NULL, MV643XX_ETH_NAME ".0", tclk);
orion_clkdev_add(NULL, MV643XX_ETH_NAME ".1", tclk);
orion_clkdev_add(NULL, MV643XX_ETH_NAME ".2", tclk);
orion_clkdev_add(NULL, MV643XX_ETH_NAME ".3", tclk);
orion_clkdev_add(NULL, "orion_wdt", tclk);
orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".0", tclk);
}
/* Fill in the resources structure and link it into the platform
device structure. There is always a memory region, and nearly
always an interrupt.*/
static void fill_resources(struct platform_device *device,
struct resource *resources,
resource_size_t mapbase,
resource_size_t size)
{
device->resource = resources;
device->num_resources = 1;
resources[0].flags = IORESOURCE_MEM;
resources[0].start = mapbase;
resources[0].end = mapbase + size;
}
static void fill_resources_irq(struct platform_device *device,
struct resource *resources,
resource_size_t mapbase,
resource_size_t size,
unsigned int irq)
{
fill_resources(device, resources, mapbase, size);
device->num_resources++;
resources[1].flags = IORESOURCE_IRQ;
resources[1].start = irq;
resources[1].end = irq;
}
/*****************************************************************************
* UART
****************************************************************************/
static unsigned long __init uart_get_clk_rate(struct clk *clk)
{
clk_prepare_enable(clk);
return clk_get_rate(clk);
}
static void __init uart_complete(
struct platform_device *orion_uart,
struct plat_serial8250_port *data,
struct resource *resources,
void __iomem *membase,
resource_size_t mapbase,
unsigned int irq,
struct clk *clk)
{
data->mapbase = mapbase;
data->membase = membase;
data->irq = irq;
data->uartclk = uart_get_clk_rate(clk);
orion_uart->dev.platform_data = data;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/platform_device.h`, `linux/dma-mapping.h`, `linux/serial_8250.h`, `linux/ata_platform.h`, `linux/clk.h`, `linux/clkdev.h`.
- Detected declarations: `function orion_clkdev_add`, `function orion_clkdev_init`, `function fill_resources`, `function fill_resources_irq`, `function uart_get_clk_rate`, `function uart_complete`, `function orion_uart0_init`, `function orion_uart1_init`, `function orion_uart2_init`, `function orion_uart3_init`.
- 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.