以文本方式查看主題 - 曙海教育集團論壇 (http://www.xinguifushi.cn/bbs/index.asp) -- Android應用開發 (http://www.xinguifushi.cn/bbs/list.asp?boardid=45) ---- Android在TQ2440開發板上的移植 (http://www.xinguifushi.cn/bbs/dispbbs.asp?boardid=45&id=2038) |
-- 作者:wangxinxin -- 發布時間:2010-12-3 11:58:07 -- Android在TQ2440開發板上的移植 一、目前進展 1.Android已經可以通過NFS在TQ2440開發板上運行 二、目前缺陷 1.觸摸屏沒有校準 2.Android中時鐘停止,結束zygote進程,系統重啟,時鐘更新,但再次停止不動 三、移植步驟 1、移植Android內核到TQ2440開發板上 1、從http://code.google.com/p/android/downloads/list上下載linux-2.6.25-android-1.0_r1.tar.gz 2、將內核解壓到用戶目錄,如/root/kernel.git 3、進入kernel.git文件夾,如cd ~/kernel.git/ 4、修改arch/arm/plat-s3c24xx/common-smdk.c文件中的nand flash分區設置,如gedit arch/arm/plat-s3c24xx/common-smdk.c 修改static struct mtd_partition smdk_default_nand_part[]結構體為: static struct mtd_partition smdk_default_nand_part[] = { [0] = { .name = "TQ2440_uboot", .size = 0x00040000, .offset = 0x00000000, }, [1] = { .name = "TQ2440_kernel", .offset = 0x0004C000, .size = 0x00200000, }, [2] = { .name = "TQ2440_yaffs2", .offset = 0x0024C000, .size = 0x03DB0000, } }; 5、在http://www.codesourcery.com/gnu_toolchains/arm/portal/release644網站上下載IA32 GNU/Linux TAR。 6、將文件解壓到用戶目錄,如/usr/local/arm/arm-2008q3 7、進入arm-2008q3/bin文件夾,如cd ~/arm-2008q3/bin/ 8、添加當前路徑進入環境變量,如export PATH=$PWD ![]() 9、進入內核文件夾,如cd ~/kernel.git/ 10、修改Makefile文件,如gedit Makefile 更改ARCH和CROSS_COMPILE #ARCH ?= $(SUBARCH) ARCH ?= arm #CROSS_COMPILE ?= arm-eabi- CROSS_COMPILE ?= arm-none-gnueabi- 11、使用make s3c2410_defconfig,默認配置2410內核 12、運行make menuconfig (1) 確保System Type ---> ARM system type ()中的內容為Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443 (2) 確保System Type ---> S3C2410 Machines ---> SMDK2410/A9M2410被勾選 (3) 取消選擇與Goldfish相關的內容 Device Drivers ---> Character devices ---> < > Goldfish TTY Driver Device Drivers ---> Power supply class support ---> < > Goldfish battery driver (NEW) Device Drivers ---> Real Time Clock ---> < > GOLDFISH (NEW) Device Drivers ---> Graphics support ---> Support for frame buffer devices ---> < > Goldfish Framebuffer (4) 選擇S3C2410 LCD相關的內容 Device Drivers ---> Graphics support ---> Support for frame buffer devices ---> <*> S3C2410 LCD framebuffer support Device Drivers ---> Graphics support ---> Bootup logo ---> Standard black and white Linux logo Device Drivers ---> Graphics support ---> Bootup logo ---> Standard 16-color Linux logo Device Drivers ---> Graphics support ---> Bootup logo ---> Standard 224-color Linux logo (5) 選中Android內核必須選項 Kernel Features ---> Use the ARM EABI to compile the kernel General setup ---> Use full shmem filesystem General setup ---> Enable Android\'s Shared Memory Subsystem System Type ---> Support Thumb user binaries Device Drivers ---> Android ---> Android log driver Device Drivers ---> Android ---> <*> Binder IPC Driver (6) 盡量選中Android內核可選選項 Device Drivers ---> Android ---> RAM buffer console Device Drivers ---> Android ---> Android timed gpio driver Device Drivers ---> Android ---> Only allow certain groups to create sockets (7) 其余CONFIG選項,如系統支持請一并選擇 CONFIG_ANDROID_POWER =y CONFIG_ANDROID_POWER_STAT =y CONFIG_ANDROID_POWER_ALARM =y (可以在Kconfig文件中查找ANDROID_POWER等字段進行選擇,或者直接修改.config文件) 13、退出并保存.config 二、移植LCD驅動到Linux-2.6.25內核(驟二、三、四可以參照手冊,也可以參照我的其他文章) TQ2440的LCD移植可參照本人的另外的文章:http://tq2440.5d6d.com/thread-4-1-1.html 三、移植觸摸屏驅動到Linux-2.6.25內核 TQ2440的觸摸屏移植可參照本人的另外的文章:http://tq2440.5d6d.com/thread-5-1-1.html 將256行 ts.dev->evbit[0] = BIT(EV_SYN) | BIT(EV_KEY) | BIT(EV_ABS); ts.dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT(BTN_TOUCH); 改為: ts.dev->evbit[0] = BIT_MASK(EV_SYN) | BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); ts.dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); 四、移植網卡驅動到Linux-2.6.25內核 TQ2440的網卡移植可參照本人的另外的文章:http://tq2440.5d6d.com/thread-6-1-1.html 五、制作支持ARMv4的Android根文件系統 1、從http://www.namipan.com/d/403e5eb ... 140f0c9222be3858a02 下載Android的ARMv4版本根文件 2、在/dev下增加null和console兩個設備節點 mknod -m 660 null c 1 3 mknod -m 660 console c 5 1 3、在U-boot中修改啟動參數init為/init,完整的命令行如: a,開機按住空格鍵 b,選[0] Set the boot parameters c, [1] Set NFS boot parameter d,輸入192.168.1.3(這個是你的pc的ip,我的是這個),回車 e, 輸入192.168.1.6(這個是板子ip,默認是這個),回車,輸入255.255.255.0 f, 再選[3] Set parameter,這個很重要,輸入bootargs,回車,輸入console=ttySAC0 root=/dev/nfs init=/init nfsroot=192.168.1.3:/opt/EmbedSky/root_nfs ip=192.168.1.6:192.168.1.3:192.168.1.6:255.255.255.0:tq2440.5d6d.com:eth0 ![]() g,保存重啟 注:TQ2440自帶的內核文件似乎在nfs啟動上有問題,建議參照第五步驅動網卡;/opt/EmbedSky/root_nfs 這個是你的nfs目錄,設置成你自己的 4、修改/init.rc文件,去除除mount tmpfs tmpfs /sqlite_stmt_journals size=4m之外的所有mount命令 系統制作完成,現在應該可以看到漂亮的大表了。首次啟動需要創建文件,TQ2440啟動還是比較快的,大約2分鐘。然后每次啟動只需要1分鐘。 后記:至此,android能夠驅動了,由于文件系統太大,做成文件系統有70多兆,2440只有64m空間,因此只能用nfs方式。哪天有時間將文件系統精簡一下或許能到64m一下,以后再專門寫吧! |