您好,欢迎访问三七文档
当前位置:首页 > 办公文档 > 其它办公文档 > 基于s3c2410开发板的26265内核移植
1kernel:2.6.26.5gcc:arm-linux-gcc(gcc3.4.1)cpu:s3c24101.编译设置使用arm-linux-交叉编译工具链修改根目录下MakefileARCH?=armCROSS_COMPILE?=arm-linux-2.内核移植nand分区修改arch/arm/plat-s3c24xx/common-smdk.c,找到相关代码做如下修改staticstructmtd_partitionsmdk_default_nand_part[]={/*[0]={.name=BootAgent,.size=SZ_16K,.offset=0,},[1]={.name=S3C2410flashpartition1,.offset=0,.size=SZ_2M,},[2]={.name=S3C2410flashpartition2,.offset=SZ_4M,.size=SZ_4M,},[3]={.name=S3C2410flashpartition3,.offset=SZ_8M,.size=SZ_2M,},[4]={.name=S3C2410flashpartition4,.offset=SZ_1M*10,.size=SZ_4M,},[5]={2.name=S3C2410flashpartition5,.offset=SZ_1M*14,.size=SZ_1M*10,},[6]={.name=S3C2410flashpartition6,.offset=SZ_1M*24,.size=SZ_1M*24,},[7]={.name=S3C2410flashpartition7,.offset=SZ_1M*48,.size=SZ_16M,}*//*start:forharbour*/[0]={name:bootloader,size:0x00100000,offset:0x0,},[1]={name:kernel,size:0x00300000,offset:0x00100000,},[2]={name:root,size:0x02800000,offset:0x00400000,},[3]={name:user,size:0x00f00000,offset:0x02d00000,}};/*end:forharbour*/staticstructs3c2410_nand_setsmdk_nand_sets[]={[0]={.name=NAND,.nr_chips=1,.nr_partitions=ARRAY_SIZE(smdk_default_nand_part),.partitions=smdk_default_nand_part,3},};staticstructs3c2410_platform_nandsmdk_nand_info={.tacls=0,.twrph0=30,.twrph1=0,.nr_sets=ARRAY_SIZE(smdk_nand_sets),.sets=smdk_nand_sets,};此时如果运行#makes3c2410_defconfig启用s3c2410默认内核配置#makemenuconfig修改bootoptiondefaultcommandlineroot=/dev/mtdblock2init=linuxrcconsole=ttySAC0,115200运行#makebzImage此时的内核就可在板上跑通了。触摸屏驱动移植在arch/arm/mach-s3c2410/mach-smdk2410.c中添加asm/arch/ts.h和asm/arch/fb.h修改arch/arm/mach-s3c2410/mach-smdk2410.c,添加staticstructs3c2410ts_mach_infos3c2410_tscfg__initdata={.delay=10000,.presc=49,.oversampling_shift=2,};修改staticstructplatform_device*smdk2410_devices[]__initdata={&s3c_device_usb,&s3c_device_lcd,&s3c_device_wdt,&s3c_device_i2c,&s3c_device_iis,/*start:forharbour*/&s3c_device_ts,//加入此行/*end:forharbour*/};在staticvoid__initsmdk2410_init(void)中加入:s3c24xx_ts_set_platdata(&s3c2410_tscfg);在include/asm-arm/plat-s3c24xx/devs.h中加入externstructplatform_devices3c_device_ts;在driver/input/touchscreen/下添加s3c2410-ts.c文件,4在include/asm-arm/arch-s3c2410/下添加ts.h文件,ts.h文件内容如下:#ifndef__ASM_ARM_S3C2410_TS_H#define__ASM_ARM_S3C2410_TS_Hstructs3c2410ts_mach_info{intdelay;intpresc;intoversampling_shift;};externvoid__inits3c24xx_ts_set_platdata(structs3c2410ts_mach_info*);#endif/*__ASM_ARM_S3C2410_TS_H*/修改arch/arm/plat-s3c24xx/devs.c,加入#includeasm/arch/ts.h/*TouchScreenController*/structplatform_devices3c_device_ts={.name=s3c2410-ts,.id=-1,};EXPORT_SYMBOL(s3c_device_ts);void__inits3c24xx_ts_set_platdata(structs3c2410ts_mach_info*pd){structs3c2410ts_mach_info*npd;npd=kmalloc(sizeof(*npd),GFP_KERNEL);if(npd){memcpy(npd,pd,sizeof(*npd));s3c_device_ts.dev.platform_data=npd;}else{printk(KERN_ERRnomemoryforTSplatformdata\n);}}将s3c2410-ts.c文件拷入drivers/input/touchscreen/目录下。修改drivers/input/touchscreen/Makefile加入obj-$(CONFIG_TOUCHSCREEN_S3C2410)+=s3c2410-ts.o修改drivers/input/touchscreen/Kconfig,在ifINPUT_TOUCHSCREEN下加入configTOUCHSCREEN_S3C2410tristate“s3c2410touchscreen”dependsonARCH_SMDK2410defaultyhelpThisisusedforsupportings3c2410touchscreen.LCD驱动移植5修改arch/arm/mach-s3c2410/mach-smdk2410.c,添加staticstructs3c2410fb_displays3c2410fb_lcd_display__initdata={.width=320,.height=240,.xres=320,.yres=240,.bpp=16,.lcdcon5=S3C2410_LCDCON5_FRM565|S3C2410_LCDCON5_INVVCLK|S3C2410_LCDCON5_INVVLINE|S3C2410_LCDCON5_INVVFRAME|S3C2410_LCDCON5_HWSWP|(07)|(06)|(01),.type=S3C2410_LCDCON1_TFT,.pixclock=270000,.left_margin=7,.right_margin=8,.hsync_len=29,.upper_margin=11,.lower_margin=14,.vsync_len=2,};staticstructs3c2410fb_mach_infos3c2410fb_lcdcfg__initdata={.displays=&s3c2410fb_lcd_display,.num_displays=1,.default_display=0,.lpcsel=0x0,.gpccon=0xaa9556a9,.gpccon_mask=0xfffffff,.gpcup=0xffffffff,.gpcup_mask=0xffffffff,.gpdcon=0xaaaaaaaa,.gpdcon_mask=0xfffffff,.gpdup=0xffffffff,.gpdup_mask=0xffffffff,};在staticvoid__initsmdk2410_init(void)中加入:s3c24xx_fb_set_platdata(&s3c2410fb_lcdcfg);用提供的s3c2410fb.c替换drivers/video/s3c2410fb.c.声卡驱动移植6将s3c2410sound.c加到目录/sound/oss下;修改sound/oss下的Kconfig文件:在文件中添加:ConfigS3C2410_SOUND_OSSTristate“S3C24101341sounddriver”修改/linux-2.6.14/sound/oss下的Makefile文件:在文件中添加一行:Obj-$(CONFIG_S3C2410_SOUND_OSS)+=s3c2410sound.o网卡(DM9000)驱动移植修改arch/arm/mach-s3c2410/mach-smdk2410.c,找到如下代码修改:#definepSMDK2410_ETH_IO(__phys_to_pfn(0x18000000))staticstructmap_descsmdk2410_iodesc[]__initdata={/*start:forharbour*/{vSMDK2410_ETH_IO,pSMDK2410_ETH_IO,SZ_1M,MT_DEVICE},/*end:forharbour*/};在如下结构体中添加:staticstructplatform_device*smdk2410_devices[]__initdata={&s3c_device_dm9000,};修改arch/arm/plat-s3c24xx/devs.c中添加:#includelinux/dm9000.h#defineDM9000A_BASE0x18000300#defineDM9000A_OFFSET10x03#defineDM9000A_OFFSET20x04staticstructresources3c_dm9000_resource[]={[0]={.start=DM9000A_BASE,//0x19000000+0x300,.end=DM9000A_BASE+DM9000A_OFFSET1,//0x19000000+0x300+0x03,.flags=IORESOURCE_MEM},[1]={.start=DM9000A_BASE+DM9000A_OFFSET2,//0x19000000+0x300+0x04,.end=DM9000A_BASE+DM9000A_OFFSET2+DM9000A_OFFSET1,//oldis7f0x3f.flags=IORESOUR
本文标题:基于s3c2410开发板的26265内核移植
链接地址:https://www.777doc.com/doc-2571976 .html