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.

Dependency Surface

Detected Declarations

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

Implementation Notes