TQ2440移植android

来源:互联网 发布:mac如何连接蓝牙设备 编辑:程序博客网 时间:2024/05/01 07:32

在网上找了好多资料,不过关于TQ2440上移植Android的只有一份,全都是其他转载的:转载内容如下

[plain] view plaincopyprint?
  1. 1、移植Android内核到TQ2440开发板上 
  2. 1、从http://code.google.com/p/android/downloads/list上下载linux-2.6.25-android-1.0_r1.tar.gz 
  3. 2、将内核解压到用户目录,如/root/kernel.git 
  4. 3、进入kernel.git文件夹,如cd ~/kernel.git/ 
  5. 4、修改arch/arm/plat-s3c24xx/common-smdk.c文件中的nand flash分区设置,如gedit arch/arm/plat-s3c24xx/common-smdk.c 
  6. 修改static struct mtd_partition smdk_default_nand_part[]结构体为: 
  7. static struct mtd_partition smdk_default_nand_part[] = { 
  8.         [0] = { 
  9.                 .name        = "TQ2440_uboot", 
  10.                 .size        = 0x00040000, 
  11.                 .offset        = 0x00000000, 
  12.         }, 
  13.         [1] = { 
  14.                 .name        = "TQ2440_kernel", 
  15.                 .offset        = 0x0004C000, 
  16.                 .size        = 0x00200000, 
  17.         }, 
  18.         [2] = { 
  19.                 .name        = "TQ2440_yaffs2", 
  20.                 .offset        = 0x0024C000, 
  21.                 .size        = 0x03DB0000, 
  22.         } 
  23. }; 
  24. 5、在http://www.codesourcery.com/gnu_toolchains/arm/portal/release644网站上下载IA32 GNU/Linux TAR。 
  25. 6、将文件解压到用户目录,如/usr/local/arm/arm-2008q3 
  26. 7、进入arm-2008q3/bin文件夹,如cd ~/arm-2008q3/bin/ 
  27. 8、添加当前路径进入环境变量,如export PATH=$PWD:$PATH,或修改~/.bashrc文件并重新登录 
  28. 9、进入内核文件夹,如cd ~/kernel.git/ 
  29. 10、修改Makefile文件,如gedit Makefile 
  30. 更改ARCH和CROSS_COMPILE 
  31. #ARCH                ?= $(SUBARCH) 
  32. ARCH                ?= arm 
  33. #CROSS_COMPILE        ?= arm-eabi- 
  34. CROSS_COMPILE        ?= arm-none-gnueabi- 
  35. 11、使用make s3c2410_defconfig,默认配置2410内核 
  36. 12、运行make menuconfig 
  37. (1) 确保System Type ---> ARM system type ()中的内容为Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443 
  38. (2) 确保System Type ---> S3C2410 Machines --->  
  39. SMDK2410/A9M2410被勾选 
  40. (3) 取消选择与Goldfish相关的内容 
  41. Device Drivers ---> Character devices ---> < > Goldfish TTY Driver 
  42. Device Drivers ---> Power supply class support ---> < >   Goldfish battery driver (NEW) 
  43. Device Drivers ---> Real Time Clock ---> < >   GOLDFISH (NEW) 
  44. Device Drivers ---> Graphics support ---> Support for frame buffer devices ---> < >   Goldfish Framebuffer 
  45. (4) 选择S3C2410 LCD相关的内容 
  46. Device Drivers ---> Graphics support ---> Support for frame buffer devices ---> <*>   S3C2410 LCD framebuffer support 
  47. Device Drivers ---> Graphics support --->  
  48. Bootup logo --->  
  49.    Standard black and white Linux logo 
  50. Device Drivers ---> Graphics support --->  
  51. Bootup logo --->  
  52.    Standard 16-color Linux logo 
  53. Device Drivers ---> Graphics support --->  
  54. Bootup logo --->  
  55.    Standard 224-color Linux logo 
  56. (5) 选中Android内核必须选项 
  57. Kernel Features --->  
  58. Use the ARM EABI to compile the kernel 
  59. General setup --->  
  60. Use full shmem filesystem 
  61. General setup --->  
  62. Enable Android's Shared Memory Subsystem 
  63. System Type --->  
  64. Support Thumb user binaries 
  65. Device Drivers ---> Android --->  
  66. Android log driver 
  67. Device Drivers ---> Android ---> <*> Binder IPC Driver 
  68. (6) 尽量选中Android内核可选选项 
  69. Device Drivers ---> Android --->  
  70. RAM buffer console 
  71. Device Drivers ---> Android --->  
  72. Android timed gpio driver 
  73. Device Drivers ---> Android --->  
  74. Only allow certain groups to create sockets 


上面的我就不赘述了,下面是我遇到的问题:

首先根据TQ2440的参考手册

移植LCD驱动,不然没法显示啊,用的内核是2.6.25的和android的差不多,所以就按照这个修改了,这个问题倒不是很多。

移植DM9000E网卡驱动,这个移植过程中发现drivers/net/dm9000.c好像被修改过了,还有就是参考手册上面的,有个不知道具体位置,不过我就按照自己的思路来。

编译过程中,很多问题,都一个个的修改了,没有什么大的问题,就是不知道逻辑上有没有问题。

因为我要的是NFS挂载的,所以移植了网卡驱动,其他的我就不知道要先移植哪一个了,索性直接下载试试。

移植到板子上了,启动。。。

[plain] view plaincopyprint?
  1. Copy linux kernel from 0x00200000 to 0x30008000, size = 0x00300000 ... Copy Kernel to SDRAM done,NOW, Booting Linux...... 
  2. Uncompressing Linux..................................................................................................... done, booting the kernel. 
  3.  
  4. Error: unrecognized/unsupported machine ID (r1 = 0x000000a8). 
  5.  
  6. Available machine support: 
  7.  
  8. ID (hex)        NAME 
  9. 000000c1        SMDK2410 
  10.  
  11. Please check your kernel config and/or bootloader. 


瞧出错了,仔细网上查了下,是u-boot机器码和内核的机器码不同的原因。

两种解决方法

1修改内核机器码:arch/arm/tools/mach-types

379行的  362为内核机器码 修改为168

2修改u-boot机器码:u-boot-1.1.6/include/asm-arm/mach-types.h

377行的 168改为 362,

这里我修改了内核的,我感觉方便。

今天就到这里,至于上面的网卡驱动和LCD驱动,还没有验证。

原创粉丝点击