csb226.c

来自「优龙2410linux2.6.8内核源代码」· C语言 代码 · 共 143 行

C
143
字号
/* *  linux/arch/arm/mach-pxa/csb226.c * * (c) 2002, 2003 Robert Schwebel <r.schwebel@pengutronix.de>, Pengutronix * * 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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */#include <linux/kernel.h>#include <linux/init.h>#include <linux/device.h>#include <linux/major.h>#include <linux/fs.h>#include <linux/interrupt.h>#include <asm/setup.h>#include <asm/memory.h>#include <asm/mach-types.h>#include <asm/hardware.h>#include <asm/irq.h>#include <asm/mach/arch.h>#include <asm/mach/map.h>#include <asm/mach/irq.h>#include <asm/arch/irq.h>#include <asm/arch/irqs.h>#include <asm/arch/csb226.h>#include "generic.h"#if 0#include <linux/sched.h>#include <asm/types.h>#endifstatic void __init csb226_init_irq(void){	pxa_init_irq();}/* * Ressource entries for onboard devices */static struct resource cs8900_resources[] = {        [0] = {                .start  = CSB226_ETH_PHYS,                .end    = CSB226_ETH_PHYS + CSB226_ETH_SIZE - 1,                .flags  = IORESOURCE_MEM,        },        [1] = {                .start  = CSB226_ETH_IRQ,                .end    = CSB226_ETH_IRQ,                .flags  = IORESOURCE_IRQ,        },};static struct platform_device cs8900_device = {	.name		= "cs8900",	.id		= 0,	.num_resources	= ARRAY_SIZE(cs8900_resources),	.resource	= cs8900_resources,};static struct platform_device *devices[] __initdata = {	&cs8900_device,};static int __init csb226_init(void){	/* add device entries */	return platform_add_devices(devices, ARRAY_SIZE(devices));}__initcall(csb226_init);#if 0// obsolete in 2.6...? [RSC]static void __initfixup_csb226(struct machine_desc *desc, struct param_struct *params,		char **cmdline, struct meminfo *mi){	/* we probably want to get this information from the bootloader later */	SET_BANK (0, 0xa0000000, 64*1024*1024); 	mi->nr_banks      = 1;}#endif/* memory mapping */ static struct map_desc csb226_io_desc[] __initdata = {	/* virtual         physical         length           domain */	{ CSB226_ETH_VIRT, CSB226_ETH_PHYS, CSB226_ETH_SIZE, MT_DEVICE }, /* CS8900 LAN controller   */};static void __init csb226_map_io(void){	pxa_map_io();	iotable_init(csb226_io_desc, ARRAY_SIZE(csb226_io_desc));	/* This enables the BTUART */	CKEN |= CKEN7_BTUART;	pxa_gpio_mode(GPIO42_BTRXD_MD);	pxa_gpio_mode(GPIO43_BTTXD_MD);	pxa_gpio_mode(GPIO44_BTCTS_MD);	pxa_gpio_mode(GPIO45_BTRTS_MD);	/* This is for the CS8900 chip select */	pxa_gpio_mode(GPIO78_nCS_2_MD);	/* setup sleep mode values */	PWER  = 0x00000002;	PFER  = 0x00000000;	PRER  = 0x00000002;	PGSR0 = 0x00008000;	PGSR1 = 0x003F0202;	PGSR2 = 0x0001C000;	PCFR |= PCFR_OPDE;}MACHINE_START(CSB226, "Cogent CSB226 Development Platform")	MAINTAINER("Robert Schwebel, Pengutronix")	BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))	BOOT_PARAMS(0xa0000100)	MAPIO(csb226_map_io)	INITIRQ(csb226_init_irq)MACHINE_END

⌨️ 快捷键说明

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