当前位置: 首页 > 工具软件 > m2e-android > 使用案例 >

【iMX6Q-Android6.0】---移植 iMX6Q android6.0 源码 史上最详细

潘衡
2023-12-01

一、开发环境

开发环境:Ubuntu16
开发平台:iMX6Q Android6.0
安卓版本:android-6.0.1_r22
补丁版本:android_M6.0.1_2.1.0_source.tar.gz

二、准备工作

1、下载 android6.0源码

官方验证移植的是 android-6.0.1_r22 所以我们下载 android-6.0.1_r22

下载AOSP源码

三、移植kernel

1、进入 android6.0 源码根目录

cd ~/imx6q-android6.0

2、下载 kernel 源码

git clone https://source.codeaurora.org/external/imx/linux-imx kernel_imx

3、进入 kernel_imx

cd kernel_imx

4、切换 kernel 分支

git checkout m6.0.1_2.1.0-ga

切换分支会提示,不用理会即可!!!
切换分支会提示,不用理会即可!!!
切换分支会提示,不用理会即可!!!

Checking out files: 100% (50469/50469), done.
Note: checking out 'm6.0.1_2.1.0-ga'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 9f38c97... MLK-12946 media: pxp-v4l2: correct the 32 bpp pixel format passed to pxp

5、确认 kernel

最后一个节点应该是

commit 9f38c97e49235662dc45caa3213b0debea45d87b
Author: Fancy Fang <chen.fang@nxp.com>
Date:   Tue Jun 28 17:18:17 2016 +0800

    MLK-12946 media: pxp-v4l2: correct the 32 bpp pixel format passed to pxp

    The 32 bpp pixel format which is passed to pxp should be
    'PXP_PIX_FMT_RGB32' instead of 'PXP_PIX_FMT_RGB24', since
    only 'PXP_PIX_FMT_RGB32' can be recognized by lcdif.

    Signed-off-by: Fancy Fang <chen.fang@nxp.com>
    (cherry picked from commit c98efc59e1bc6d1814b2179f1b7e9f22cb177f47)

四、移植 u-boot

1、进入 bootable 目录

cd bootable

2、创建 bootloader

mkdir bootloader

3、进入 bootloader

cd bootloader

4、下载 u-boot 源码

git clone https://source.codeaurora.org/external/imx/uboot-imx uboot-imx

5、进入 uboot-imx

cd uboot-imx

6、切换 u-boot分支

git checkout m6.0.1_2.1.0-ga

切换分支会提示,不用理会即可!!!
切换分支会提示,不用理会即可!!!
切换分支会提示,不用理会即可!!!

Note: checking out 'm6.0.1_2.1.0-ga'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 6581aea... MLK-12884 mx7dsabresd: Fix LCD_PWR_EN output setting

7、确认 u-boot

最后一个节点应该是

commit 6581aea78198bf78c9ceb3308b96d87c9d8f61bb
Author: Ye Li <ye.li@nxp.com>
Date:   Mon Jun 6 11:41:30 2016 +0800

    MLK-12884 mx7dsabresd: Fix LCD_PWR_EN output setting

    LCD_PWR_EN controls the G pin of Q13 PMOS which needs low voltage to connect
    D to S for outputting LCD 3.3V. If LCD_PWR_EN is high, we measured the LCD 3v3
    is actually 1.2V.

    Signed-off-by: Ye Li <ye.li@nxp.com>
    (cherry picked from commit 28eb616b6c49de492cc0cdb3ad5b618bed77960f)

五、移植 iMX官方 补丁

1、下载 iMX官方 补丁

android_M6.0.1_2.1.0_source.tar.gz

NXP软件文档官网

2、准备补丁

将下载的 android_M6.0.1_2.1.0_source.tar.gz 拷贝到 和 android6.0源码同一个目录 然后解压

再进入 android6.0 源码根目录

3、打上补丁

source ../android_M6.0.1_2.1.0_source/code/M6.0.1_2.1.0/and_patch.sh
c_patch ../android_M6.0.1_2.1.0_source/code/M6.0.1_2.1.0/ imx_M6.0.1_2.1.0

六、成功打上补丁

Applying patch to frameworks/opt/telephony
*************************************************************
Success: Now you can build android code for FSL i.MX platform
*************************************************************
 类似资料: