android在2440上的移植Word文档下载推荐.docx
《android在2440上的移植Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《android在2440上的移植Word文档下载推荐.docx(18页珍藏版)》请在冰豆网上搜索。
.size=0x00200000,
[2]={
EmbedSky_Board_yaffs2"
.offset=0x00400000,
.size=0x0FB80000,
}
};
(4)、将交叉编译工具链的压缩文件EABI_4.3.3_Embedsky_20090807.tar.bz2文件解压
(5)、进入/opt/EmbedSky/4.3.4/文件夹
(6)、添加当前路径进入环境变量,如exportPATH=$PWD:
$PATH,或修改~/.bashrc文件并重新登录
(7)、进入内核文件夹,如cd
(8)、修改Makefile文件,如geditMakefile
更改ARCH和CROSS_COMPILE
ARCH?
=arm
CROSS_COMPILE?
=arm-linux-
(9)、使用makes3c2410_defconfig,默认配置2410内核
(10)、运行makemenuconfig
a、确保SystemType--->
ARMsystemtype()中的内容为SamsungS3C2410,S3C2412,S3C2413,S3C2440,S3C2442,S3C2443
b、
确保SystemType--->
S3C2410Machines--->
SMDK2410/A9M2410被勾选
c、
取消选择与Goldfish相关的内容
DeviceDrivers--->
Characterdevices--->
<
>
GoldfishTTYDriver
Powersupplyclasssupport--->
Goldfishbatterydriver(NEW)
RealTimeClock--->
GOLDFISH(NEW)
Graphicssupport--->
Supportforframebufferdevices--->
GoldfishFramebuffer
d、选择S3C2410LCD相关的内容
*>
S3C2410LCDframebuffersupport
Bootuplogo--->
StandardblackandwhiteLinuxlogo
Standard16-colorLinuxlogo
Standard224-colorLinuxlogo
e、选中Android内核必须选项
KernelFeatures--->
UsetheARMEABItocompilethekernel
Generalsetup--->
Usefullshmemfilesystem
EnableAndroid'
sSharedMemorySubsystem
SystemType--->
SupportThumbuserbinaries
Android--->
Androidlogdriver
BinderIPCDriver
f、
尽量选中Android内核可选选项
RAMbufferconsole
Androidtimedgpiodriver
Onlyallowcertaingroupstocreatesockets
g、
其余CONFIG选项,如系统支持请一并选择
CONFIG_ANDROID_POWER=y
CONFIG_ANDROID_POWER_STAT=y
CONFIG_ANDROID_POWER_ALARM=y
(可以在Kconfig文件中查找ANDROID_POWER等字段进行选择,或者直接修改.config文件)
(11)、退出并保存.config
有时软件安装错误会导致无法找到makefile;
在makemenuconfig时有时会因为各种库没安装而出现错误,我们要根据所提示的错误sudoapt-getinstall……来安装所缺库。
驱动部分移植:
只提供最基本的几个驱动移植方法,谨保证android可以跑起来。
键盘驱动、sd卡驱动等移植基本上大同小异,不懂的参考linux的驱动移植。
LCD驱动(EmbedSky)
1、参数配置
修改“drivers/video/s3c2410fb.c”文件,修改370行开始的函数,内容如下(红色部
分):
staticvoids3c2410fb_activate_var(structfb_info*info)
{
structs3c2410fb_info*fbi=info->
par;
void__iomem*regs=fbi->
io;
inttype=fbi->
regs.lcdcon1&
S3C2410_LCDCON1_TFT;
structfb_var_screeninfo*var=&
info->
var;
structs3c2410fb_mach_info*mach_info=fbi->
dev->
platform_data;
structs3c2410fb_display*default_display=mach_info->
displays+
mach_info->
default_display;
intclkdiv=s3c2410fb_calc_pixclk(fbi,var->
pixclock)/2;
dprintk("
%s:
var->
xres=%d\n"
__FUNCTION__,var->
xres);
yres=%d\n"
yres);
bpp=%d\n"
bits_per_pixel);
if(type==S3C2410_LCDCON1_TFT){
s3c2410fb_calculate_tft_lcd_regs(info,&
fbi->
regs);
--clkdiv;
if(clkdiv<
0)
clkdiv=0;
}else{
s3c2410fb_calculate_stn_lcd_regs(info,&
2)
clkdiv=2;
//fbi->
regs.lcdcon1|=S3C2410_LCDCON1_CLKVAL(clkdiv);
regs.lcdcon1|=S3C2410_LCDCON1_CLKVAL(default_display->
setclkval);
/*writenewregisters*/
2、完成了这部分修改之后,我们在s3c2410fb_display结构体中添加了一个setclkval的变量,那么我们需要在该结构体的原型中添加上该变量,修改“arch/arm/mach-s3c2410/include/mach/fb.h”文件,在40行添加如下
内容(红色部分所示):
/*LCDdescription*/
structs3c2410fb_display{
/*LCDtype*/
unsignedtype;
/*Screensize*/
unsignedshortwidth;
unsignedshortheight;
/*Screeninfo*/
unsignedshortxres;
unsignedshortyres;
unsignedshortbpp;
unsignedpixclock;
/*pixclockinpicoseconds*/
unsignedsetclkval;
/*clkval*/
unsignedshortleft_margin;
/*valueinpixels(TFT)orHCLKs(STN)*/
unsignedshortright_margin;
unsignedshorthsync_len;
unsignedshortupper_margin;
/*valueinlines(TFT)or0(STN)*/
unsignedshortlower_margin;
unsignedshortvsync_len;
/*lcdconfigurationregisters*/
unsignedlonglcdcon5;
3、修改LCD参数设置
然后我们修改LCD各个参数的配置,该配置参数在“arch/arm/mach-s3c2440/mach-smdk2440.c”文件中的由107行开始的结构体中,然后将其改为如下内容即可(红色部分就是修改的内容):
(注意:
添加上刚刚添加的那个变量setclkval的赋值)
/*LCDdriverinfo*/
staticstructs3c2410fb_displaysmdk2440_lcd_cfg__initdata={
.lcdcon5=S3C2410_LCDCON5_FRM565|
S3C2410_LCDCON5_INVVLINE|
S3C2410_LCDCON5_INVVFRAME|
S3C2410_LCDCON5_PWREN|
S3C2410_LCDCON5_HWSWP,
.type=S3C2410_LCDCON1_TFT,
.width=240,
.height=320,
.pixclock=166667,
.xres=240,
.yres=320,
.bpp=16,
.left_margin=20,
.right_margin=8,
.hsync_len=4,
.upper_margin=8,
.lower_margin=7,
.vsync_len=4,
staticstructs3c2410fb_mach_infosmdk2440_fb_info__initdata={
.displays=&
smdk2440_lcd_cfg,
.num_displays=1,
.default_display=0,
#if0
/*currentlysetupbydownloader*/
.gpccon=0xaa940659,
.gpccon_mask=0xffffffff,
.gpcup=0x0000ffff,
.gpcup_mask=0xffffffff,
.gpdcon=0xaa84aaa0,
.gpdcon_mask=0xffffffff,
.gpdup=0x0000faff,
.gpdup_mask=0xffffffff,
#endif
//.lpcsel=((0xCE6)&
~7)|1<
<
4,
4、然后修改“drivers/video/Kconfig”文件,把从1798到1819行的内容改成如下所示:
configFB_S3C24X0
tristate"
S3C24X0LCDframebuffersupport"
dependsonFB&
&
ARCH_S3C2410
selectFB_CFB_FILLRECT
selectFB_CFB_COPYAREA
selectFB_CFB_IMAGEBLIT
---help---
Framebufferdriverforthebuilt-inLCDcontrollerintheSamsung
S3C2410processor.
Thisdriverisalsoavailableasamodule(=codewhichcanbe
insertedandremovedfromtherunningkernelwheneveryouwant).The
modulewillbecalleds3c2410fb.Ifyouwanttocompileitasamodule,
sayMhereandread<
fileocumentation/kbuild/modules.txt>
.
Ifunsure,sayN.
choice
prompt"
LCDselect"
dependsonFB_S3C24X0
help
S3C24x0LCDsizeselect
configFB_S3C24X0_S320240
boolean"
3.5inch320x240SamsungLCD"
3.5inch320x240SamsumgLCD
configFB_S3C24X0_W320240
3.5inch320x240WanXinLCD"
3.5inch320x240WanXinLCD
configFB_S3C24X0_T240320
3.5inch240X320ToshibaLCD"
3.5inch240x320ToshibaLCD
configFB_S3C24X0_TFT480272
4.3inch480X272TFTLCD"
4.3inch480X272TFTLCD
configFB_S3C24X0_TFT640480
VGA640x480"
VGA640x480
configFB_S3C24X0_TFT800480
7inch800x480LCD"
7inch800x480LCD
configFB_S3C24X0_TFT800600
10.4inch800x600TFTLCD"
10.4inch800x480TFTLCD
Endchoice
configFB_S3C2410_DEBUG
bool"
S3C2410lcddebugmessages"
Turnondebuggingmessages.Notethatyoucanset/unsetatruntime
throughsysfs
5、然后修改“drivers/video/Makefile”文件,把109行的内容改成如下所示obj-$(CONFIG_FB_MAXINE)+=maxinefb.o
obj-$(CONFIG_FB_METRONOME)+=metronomefb.o
obj-$(CONFIG_FB_S1D13XXX)+=s1d13xxxfb.o
obj-$(CONFIG_FB_IMX)+=imxfb.o
obj-$(CONFIG_FB_S3C24X0)+=s3c2410fb.o
obj-$(CONFIG_FB_PNX4008_DUM)+=pnx4008/
obj-$(CONFIG_FB_PNX4008_DUM_RGB)+=pnx4008/
obj-$(CONFIG_FB_IBM_GXT4500)+=gxt4500.o
obj-$(CONFIG_FB_PS3)+=ps3fb.o
obj-$(CONFIG_FB_SM501)+=sm501fb.o
obj-$(CONFIG_FB_XILINX)+=xilinxfb.o
6、配置内核
做完以上的这些操作之后,我们就可以对LCD进行配置了,输入:
#makemenuconfig,进入配置单,然后进行如下配置:
Graphicssupport--->
EnablefirmwareEDID
EnableVideoModeHandlingHelpers
***Framebufferhardwaredrivers***
S3C24X0LCDframebuffersupport
LCDselect(3.5inch320x240WanXinLCD)--->
FramebufferConsolesupport
在“LCDselect(3.5inch320x240WanXinLCD)”这个选项这里选择LCD类型,下面就是进入该配置选项出现的对话框的情况,有“X”的是表示选中的:
(X)3.5inch320x240WanXinLCD
7、然后进入“Bootuplogo”选项的配置单,我们只需要选择是224色的就行了。
)
配置完毕后,编译出内核镜像,烧写到TQ2440开发板中,启动系统时,就可以看到开机
logo的画面,这就表明LCD驱动完成了。
触摸屏驱动(EmbedSky)
第一、添加触摸驱动补丁
1、在2.6.29.3的内核里面是没有针对S3C2440的触摸驱动的,这里我们对其打上触摸的驱动补丁,首先复制我们准备好的触摸驱动源码(名为:
EmbedSky_ts.c)到内核源码的“drivers/input/touchscreen/”目录下和触摸驱动的头文件(名为:
ts.h)到内核源码的“include/asm-arm/arch-s3c2410”目录下,添加“clock.h”文件到内核源码的“include/asm-arm/hardware/”目录下。
2、然后修改“drivers/input/touchscreen/”目录下面的“Kconfig”和“Makefile”文件,以支持对刚刚添加的文件的支持。
修改内核源码的“drivers/input/touchscreen/”目录下面的“Kconfig”文件,在文件的最后添加如下内容:
configTOUCHSCREEN_USB_GOTOP
defaulty
GoTopSuper_Q2/GogoPen/PenPowertabletdevicesupport"
ifEMBEDDED
dependsonTOUCHSCREEN_USB_COMPOSITE
configEmbedSky_TOUCHSCREEN
EmbedSkytouch