mach-smdk2410.c

来自「底层驱动开发」· C语言 代码 · 共 200 行

C
200
字号
/*********************************************************************** * * linux/arch/arm/mach-s3c2410/mach-smdk2410.c * * Copyright (C) 2004 by FS Forth-Systeme GmbH * All rights reserved. * * $Id: mach-smdk2410.c,v 1.1 2004/05/11 14:15:38 mpietrek Exp $ * @Author: Jonas Dietsche * * 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 * * @History: * derived from linux/arch/arm/mach-s3c2410/mach-bast.c, written by * Ben Dooks <ben@simtec.co.uk> * * 10-Mar-2005 LCVR  Changed S3C2410_VA to S3C24XX_VA * 20-Sep-2005 BJD  Added static to non-exported items * ***********************************************************************/#include <linux/kernel.h>#include <linux/types.h>#include <linux/interrupt.h>#include <linux/list.h>#include <linux/timer.h>#include <linux/init.h>#include <asm/mach/arch.h>#include <asm/mach/map.h>#include <asm/mach/irq.h>#include <asm/arch/ts.h>#include <asm/arch/fb.h>#include <asm/hardware.h>#include <asm/io.h>#include <asm/irq.h>#include <asm/mach-types.h>#include <asm/arch/regs-serial.h>#include "devs.h"#include "cpu.h"#define pSMDK2410_ETH_IO 0x19000000#define vSMDK2410_ETH_IO 0xE0000000static struct map_desc smdk2410_iodesc[] __initdata = {	{vSMDK2410_ETH_IO,pSMDK2410_ETH_IO,SZ_1M,MT_DEVICE}};#define UCON S3C2410_UCON_DEFAULT#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODEstatic struct s3c2410fb_mach_info s3c2410fb_lcdcfg __initdata = {	.regs = {		.lcdcon1 = S3C2410_LCDCON1_TFT16BPP | 			   S3C2410_LCDCON1_TFT | 			   S3C2410_LCDCON1_CLKVAL(5) | 			   (0<<7), 		.lcdcon2 = S3C2410_LCDCON2_VBPD(5) | 			   S3C2410_LCDCON2_LINEVAL(239) | 			   S3C2410_LCDCON2_VFPD(4) | 			   S3C2410_LCDCON2_VSPW(3),		.lcdcon3 = S3C2410_LCDCON3_HBPD(13) | 			   S3C2410_LCDCON3_HOZVAL(319) | 			   S3C2410_LCDCON3_HFPD(20),		.lcdcon4 = S3C2410_LCDCON4_MVAL(13) | 			   S3C2410_LCDCON4_HSPW(18),		.lcdcon5 = S3C2410_LCDCON5_FRM565 | 			   S3C2410_LCDCON5_INVVCLK | 			   S3C2410_LCDCON5_INVVLINE | 			   S3C2410_LCDCON5_INVVFRAME | 			   S3C2410_LCDCON5_HWSWP | 			   (0<<7) | 			   (0<<6) | 			   (0<<1),	},	.lpcsel = 0x0,	.gpccon = 0xaa9556a9,	.gpccon_mask = 0xfffffff,	.gpcup = 0xffffffff,	.gpcup_mask = 0xffffffff,	.gpdcon = 0xaaaaaaaa,	.gpdcon_mask = 0xfffffff,	.gpdup = 0xffffffff,	.gpdup_mask = 0xffffffff,	.fixed_syncs = 1,	.width  = 320,	.height = 240,	.xres = {		.min =  320,		.max =  320,		.defval = 320,	},	.yres = {		.max =  240,		.min =  240,		.defval = 240,	},	.bpp = {		.min =  16,		.max =  16,		.defval = 16,	},};static struct s3c2410_uartcfg smdk2410_uartcfgs[] = {	[0] = {		.hwport	     = 0,		.flags	     = 0,		.ucon	     = UCON,		.ulcon	     = ULCON,		.ufcon	     = UFCON,	},	[1] = {		.hwport	     = 1,		.flags	     = 0,		.ucon	     = UCON,		.ulcon	     = ULCON,		.ufcon	     = UFCON,	},	[2] = {		.hwport	     = 2,		.flags	     = 0,		.ucon	     = UCON,		.ulcon	     = ULCON,		.ufcon	     = UFCON,	}};static struct s3c2410_ts_mach_info s3c2410_ts_cfg __initdata = {	.delay = 10000,	.presc = 49,	.oversampling_shift = 2,};static struct platform_device *smdk2410_devices[] __initdata = {	&s3c_device_usb,	&s3c_device_lcd,	&s3c_device_wdt,	&s3c_device_i2c,	&s3c_device_iis,	&s3c_device_nand,	&s3c_device_ts,};static struct s3c24xx_board smdk2410_board __initdata = {	.devices       = smdk2410_devices,	.devices_count = ARRAY_SIZE(smdk2410_devices)};static void __init smdk2410_map_io(void){	s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc));	s3c24xx_init_clocks(0);	s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs));	s3c24xx_set_board(&smdk2410_board);	set_s3c2410ts_info(&s3c2410_ts_cfg);}static void __init smdk2410_init_irq(void){	s3c24xx_init_irq();}static void __init smdk2410_init(void){	set_s3c2410fb_info(&s3c2410fb_lcdcfg);}MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch				    * to SMDK2410 */	/* Maintainer: Jonas Dietsche */	.phys_ram	= S3C2410_SDRAM_PA,	.phys_io	= S3C2410_PA_UART,	.io_pg_offst	= (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,	.boot_params	= S3C2410_SDRAM_PA + 0x100,	.map_io		= smdk2410_map_io,	.init_irq	= smdk2410_init_irq,	.init_machine   = smdk2410_init,	.timer		= &s3c24xx_timer,MACHINE_END

⌨️ 快捷键说明

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