We can now get some quad core Android mini PCs (e.g. Hi802, GK802) featuring Freescale i.MX6Q processor, Freescale has released full documentation and source code its development platforms, Hi802 / GK802 HDMI TV dongles are easily hackable, and there’s even an Ubuntu image for the devices. So it looks pretty good ,right? Well almost.. there are some patches and config for GK802 that have not been released by Richtechie, so we can’t modify the bootloader and Linux kernel. But this may change, as ARMTvTech forum user hste noticed some Freescale i.MX6 HDMI dongle patches om IMX Community website. Even though I’m not sure those are fully compatible with Hi802 / GK802, this could be a starting point. Today, I’ll provide the instructions to build u-boot, the linux kernel and Android ICS with those patches in a machine running Linux 12.04 64-bit. Patch Sets DescriptionsThere are two set of patches that can be applied to R13.4-GA release:
A script (revb_dongle_patch_install.sh) is provided to apply 20121115 patches. Getting Freescale i.MX6 U-boot, Linux kernel and Android source code (R13.4-GA)Since those patches need to be applied against R13.4-GA, so we need to get the code first. The instructions are explained in section 5 “Get Android Source Code (Android/Kernel/U-Boot)” of R13.4-GA.01_Android_User_Guide.pdf. First download IMX6_R13.4_ANDROID_SOURCE_CODE (171 MB). After download, you should get a file named imx-android-r13.4-ga.01.tar.gz that includes the documentation, patches, and Mfgtool for Android 4.0.4. Let’s extract it, extract the (default) patches: mkdir -p ~/edev/Freescale tar xzvf imx-android-r13.4-ga.01.tar.gz cd imx-android-r13.4-ga/code tar xzvf r13.4-ga.tar.gz If you don’t have it the repo tool yet download it, and add it to your path: curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo chmod 755 ~/bin/repo export PATH=$PATH:~/bin Now let’s create a working directory (myandroid) and get Android 4.0.4 r1.1 AOSP source code: cd ~/edev/Freescale/imx-android-r13.4-ga mkdir myandroid cd myandroid repo init -u https://android./platform/manifest -b android-4.0.4_r1.1 This will take a little while, after or while it’s progressing you can (also) get imx kernel and U-boot source code: git clone git://git./imx/linux-2.6-imx.git kernel_imx cd kernel_imx git checkout imx-android-r13.4-ga cd ../bootable/ mkdir bootloader cd bootloader git clone git://git./imx/uboot-imx.git uboot-imx cd uboot-imx git checkout imx-android-r13.4-ga cd ../.. When checking out imx-android-r13.4 branch for the kernel and U-boot, you’ll get messages like: It just shows the latest commit, so there’s no issue here. After repo sync is complete, you’ll also need to get some more code: cd external git clone git://android.git.linaro.org/platform/external/alsa-lib.git git clone git://android.git.linaro.org/platform/external/alsa-utils.git cd ../hardware git clone git://android.git.linaro.org/platform/hardware/alsa_sound.git cd .. Now patch all those with R13.4-GA patches: source ../code/r13.4-ga/and_patch.sh c_patch ../code/r13.4-ga imx_r13.4-ga After a lot of debug output (and warnings), you should see the following message to indicate patching was successful: We’re done for this part we now have all source for R13.4-GA release. Patching R13.4-GA with HDMI dongle patchesWe can now patch the code to add HDMI dongle support. I’ll assume you’ve downloaded all 3 files describe at the top of this post to ~/edev/Freescale/imx-android-r13.4-ga directory: chmod a+x revb_dongle_patch_install.sh tar xzvf hdmidongle_REVB_R13.4_patch-20121115.tgz cd hdmidongle_REVB_R13.4_patch ../revb_dongle_patch_install.sh ~/edev/Freescale/imx-android-r13.4-ga/myandroid cd .. tar xzvf hdmidongle_REVB_R13.4_patch-20130131.tgz cd ../myandroid git apply ../hdmidongle_REVB_R13.4_patch-20130131/0001-uboot_fastboot.patch --verbose git apply ../hdmidongle_REVB_R13.4_patch-20130131/0002-LDOBYPASS.patch --verbose git apply ../hdmidongle_REVB_R13.4_patch-20130131/0003-WifiDirect.patch --verbose git apply ../hdmidongle_REVB_R13.4_patch-20130131/0004-ntfs_support.patch --verbose git apply ../hdmidongle_REVB_R13.4_patch-20130131/0005-BT_enable.patch --verbose git apply ../hdmidongle_REVB_R13.4_patch-20130131/0006-1G_boot_stable.patch --verbose git apply ../hdmidongle_REVB_R13.4_patch-20130131/0007-battery_always_full.patch --verbose git apply ../hdmidongle_REVB_R13.4_patch-20130131/0009-uboot-enable-mmu-fix.patch --verbose git apply ../hdmidongle_REVB_R13.4_patch-20130131/0010-boot_disable_screenlocker.patch --verbose git apply ../hdmidongle_REVB_R13.4_patch-20130131/0011-wm8326-DC_CONTROL_RATE.patch --verbose git apply ../hdmidongle_REVB_R13.4_patch-20130131/0012-Added-default-video-mode-check-make-sur.patch --verbose rm -rf kernel_imx/drivers/net/wireless/rtl8192ce tar xzvf ../hdmidongle_REVB_R13.4_patch-20130131/rtl8192ce_v4.0.0_6239.20121226_TPIOT1.tgz tar xzvf ../hdmidongle_REVB_R13.4_patch-20130131/ntfs-3g.tar.gz -C external For the second set of patches, you’ll noticed patches 0001 to 0012 have been applied, except 0008 since it’s not needed anymore. One more step completed. Have a tea break, or drink a beer, since there’s still a bit more work to do. Building U-Boot, the kernel and Android for Freescale i.MX6 HDMI TV DonglesI’m probably missing some per-requisites in this part, and most required dependencies were already installed in my PC. You may want to have a look at the post “How to compile Android on Ubuntu 12.04“, and in particular the part about install Sun Java 6 JDK, where you need to download Sun Java 6 JDK, install it, and run update-alternatives: chmod +x jdk-6u38-linux-x64.bin sudo ./jdk-6u38-linux-x64.bin sudo mv jdk1.6.0_38 /usr/lib/jvm/ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_38/bin/java 1 sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_38/bin/javac 1 sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_38/bin/javaws 1 sudo update-alternatives --config java sudo update-alternatives --config javac sudo update-alternatives --config javaws Now we should be ready to build: source build/envsetup.sh lunch We can select either hdmidongle_6dq-eng or hdmidongle_6dq-user for the build. The “eng(ineering)” build is a debug build, and the “user” build is a release version. I’ve gone with hdmidongle_6dq-user (15) to try it out. In theory, we now just need to run make: make -j8 However “in theory, there is no difference between theory and practice; In practice, there is”, and I’ve come across a few issues during the build, and if you build in Ubuntu 12.04 64-bit, you may want to perform the following steps before running make. Some directories are duplicates in the source tree, and the build ends with error such as:
I fixed it by deleting one of the duplicate in the source: rm -rf bootable/bootloader/uboot-imx/mtd-utils rm -rf external/mtd-utils/mtd-utils/ rm -rf bootable/bootloader/uboot-imx/wpa_supplicant_8_rtl/ rm -rf external/wpa_supplicant_8_rtl/wpa_supplicant_8_rtl/ rm bootable/bootloader/uboot-imx/realtek/wlan/ -rf rm -rf hardware/realtek/realtek/ I found some dependencies missing, so you may have to install: sudo apt-get install uuid-dev liblzo2-dev lib32ncurses5-dev uuid:i386 liblzo2-2:i386 But the build still failed, so here’s an ugly hack: pushd /usr/lib sudo ln -s /lib/i386-linux-gnu/libuuid.so.1 libuuid.so sudo ln -s /usr/lib/i386-linux-gnu/liblzo2.so.2 liblzo2.so popd Then I got several errors:
The solution is to edit vi build/core/combo/HOST_linux-x86.mk and edit the corresponding line as follows: HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 Source: http://code.google.com/p/android/issues/detail?id=20795
Edit external/mesa3d/src/glsl/linker.cpp and add #include <stddef.h>
Edit external/oprofile/libpp/format_output.h and Remove ‘mutable’ from ‘mutable counts_t & counts;’ on line 94 => counts_t & counts;
Edit external/gtest/include/gtest/internal/gtest-param-util.h and add one line: #include <vector> +#include <cstddef> #include <gtest/internal/gtest-port.h> Source: http://code.google.com/p/android/issues/detail?id=22005
Edit vi frameworks/compile/linkloader/Android.mk and rename LOCAL_LDFLAGS to LOCAL_LDLIBS.
Edit frameworks/compile/slang/Android.mk and remove -Werror After all those changes, I was finally able to complete the build with the output in out/target/product/hdmidongle_6dq including the following directories and files:
If you just want to build U-boot and/or the Kernel follow section 5.3 and 5.4 in R13.4-GA.01_Android_User_Guide.pdf. For the kernel there are 5 configs which all seem quite different from GK802 config:
To build U-boot for Freescale HDMI dongles, there are over 12 config (6 for i.MX6 dual, 6 for i.MX6 Quad), but the most interesting appear to be mx6q_hdmidongle_android_config and mx6q_hdmidongle_nand_android_config. That’s all for today, I’ll post more if I, or somebody else, make progress trying it or/and building it for GK802 / Hi802 mini PC. Read more: http://www./2013/02/06/u-boot-linux-kernel-and-android-patches-for-freescale-i-mx6-hdmi-tv-dongles/#ixzz2uF27JCuc |
|
来自: Kinetis > 《android开发》