Android4.4
A31-A31s
A31-A31s
Android4.4
A31-A31s Android4.4
A31-A31s
Android4.4 快速移
植指南
V1.5V1.5V1.5V1.5
2013-12-13
2013-12-13
2013-12-13
2013-12-13
Copyright © Allwinner Technology. All Rights Reserved.
- 1 -
CONFIDENTIAL
版本
V1.0
V1.1
V1.2
V1.3
时间
2013-5-13
2013-5-27
2013-6-6
2013-6-18
叶茂
叶茂
叶茂
叶茂
V1.4
2013-9-27
肖术骏
V1.5
2013-12-20
肖术骏
History
Revision
Revision
History
Revision History
History
Revision
修改人
备注
初始版本
补 1024x600dpi 设置
补 512M 方案配置参考
增加快拍配置
增加下拉菜单开关配置
增加快速开关机使能设置
增加 HDMI1080P 使能说明
增加 Miracast 功能配置说明
增加开机音乐功能说明
增加 A31S 512M DDR 方案编译说明
增加 Phablet 功能配置文档
更新 4K,快拍配置
更新 LCD 及 UI 方向配置
虚拟内存调整
增加多用户方案配置
增加 A31 1G retina 配置
增加 Nand/eMMC 自适应配置
删除原来的 HDMI1080P 使能配置
增加 A31(s)HDMI 输出模式设置
新增 boot1.0 与 boot2.0 sysconfig 差异配置
更新编译说明(boot1.0 和 boot2.0 差异)
新增 OTA 升级说明
删除原来的配置 recoveryUI 方向属性说明
增加预装 APK 的说明
增加 ION 预留内存配置
Copyright © Allwinner Technology. All Rights Reserved.
- 2 -
CONFIDENTIAL
目录
1. 文档说明.................................................................................................................................................... 5
2. 代码下载.................................................................................................................................................... 5
3. 方案配置准备.............................................................................................................................................5
3.1. lichee/linux-3.3................................................................................................................................. 5
3.2. lichee/tools........................................................................................................................................ 5
3.2.1. Boot1.0 与 Boot2.0................................................................................................................ 5
3.3. android/device/softwinner/fiber-xxx.................................................................................................7
4. 编译说明.................................................................................................................................................... 8
5. 方案的客制化.............................................................................................................................................9
5.1. LCD 种类说明..................................................................................................................................9
5.2. 开机 logo 替换.............................................................................................................................. 10
5.3. DPI 与 layout.................................................................................................................................. 10
5.3.1. LCD 的 DPI 计算................................................................................................................ 10
5.3.2. Android 标准案中的 DPI 选择........................................................................................... 11
5.3.3. 方案的 DPI 设置................................................................................................................ 11
5.4. LCD 及 UI 方向配置......................................................................................................................11
5.4.1. 配置系统 UI 方向属性.......................................................................................................11
5.4.2. 配置 camera 方向............................................................................................................... 12
5.5. 4K Player 的配置........................................................................................................................... 12
5.5.1. 配置说明.............................................................................................................................12
5.5.2. 配置文件修改范例.............................................................................................................14
5.6. 快拍 APK 配置..............................................................................................................................14
5.6.1. 配置文件修改范例.............................................................................................................15
5.7. 虚拟按键设置及截屏方法............................................................................................................16
5.8. 默认墙纸设置................................................................................................................................16
5.9. Launcher 桌面默认图标和快捷栏设置.........................................................................................16
5.10. 默认字体大小设置......................................................................................................................17
5.11. 默认 LCD 关闭时间设置............................................................................................................17
5.12. 下拉菜单 QuickSetting 中蓝牙和飞行模式开关.......................................................................17
5.13. 开机音乐......................................................................................................................................18
5.14. Miracast 功能打开和关闭............................................................................................................18
5.15. 快速开关机功能使能和关闭......................................................................................................18
5.16. Phablet 配置..................................................................................................................................18
5.17. 虚拟内存调整..............................................................................................................................18
5.18. Nand/eMMC 固件自适应............................................................................................................ 19
5.19. 多用户方案配置..........................................................................................................................19
5.19.1. 分区表...............................................................................................................................19
5.19.2. init.sun6i.rc.........................................................................................................................19
5.19.3. Vold.fstab........................................................................................................................... 20
5.19.4. storage_list.xml..................................................................................................................21
Copyright © Allwinner Technology. All Rights Reserved.
- 3 -
CONFIDENTIAL
5.19.5. fiber-xxx.mk.......................................................................................................................21
5.19.6. config.xml.......................................................................................................................... 22
5.20. A31 1G retina 方案配置...............................................................................................................22
5.20.1. 4K 配置..............................................................................................................................22
5.20.2. browser...............................................................................................................................23
5.20.3. 窗口动画和过渡动画.......................................................................................................23
5.20.4. 预装 APK..........................................................................................................................23
5.21. A31(s)HDMI 输出模式设置........................................................................................................ 24
5.21.1. 控制菜单是否显示...........................................................................................................24
5.21.2. HDMI 全屏显示................................................................................................................25
5.21.3. HDMI 默认输出模式........................................................................................................25
5.22. OTA 升级......................................................................................................................................25
5.23. 预装 APK.....................................................................................................................................25
5.24. ION 预留内存配置.......................................................................................................................26
6. Declaration.................................................................................................................................................28
Copyright © Allwinner Technology. All Rights Reserved.
- 4 -
CONFIDENTIAL
1.1.1.1. 文档说明
本文档为《A31_Android 内容定制说明文档 1.0.doc》和《A31s 移植说明文档.pdf》的补充文档,
这两个说明文档中所述内容在此文档中不再重复。
2.2.2.2. 代码下载
请参考 SDK 发布文档之下载说明。
注:Android4.2.2 开始 A31 和 A31s SDK 合并,请注意其之间差异。
3.3.3.3. 方案配置准备
方案实现涉及 2 个 repo 仓库以及 3 个主要工程,repo 仓库为 lichee 和 android,3 个工程主要涉
及 lichee/linux-3.3、lichee/tools、android/device/softwinner/fiber-xxx 三个目录。
3.1.3.1.3.1.3.1.lichee/linux-3.3
lichee/linux-3.3
lichee/linux-3.3
lichee/linux-3.3
Kernel 部分一般无须配置,但需要根据方案为新增器件增加驱动支持。一般涉及到新增模块为
TP、Camera 及各种 Sensor 等,其他模块较为固定。个别案涉及到新增 LCD 差异,目前的 LCD 驱
动基本可以支持绝大部分的 LCD 面板或芯片,个别案特殊对待即可。
3.2.3.2.3.2.3.2.lichee/tools
lichee/tools
lichee/tools
lichee/tools
拷 贝 一 份 通 用 配 置 如 pack/chips/sun6i/configs/android/fiber-a31st 到 新 的 方 案 配 置
pack/chips/sun6i/configs/android/fiber-xxx 作为方案脚本配置,根据方案原理图修改所有模块的使用状
态以及 GPIO 的配置。
Boot1.0
Boot2.0
3.2.1.
3.2.1.
Boot1.0
Boot2.0
Boot1.0 与 Boot2.0
3.2.1. Boot1.0
Boot2.0
3.2.1.
1111、使用 boot1.0(
boot1.0(
pack_v1.0
pack_v1.0 目录))))
boot1.0(
pack_v1.0
boot1.0(即表示使用 pack_v1.0
pack_v1.0
pack_v1.0
拷 贝 一 份 通 用 配 置 如 pack_v1.0
pack_v1.0/chips/sun6i/configs/android/fiber-a31st 到 新 的 方 案 配 置
pack/chips/sun6i/configs/android/fiber-xxx 作为方案脚本配置,根据方案原理图修改所有模块的使用状
态以及 GPIO 的配置。
boot2.0(
2222、使用 boot2.0(
pack_brandy
pack_brandy 目录))))
boot2.0(
pack_brandy
boot2.0(即表示使用 pack_brandy
Copyright © Allwinner Technology. All Rights Reserved.
- 5 -
CONFIDENTIAL
pack_brandy
pack_brandy
拷 贝 一 份 通 用 配 置 如 pack_brandy
pack_brandy/chips/sun6i/configs/android/fiber-a31st 到 新 的 方 案 配 置
pack/chips/sun6i/configs/android/fiber-xxx 作为方案脚本配置,根据方案原理图修改所有模块的使用状
态以及 GPIO 的配置。
boot2.0
boot1.0
3333、boot1.0
boot1.0
boot2.0
boot1.0、boot2.0
boot2.0 配置差别 (#号后为说明):
sys_config.fex
sys_config.fex
sys_config.fex
sys_config.fex 的差别:
boot2.0:
boot2.0:
boot2.0:
boot2.0:
[lcd0_para]
lcd_used
= 1
lcd_if
lcd_driver_name
lcd_x
lcd_y
lcd_width
= 6
= "b079xan01"
= 768
= 1024
= 0
Sys_patition.fex
Sys_patition.fex
Sys_patition.fex 的差别:(#号后为说明)
Sys_patition.fex
#该项属性必须要配置上,配置根据 LCD 屏使用的控制 IC
boot1.0
boot1.0
boot1.0:
boot1.0
;------------------------------>mmcblk0p7/nandd
[partition]
name
size
downloadfile = "system.fex"
user_type
= system
= 1572864
= 0x2
#该项属性必须是 0x02
Boot2.0:
Boot2.0:
Boot2.0:
Boot2.0:
;------------------------------>mmcblk0p7/nandd
[partition]
name
size
downloadfile = "system.fex"
user_type
= system
= 1572864
= 0x8000
#该项属性必须是 0x8000
udisk
user_type
sys_patition.fex
boot2.0
boot2.0
sys_patition.fex
user_type
udisk
user_type 除了 udisk
sys_patition.fex 中的 user_type
boot2.0 的 sys_patition.fex
udisk 分区不需要加,其它分区必须加 上
注意: boot2.0
user_type
user_type
user_type
user_type 属性
3.3.3.3.3.3.3.3.android/device/softwinner/fiber-xxx
android/device/softwinner/fiber-xxx
android/device/softwinner/fiber-xxx
android/device/softwinner/fiber-xxx
进入 android/device/softwinner 目录,SDK 提供 4 个标准参考案:
� fiber-a31st - A31s miniPad 参考案
� fiber-a31st - A31s 512M DDR 参考实现
� fiber-a31stm - A31s miniPad 多用户版本参考案
� fiber-w02 - A31 2048x1536 Retina 参考案
Copyright © Allwinner Technology. All Rights Reserved.
- 6 -
CONFIDENTIAL
生 成 一 个 新 的 方 案 请 从 其 他 方 案 配 置 拷 贝 一 份 到 新 的 方 案 配 置 , 如
android/device/softwinner/fiber-a31st 到 android/device/softwinner/fiber-xxx,然后进入 fiber-xxx 修改对
应的方案名及配置名。具体实施步骤示例如下(#号后为说明):
这样就生成了一个基本的方案配置文件。
# 复制一份基础配置
# 删除原有的.git,modules 目录及 kernel 文件
$ cd android/device/softwinner
$ cp -rf fiber-a31st fiber-xxx
$ cd fiber-xxx
$ rm -rf .git modules kernel
$ mv fiber-a31st.mk fiber-xxx.mk # 修改 makefile 文件名
# 创建本目录的 git 仓库
$ git init
$ git add * -f
# 添加当前目录的所有文件
$ find . -type f | xargs sed -i 's/A31ST/XXX/g' # 替换所有文件中的 A31ST 字符串
$ find . -type f | xargs sed -i 's/a31st/xxx/g' # 替换所有文件中的 a31st 字符串
$ git diff
$ git add -u
$ git commit -m "init version for project xxx" # 第一次提交,记录初始版本
# 通过 git 来查看替换字符串后的执行效果
# update 所有 tracked 的文件
4.4.4.4. 编译说明
编译流程没有差异,但 lichee 的编译参数用来区分 A31 和 A31s 的内核,其中,
注意: 如果没有更改过 bootbootbootboot 代码,则不需要重新编译 bootbootbootboot 代码。
编译 boot1.0 使用如下命令
# 进入到 lichee/boot-v1.0 目录、
#cd boot
#make
#cd ../u-boot
#make distclean && make sun6i_config && make -j8 (编译 uboot)
(编译 boot1)
编译 boot2.0 使用如下命令(前提:更改过代码)
# 进入到 lichee/brandy 目录、
#cd u-boot-2011.09
#make distclean && make sun6i_config && make -j8 (编译 uboot)
编译 A31 内核使用如下命令:
Copyright © Allwinner Technology. All Rights Reserved.
- 7 -
CONFIDENTIAL
# 进入到 lichee 目录、
#./build.sh -p sun6i_fiber
# ./build.sh -p sun6i_fiber -v boot_v1.0 (新增)(表示使用 boot1.0)
# ./build.sh -p sun6i_config -v boot_v2.0 (新增)(表示使用 boot2.0)
(默认使用 boot2.0)
编译 A31s 内核使用如下命令:
# 进入到 lichee 目录
# ./build.sh -p sun6i_fiber_a31s
# ./build.sh -p sun6i_fiber_a31s
# ./build.sh -p sun6i_fiber_a31s
(默认使用 boot2.0)
-v boot_v1.0 (新增)(表示使用 boot1.0)
-v boot_v2.0 (新增)(表示使用 boot2.0)
编译 A31s 512M DDR 方案使用如下命令:
# 进入到 lichee 目录
# ./build.sh -p sun6i_fiber_a31s512m
# ./build.sh -p sun6i_fiber_a31s512m -v boot_v1.0 (新增)(表示使用 boot1.0)
# ./build.sh -p sun6i_fiber_a31s512m -v boot_v2.0 (新增)(表示使用 boot2.0)
(默认使用 boot2.0)
注:同目录下切换 A31 和 A31s 内核编译之前请删除 lihcee/linux-3.3/.config
5.5.5.5. 方案的客制化
A31 和 A31s 根据 LCD 大小,横竖屏区别来实现不同的方案配置,以下一一进行说明。
5.1.5.1.5.1.5.1.LCDLCDLCDLCD 种类说明
在竖屏方案中,所选 LCD 的方向不同会引发一系列配置问题,因此在此特别对 LCD 种类做一
初步说明。LCD 根据行输出方向可分为物理横屏和物理竖屏两种,如:
� 物理横屏:width > height,如 1280x800,2048x1536 等
� 物理竖屏:width < height,如 768x1024,800x1280 等
以左上角为 LCD 零点来看,通常情况物理横屏和物理竖屏在竖屏方案上的安装表现如下(圆圈
为该 LCD 零点):
Copyright © Allwinner Technology. All Rights Reserved.
- 8 -
CONFIDENTIAL