⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 devices.c

📁 omap3 linux 2.6 用nocc去除了冗余代码
💻 C
字号:
/* * linux/arch/arm/plat-omap/devices.c * * Common platform device setup/initialization for OMAP1 and OMAP2 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */#include <linux/module.h>#include <linux/kernel.h>#include <linux/init.h>#include <linux/platform_device.h>#include <asm/hardware.h>#include <asm/io.h>#include <asm/mach-types.h>#include <asm/mach/map.h>#include <asm/arch/tc.h>#include <asm/arch/board.h>#include <asm/arch/mux.h>#include <asm/arch/gpio.h>#include <asm/arch/menelaus.h>static inline void omap_init_dsp(void) { }/*-------------------------------------------------------------------------*/static inline void omap_init_kp(void) {}/*-------------------------------------------------------------------------*/static inline void omap_init_mmc(void) {}/*-------------------------------------------------------------------------*//* Numbering for the SPI-capable controllers when used for SPI: * spi		= 1 * uwire	= 2 * mmc1..2	= 3..4 * mcbsp1..3	= 5..7 */static inline void omap_init_uwire(void) {}/*-------------------------------------------------------------------------*/static inline void omap_init_rtc(void) {}/*-------------------------------------------------------------------------*/#define OMAP_WDT_BASE		0x48314000static struct resource wdt_resources[] = {	{		.start		= OMAP_WDT_BASE,		.end		= OMAP_WDT_BASE + 0x4f,		.flags		= IORESOURCE_MEM,	},};static struct platform_device omap_wdt_device = {	.name	   = "omap_wdt",	.id	     = 2,	.num_resources	= ARRAY_SIZE(wdt_resources),	.resource	= wdt_resources,};static void omap_init_wdt(void){	(void) platform_device_register(&omap_wdt_device);}/*-------------------------------------------------------------------------*/#define	OMAP_RNG_BASE		0x480A0000static struct resource rng_resources[] = {	{		.start		= OMAP_RNG_BASE,		.end		= OMAP_RNG_BASE + 0x4f,		.flags		= IORESOURCE_MEM,	},};static struct platform_device omap_rng_device = {	.name	   = "omap_rng",	.id	     = -1,	.num_resources	= ARRAY_SIZE(rng_resources),	.resource	= rng_resources,};static void omap_init_rng(void){	(void) platform_device_register(&omap_rng_device);}static struct platform_device omap_palkern_device = {	.name           = "omap_palkern",	.id             = -1,	.num_resources	= 0,	.resource	= NULL,};static void omap_init_palkern(void){	(void) platform_device_register(&omap_palkern_device);}/* * This gets called after board-specific INIT_MACHINE, and initializes most * on-chip peripherals accessible on this board (except for few like USB): * *  (a) Does any "standard config" pin muxing needed.  Board-specific *	code will have muxed GPIO pins and done "nonstandard" setup; *	that code could live in the boot loader. *  (b) Populating board-specific platform_data with the data drivers *	rely on to handle wiring variations. *  (c) Creating platform devices as meaningful on this board and *	with this kernel configuration. * * Claiming GPIOs, and setting their direction and initial values, is the * responsibility of the device drivers.  So is responding to probe(). * * Board-specific knowlege like creating devices or pin setup is to be * kept out of drivers as much as possible.  In particular, pin setup * may be handled by the boot loader, and drivers should expect it will * normally have been done by the time they're probed. */static int __init omap_init_devices(void){	/* please keep these calls, and their implementations above,	 * in alphabetical order so they're easier to sort through.	 */	omap_init_dsp();	omap_init_kp();	omap_init_mmc();	omap_init_uwire();	omap_init_wdt();	omap_init_rng();        omap_init_rtc();	omap_init_palkern();	return 0;}arch_initcall(omap_init_devices);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -