arch/arm/mach-orion5x/mv2120-setup.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-orion5x/mv2120-setup.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-orion5x/mv2120-setup.c- Extension
.c- Size
- 6524 bytes
- Lines
- 257
- 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/gpio.hlinux/gpio/machine.hlinux/kernel.hlinux/init.hlinux/platform_device.hlinux/irq.hlinux/mtd/physmap.hlinux/mv643xx_eth.hlinux/leds.hlinux/gpio_keys.hlinux/input.hlinux/i2c.hlinux/ata_platform.hasm/mach-types.hasm/mach/arch.hcommon.hmpp.horion5x.h
Detected Declarations
function mv2120_power_offfunction mv2120_init
Annotated Snippet
#include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/irq.h>
#include <linux/mtd/physmap.h>
#include <linux/mv643xx_eth.h>
#include <linux/leds.h>
#include <linux/gpio_keys.h>
#include <linux/input.h>
#include <linux/i2c.h>
#include <linux/ata_platform.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include "common.h"
#include "mpp.h"
#include "orion5x.h"
#define MV2120_NOR_BOOT_BASE 0xf4000000
#define MV2120_NOR_BOOT_SIZE SZ_512K
#define MV2120_GPIO_RTC_IRQ 3
#define MV2120_GPIO_KEY_RESET 17
#define MV2120_GPIO_KEY_POWER 18
#define MV2120_GPIO_POWER_OFF 19
/*****************************************************************************
* Ethernet
****************************************************************************/
static struct mv643xx_eth_platform_data mv2120_eth_data = {
.phy_addr = MV643XX_ETH_PHY_ADDR(8),
};
static struct mv_sata_platform_data mv2120_sata_data = {
.n_ports = 2,
};
static struct mtd_partition mv2120_partitions[] = {
{
.name = "firmware",
.size = 0x00080000,
.offset = 0,
},
};
static struct physmap_flash_data mv2120_nor_flash_data = {
.width = 1,
.parts = mv2120_partitions,
.nr_parts = ARRAY_SIZE(mv2120_partitions)
};
static struct resource mv2120_nor_flash_resource = {
.flags = IORESOURCE_MEM,
.start = MV2120_NOR_BOOT_BASE,
.end = MV2120_NOR_BOOT_BASE + MV2120_NOR_BOOT_SIZE - 1,
};
static struct platform_device mv2120_nor_flash = {
.name = "physmap-flash",
.id = 0,
.dev = {
.platform_data = &mv2120_nor_flash_data,
},
.resource = &mv2120_nor_flash_resource,
.num_resources = 1,
};
static struct gpio_keys_button mv2120_buttons[] = {
{
.code = KEY_RESTART,
.gpio = MV2120_GPIO_KEY_RESET,
.desc = "reset",
.active_low = 1,
}, {
.code = KEY_POWER,
.gpio = MV2120_GPIO_KEY_POWER,
.desc = "power",
.active_low = 1,
},
};
static struct gpio_keys_platform_data mv2120_button_data = {
.buttons = mv2120_buttons,
.nbuttons = ARRAY_SIZE(mv2120_buttons),
};
static struct platform_device mv2120_button_device = {
.name = "gpio-keys",
Annotation
- Immediate include surface: `linux/gpio.h`, `linux/gpio/machine.h`, `linux/kernel.h`, `linux/init.h`, `linux/platform_device.h`, `linux/irq.h`, `linux/mtd/physmap.h`, `linux/mv643xx_eth.h`.
- Detected declarations: `function mv2120_power_off`, `function mv2120_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.