arch/arm/mach-orion5x/common.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-orion5x/common.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-orion5x/common.c- Extension
.c- Size
- 10602 bytes
- Lines
- 379
- 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/io.hlinux/platform_device.hlinux/dma-mapping.hlinux/serial_8250.hlinux/mv643xx_i2c.hlinux/ata_platform.hlinux/delay.hlinux/clk-provider.hlinux/cpu.hasm/page.hasm/setup.hasm/system_misc.hasm/mach/arch.hasm/mach/map.hasm/mach/time.hlinux/platform_data/mtd-orion_nand.hlinux/platform_data/usb-ehci-orion.hplat/time.hplat/common.hbridge-regs.hcommon.horion5x.h
Detected Declarations
function orion5x_map_iofunction clk_initfunction orion5x_ehci0_initfunction orion5x_ehci1_initfunction orion5x_eth_initfunction orion5x_i2c_initfunction orion5x_sata_initfunction orion5x_spi_initfunction orion5x_uart0_initfunction orion5x_uart1_initfunction orion5x_xor_initfunction Acceleratorfunction orion5x_wdt_initfunction orion5x_init_earlyfunction orion5x_setup_winsfunction orion5x_find_tclkfunction orion5x_timer_initfunction orion5x_idfunction orion5x_initfunction orion5x_restartfunction tag_fixup_mem32
Annotated Snippet
if (*rev == MV88F5281_REV_D2) {
*dev_name = "MV88F5281-D2";
} else if (*rev == MV88F5281_REV_D1) {
*dev_name = "MV88F5281-D1";
} else if (*rev == MV88F5281_REV_D0) {
*dev_name = "MV88F5281-D0";
} else {
*dev_name = "MV88F5281-Rev-Unsupported";
}
} else if (*dev == MV88F5182_DEV_ID) {
if (*rev == MV88F5182_REV_A2) {
*dev_name = "MV88F5182-A2";
} else {
*dev_name = "MV88F5182-Rev-Unsupported";
}
} else if (*dev == MV88F5181_DEV_ID) {
if (*rev == MV88F5181_REV_B1) {
*dev_name = "MV88F5181-Rev-B1";
} else if (*rev == MV88F5181L_REV_A1) {
*dev_name = "MV88F5181L-Rev-A1";
} else {
*dev_name = "MV88F5181(L)-Rev-Unsupported";
}
} else if (*dev == MV88F6183_DEV_ID) {
if (*rev == MV88F6183_REV_B0) {
*dev_name = "MV88F6183-Rev-B0";
} else {
*dev_name = "MV88F6183-Rev-Unsupported";
}
} else {
*dev_name = "Device-Unknown";
}
}
void __init orion5x_init(void)
{
char *dev_name;
u32 dev, rev;
orion5x_id(&dev, &rev, &dev_name);
printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk);
/*
* Setup Orion address map
*/
orion5x_setup_wins();
/* Setup root of clk tree */
clk_init();
/*
* Don't issue "Wait for Interrupt" instruction if we are
* running on D0 5281 silicon.
*/
if (dev == MV88F5281_DEV_ID && rev == MV88F5281_REV_D0) {
printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n");
cpu_idle_poll_ctrl(true);
}
/*
* The 5082/5181l/5182/6082/6082l/6183 have crypto
* while 5180n/5181/5281 don't have crypto.
*/
if ((dev == MV88F5181_DEV_ID && rev >= MV88F5181L_REV_A0) ||
dev == MV88F5182_DEV_ID || dev == MV88F6183_DEV_ID)
orion5x_crypto_init();
/*
* Register watchdog driver
*/
orion5x_wdt_init();
}
void orion5x_restart(enum reboot_mode mode, const char *cmd)
{
/*
* Enable and issue soft reset
*/
orion5x_setbits(RSTOUTn_MASK, (1 << 2));
orion5x_setbits(CPU_SOFT_RESET, 1);
mdelay(200);
orion5x_clrbits(CPU_SOFT_RESET, 1);
}
/*
* Many orion-based systems have buggy bootloader implementations.
* This is a common fixup for bogus memory tags.
*/
void __init tag_fixup_mem32(struct tag *t, char **from)
{
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/io.h`, `linux/platform_device.h`, `linux/dma-mapping.h`, `linux/serial_8250.h`, `linux/mv643xx_i2c.h`, `linux/ata_platform.h`.
- Detected declarations: `function orion5x_map_io`, `function clk_init`, `function orion5x_ehci0_init`, `function orion5x_ehci1_init`, `function orion5x_eth_init`, `function orion5x_i2c_init`, `function orion5x_sata_init`, `function orion5x_spi_init`, `function orion5x_uart0_init`, `function orion5x_uart1_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.