Build and install Android image for RQM-IMX6

Here you can find instruction to setup development environment for Android source code for RQM-IMX6 and the way to install it on eMMC. With this guideline, user will be able to setup the system easily and test all the functions with the system.

Setup Build Environment

Please following command below to install Oracle JDK6.0 on Ubuntu 12.04 or 14.04

#sudo apt-get install python-software-properties
#sudo add-apt-repository ppa:webupd8team/java
#sudo apt-get update
#sudo apt-get install oracle-java6-installer
#sudo update-alternatives --config java

Please refer to hyperlink below to setup development environment
Initializing a Build Environment

Generating RSA Keys

Use command below to generate RSA Key :

#ssh-keygen -t rsa

You can find “id_rsa.pub” in path below. Please send it to us by email to get access right of Avalue GIT server.

#/home/username/.ssh/

If you had done this before for your Ubuntu development platform, there's no necessary to do it again.

Download Source code and cross compiler tool from Avalue git server

#git clone gitlab@aes.avalue.com.tw:REV-Q703/REV-Q703_Android.git -b 4.4.2

Compile Android Source code

Please following instruction below to compile Android source code

#cd Android
#./run.sh -j4

You can find all image files in path Android/out/target/product/smarc/

Image File Description
boot.img kernel image file
recovery.img recovery image file
system.img system image file
u-boot-6q.bin bootloader for IMX6-POS Quad core
u-boot-6dl.bin bootloader for IMX6-POS Dual lite

Please copy all of them to path Android-MfgTools\Image\smarc\android of MfgTool folder.

Install Android image into eMMC

Download MfgTool for Android from Hyperlink below
MfgTool for Android

1. Set BTST1 on RQM-IMX6(upper board) as below to serial download mode

2. Use mini-USB cable to connect JMUSB1 on RQM-IMX6 to Windows 7 system.

3. Run MfgTool2.exe and click start to flash image file.

MfgTool Description
Android-MfgTools\MX6DL-Android\MfgTool2.exe MfgTool for i.MX6 Solo or Dual Lite
Android-MfgTools\MX6Q-Android\MfgTool2.exe MfgTool for i.MX6 Dual & Quad




4. It will show “Done” after flashing is finish, then click “Stop” and “Exit” to close the screen.

5. Set BTST1 as below to boot from eMMC

6. Restart the system then boot in Android

Setting for different display (LDB, LCD, HDMI, LCD+HDMI, LDB+HDMI, LDB+LCD)

For Android, please move the directory to “~/ kernel_imx/arch/arm/mach-mx6/smarc/rev_sa01.c”, you can refer the contents below to revise it for suitable display.

1.HDMI

       {
        .disp_dev = "hdmi",
        .interface_pix_fmt = IPU_PIX_FMT_RGB24,
        .mode_str = "1920x1080M@60",
        .default_bpp = 32,
        .int_clk = false,
        .late_init = false,
        },
 
        mx6q_init_audio();
        smarc_fb_init();
//      set_smarc_lvds();
//      imx6q_add_lcdif(&lcdif_data);
//      imx6q_add_ldb(&ldb_data);
        set_smarc_hdmi();
        imx6q_add_vpu();
        imx_add_viv_gpu(&imx6_gpu_data, &imx6q_gpu_pdata);
        imx6q_add_v4l2_output(0);

        set_smarc_gpio();
        mx6q_smarc_init_uart();
        set_smarc_sdio();
        smarc_can_init();

    static struct fsl_mxc_hdmi_core_platform_data hdmi_core_data = {
    .ipu_id = 0,
    .disp_id = 0,
    };

2. LCD

       {
        .disp_dev = "lcd",
        .interface_pix_fmt = IPU_PIX_FMT_BGR24,
        .mode_str = "LCD_XGA",
        .default_bpp = 16,
        .int_clk = false,
        },
void __init smarc_board_init(void)
{
        mx6q_init_audio();
        smarc_fb_init();
//      set_smarc_lvds();
        imx6q_add_lcdif(&lcdif_data);
//      imx6q_add_ldb(&ldb_data);
//      set_smarc_hdmi();
        imx6q_add_vpu();
        imx_add_viv_gpu(&imx6_gpu_data, &imx6q_gpu_pdata);
        imx6q_add_v4l2_output(0);

        set_smarc_gpio();
        mx6q_smarc_init_uart();
        set_smarc_sdio();
        smarc_can_init();
static struct fsl_mxc_lcd_platform_data lcdif_data = {
        .ipu_id = 0,
        .disp_id = 0,
        .default_ifmt = IPU_PIX_FMT_BGR24,
};

3.LDB(LVDS)

       {
        .disp_dev = "ldb",
        .interface_pix_fmt = IPU_PIX_FMT_RGB666,
        .mode_str = "SVGA",
        .default_bpp = 32,
        .int_clk = false,
        .late_init = false,
        },
void __init smarc_board_init(void)
{
        mx6q_init_audio();
        smarc_fb_init();
        set_smarc_lvds();
//      imx6q_add_lcdif(&lcdif_data);
        imx6q_add_ldb(&ldb_data);
//      set_smarc_hdmi();
        imx6q_add_vpu();
        imx_add_viv_gpu(&imx6_gpu_data, &imx6q_gpu_pdata);
        imx6q_add_v4l2_output(0);

        set_smarc_gpio();
        mx6q_smarc_init_uart();
        set_smarc_sdio();
        smarc_can_init();
static struct fsl_mxc_ldb_platform_data ldb_data = {
        .ipu_id                 = 0,
        .disp_id                = 0,
        .ext_ref                = 1,
        .mode                   = LDB_SEP0,
        .sec_ipu_id             = 0,
        .sec_disp_id    = 1,
};

4.LCD+HDMI

static struct ipuv3_fb_platform_data smarc_fb_data[] = {


        {
        .disp_dev = "lcd",
        .interface_pix_fmt = IPU_PIX_FMT_RGB24,
        .mode_str = "LCD_WVGA",
        .default_bpp = 32,
        .int_clk = true,
        },
        
        {
        .disp_dev = "hdmi",
        .interface_pix_fmt = IPU_PIX_FMT_RGB24,
        .mode_str = "1920x1080M@60",
        .default_bpp = 32,
        .int_clk = false,
        .late_init = false,
        },

void __init smarc_board_init(void)
{
        mx6q_init_audio();
        smarc_fb_init();
//      set_smarc_lvds();
        imx6q_add_lcdif(&lcdif_data);
//      imx6q_add_ldb(&ldb_data);
        set_smarc_hdmi();
        imx6q_add_vpu();
        imx_add_viv_gpu(&imx6_gpu_data, &imx6q_gpu_pdata);
        imx6q_add_v4l2_output(0);

        set_smarc_gpio();
        mx6q_smarc_init_uart();
        set_smarc_sdio();
        smarc_can_init();
static struct fsl_mxc_lcd_platform_data lcdif_data = {
        .ipu_id = 0,
        .disp_id = 0,
        .default_ifmt = IPU_PIX_FMT_BGR24,
};

static struct fsl_mxc_hdmi_core_platform_data hdmi_core_data = {
    .ipu_id = 1,
    .disp_id = 0,
};

5. LDB+HDMI

static struct ipuv3_fb_platform_data smarc_fb_data[] = {

        {
        .disp_dev = "ldb",
        .interface_pix_fmt = IPU_PIX_FMT_RGB666,
        .mode_str = "SVGA",
        .default_bpp = 32,
        .int_clk = false,
        .late_init = false,
        },

         {
        .disp_dev = "hdmi",
        .interface_pix_fmt = IPU_PIX_FMT_RGB24,
        .mode_str = "1920x1080M@60",
        .default_bpp = 32,
        .int_clk = false,
        .late_init = false,
        },
void __init smarc_board_init(void)
{
        mx6q_init_audio();
        smarc_fb_init();
        set_smarc_lvds();
//      imx6q_add_lcdif(&lcdif_data);
        imx6q_add_ldb(&ldb_data);
        set_smarc_hdmi();
        imx6q_add_vpu();
        imx_add_viv_gpu(&imx6_gpu_data, &imx6q_gpu_pdata);
        imx6q_add_v4l2_output(0);

        set_smarc_gpio();
        mx6q_smarc_init_uart();
        set_smarc_sdio();
        smarc_can_init();
static struct fsl_mxc_ldb_platform_data ldb_data = {
        .ipu_id                 = 0,
        .disp_id                = 0,
        .ext_ref                = 1,
        .mode                   = LDB_SEP0,
        .sec_ipu_id             = 0,
        .sec_disp_id    = 1,
};

static struct fsl_mxc_hdmi_core_platform_data hdmi_core_data = {
    .ipu_id = 1,
    .disp_id = 0,
};

6.LDB+LCD

static struct ipuv3_fb_platform_data smarc_fb_data[] = {

        {
        .disp_dev = "ldb",
        .interface_pix_fmt = IPU_PIX_FMT_RGB666,
        .mode_str = "SVGA",
        .default_bpp = 32,
        .int_clk = false,
        .late_init = false,
        },


        {
        .disp_dev = "lcd",
        .interface_pix_fmt = IPU_PIX_FMT_BGR24,
        .mode_str = "LCD_XGA",
        .default_bpp = 16,
        .int_clk = false,
        },

};
void __init smarc_board_init(void)
{
        mx6q_init_audio();
        smarc_fb_init();
        set_smarc_lvds();
        imx6q_add_lcdif(&lcdif_data);
        imx6q_add_ldb(&ldb_data);
//      set_smarc_hdmi();
        imx6q_add_vpu();
        imx_add_viv_gpu(&imx6_gpu_data, &imx6q_gpu_pdata);
        imx6q_add_v4l2_output(0);

        set_smarc_gpio();
        mx6q_smarc_init_uart();
        set_smarc_sdio();
        smarc_can_init();
static struct fsl_mxc_ldb_platform_data ldb_data = {
        .ipu_id                 = 0,
        .disp_id                = 0,
        .ext_ref                = 1,
        .mode                   = LDB_SEP0,
        .sec_ipu_id             = 0,
        .sec_disp_id    = 1,
};

static struct fsl_mxc_lcd_platform_data lcdif_data = {
        .ipu_id = 1,
        .disp_id = 0,
        .default_ifmt = IPU_PIX_FMT_BGR24,
};