搜档网
当前位置:搜档网 › Android_User's_Guide

Android_User's_Guide

Android_User's_Guide
Android_User's_Guide

1Overview

This document provides the technical information related to the i.MX 6 and 7 series SABRE devices:

?Instructions for building from sources and using pre-built images

?Copying the images to a boot media

?Hardware/software configurations for programming the boot media and running the images This document describes how to configure a Linux ? OS build machine and provides the steps to download, patch, and build the software components that create the Android? system image when working with the sources.

For more information about building the Android platform,see https://www.sodocs.net/doc/164887507.html,/source/building.html .

2Preparation

2.1Setting up your computer

To build the Android source files, use a computer running Linux OS.

You also need to use the 14.04 64-bit version of Ubuntu which

are the most tested OS for the Android Lollipop 5.1 build.

User's Guide

Rev. L5.1.1_2.1.0-ga, 01/2016

Android? User's Guide

? 2016 Freescale Semiconductor, Inc.

Contents

1Overview....................................................................12Preparation................................................................13Building the Android platform for i.MX...................24Running the Android Platform with a

Prebuilt Image.........................................................115Programming Images. (156)

Booting (18)

After installing the computer running Linux OS, check whether you have all the necessary packages installed for an Android build. See "Setting up your machine" on the Android website https://www.sodocs.net/doc/164887507.html,/source/initializing.html .In addition to the packages requested on the Android website, the following packages are also needed:

$ sudo apt-get install uuid uuid-dev

$ sudo apt-get install zlib1g-dev liblz-dev $ sudo apt-get install liblzo2-2 liblzo2-dev $ sudo apt-get install lzop

$ sudo apt-get install git-core curl $ sudo apt-get install u-boot-tools $ sudo apt-get install mtd-utils

$ sudo apt-get install android-tools-fsutils

NOTE

If you have trouble installing the JDK in Ubuntu, see https://www.sodocs.net/doc/164887507.html,/docs/DOC-98441.

To install git, set the name and email as follows:?git config --global https://www.sodocs.net/doc/164887507.html, "First Last"

?git config --global user.email "https://www.sodocs.net/doc/164887507.html,st@https://www.sodocs.net/doc/164887507.html,"

2.2Unpacking the Android release package

After you have set up a computer running Linux OS, unpack the Android release package by using the following commands:

# cd /opt (or any other directory where you placed the android_L5.1.1_2.1.0-ga_core_source.tar.gz file)

$ tar xzvf android_L5.1.1_2.1.0-ga_core_source.tar.gz $ cd android_L5.1.1_2.1.0-ga_core_source/code/$ tar xzvf L5.1.1_2.1.0-ga.tar.gz

3Building the Android platform for i.MX

3.1Getting Android source code (Android/kernel/U-Boot)

The Android source code is maintained as more than 100 gits in the Android repository (https://www.sodocs.net/doc/164887507.html, ).To get the Android source code from Google repo, follow the steps below:

$ cd ~

$ mkdir myandroid $ mkdir bin $ cd myandroid

$ curl https://www.sodocs.net/doc/164887507.html,/git-repo-downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo

$ ~/bin/repo init -u https://https://www.sodocs.net/doc/164887507.html,/platform/manifest -b android-5.1.1_r1$ ~/bin/repo sync # this command loads most needed repos. Therefore, it can take several hours to load.

$ cd ~/myandroid/prebuilts/gcc/linux-x86/arm

$ git clone https://https://www.sodocs.net/doc/164887507.html,/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6

$ cd arm-eabi-4.6

$ git checkout android-4.4.3_r1

NOTE

Because the default GCC toolchain from android-5.1.1_r1 release is GCC4.8, which may

have issues on ARM? Linux kernel compiling, the GCC 4.0 from android-4.4.3_r1 is

used to compile the Linux Kernel and U-Boot.

Get L5.1.1_2.1.0-ga kernel source code from Freescale open source git:

$ cd ~/myandroid

$ git clone git://https://www.sodocs.net/doc/164887507.html,/imx/linux-2.6-imx.git kernel_imx

# the kernel repo is large. Therefore, this process can take a while.

$ cd kernel_imx

$ git checkout l5.1.1_2.1.0-ga

NOTE

If you are behind a proxy, use socksify to set socks proxy for git protocol.

If you use U-Boot as your bootloader, clone the U-Boot git repository from Freescale open source git:

$ cd ~/myandroid/bootable

$ cd bootloader

$ git clone git://https://www.sodocs.net/doc/164887507.html,/imx/uboot-imx.git uboot-imx

$ cd uboot-imx

$ git checkout l5.1.1_2.1.0-ga

3.2Patch Freescale core features code package

Apply all the i.MX Android patches by performing the following steps:

1.Assume you have unzipped the i.MX Android release package to /opt/android_L5.1.1_

2.1.0-ga_source.

$ cd ~/myandroid

$ source /opt/android_L5.1.1_2.1.0-ga_core_source/code/L5.1.1_2.1.0-ga/and_patch.sh

$ help

2.You should see that the "c_patch" function is available.

$ c_patch /opt/android_L5.1.1_2.1.0-ga_core_source/code/L5.1.1_2.1.0-ga/

imx_L5.1.1_2.1.0-ga

Here, "/opt/android_L5.1.1_2.1.0-ga_source/code/L5.1.1_2.1.0-ga" is the location of the patches, which is the directory created when you unzip the release package.

"imx_L5.1.1_2.1.0-ga" is the branch which is created automatically to hold all patches (only in those existing Google gits).

Choose any branch name instead of "imx_L5.1.1_2.1.0-ga".

3.If everything is OK, "c_patch" generates the following output to indicate the successful patch:

*****************************************************************

Success: Now you can build the Android code for FSL i.MX platform

*****************************************************************

NOTE

The patch script (and_patch.sh) requires some basic utilities like awk/sed. If they are not

available on the computer running Linux OS, install them first.

3.3Patch Freescale extended features code

Besides the core features code package, Freescale also provides extended features code packages. These extended features code packages bring more features. The following tables list the extended features code packages.

To apply android_L5.1.1_2.1.0-ga_omxplayer_source.tar.gz patches, carry out the following commands:

$ cp android_L5.1.1_2.1.0-ga_omxplayer_source.tar.gz ~/myandroid $ cd ~/myandroid

$ tar xzvf android_L5.1.1_2.1.0-ga_omxplayer_source.tar.gz

After unpacking this package, the current build mode is “full”, which means that the omxplayer feature is built into the Android platform.

Use switch_build_to.sh to switch between “core” mode and “full” mode.

$ ./switch_build_to.sh (display current mode)

$ ./switch_build_to.sh mode (mode shall be "core" or "full")

$ ./clean_obj_before_building.sh (clean related binary in the out directory of previous Android build)

NOTE

Run this script after running “lunch” and before running “make”.

To apply android_L5.1.1_2.1.0-ga_wfdsink_source.tar.gz patches, carry out the following commands:

$ cd /opt (or any other directory you like)

$ tar xzvf android_L5.1.1_2.1.0-ga_wfdsink_source.tar.gz

$ cp -a android_L5.1.1_2.1.0-ga_wfdsink_source/wfd-proprietary ~/myandroid/device/

3.4Building Android images

Building the Android image is performed when the source code has been downloaded (Section 3.1) and patched (Section 3.2and Section 3.3 if needed).

Commands lunch to set up the build configuration and make

to start the build process are executed.

The build configuration command lunch can be issued with an argument Build Name – Build Type string, such as lunch sabresd_6dq-user , or can be issued without the argument presenting a menu of selection.

The Build Name is the Android device name found directory ~/myandroid/device/fsl/. The following table lists the i.MX build names.

The build type is used to specify what debug options are provided in the final image. The following table lists the build types.

Android build steps are as follows:

1.Change to the top level build directory.

$ cd ~/myandroid

2.Set up the environment for building. This only configures the current terminal.

$ source build/envsetup.sh

3.Execute the Android lunch command. In this example, the setup is for the production image of i.MX 6DualQuad

SABRE Board/Platform device with user type.

$ lunch sabresd_6dq-user

4.Execute the make command to generate the image.

$ make 2>&1 | tee build-log.txt

When the make command is complete, the build-log.txt file contains the execution output. Check for any errors.

For BUILD_ID & BUILD_NUMBER changing, update build_id.mk in your ~/myandroid directory. For details, see the Android? Frequently Asked Questions (AFAQ).

For i.MX 6Dual/6Quad SABRE-SD and i.MX 6DualLite SABRE-SD boards, the same build configuration is used. The two boards share the same kernel/system/recovery images with the exception of the U-Boot image. The following outputs are generated by default in myandroid/out/target/product/sabresd_6dq:

?root/: root file system (including init, init.rc). Mounted at /.

?system/: Android system binary/libraries. Mounted at /system.

?data/: Android data area. Mounted at /data.

?recovery/: root file system when booting in "recovery" mode. Not used directly.

?boot-imx6q.img: composite image for i.MX 6Dual/6Quad SABRE-SD. which includes the kernel zImage, ramdisk, board's device tree binary, and boot parameters.

?boot-imx6dl.img: composite image for i.MX 6DualLite SABRE-SD, which includes the kernel zImage, ramdisk,

board's device tree binary, and boot parameters.

?boot-imx6q-ldo.img: a composite image for i.MX 6Dual/6Quad 1.2GHZ SABRE-SD, which includes the kernel

zImage, ramdisk, board's device tree binary, and boot parameters.

?ramdisk.img: ramdisk image generated from "root/". Not used directly.

?system.img: EXT4 image generated from "system/". It can be programmed to "SYSTEM" partition on SD/eMMC card with "dd".

?recovery-imx6q.img: EXT4 image for i.MX 6Dual/6Quad SABRE-SD, which is generated from "recovery/". Can be programmed to the "RECOVERY" partition on SD/eMMC card with "dd".

?recovery-imx6q-ldo.img: EXT4 image for i.MX 6Dual/6Quad 1.2GHZ SABRE-SD, which is generated from

"recovery/". Can be programmed to "RECOVERY" partition on SD/eMMC card with "dd".

?recovery-imx6dl.img: EXT4 image for i.MX 6DualLite SABRE-SD, which is generated from "recovery/". Can be programmed to the "RECOVERY" partition on SD/eMMC card with "dd".

?u-boot-imx6q.imx: U-Boot image with no padding for i.MX 6Dual/6Quad SABRE-SD.

?u-boot-imx6dl.imx: U-Boot image with no padding for i.MX 6DualLite SABRE-SD.

NOTE

?To build the U-Boot image separately, see Building U-Boot images.

?To build the kernel uImage separately, see Building a kernel image.

?To build boot.img, see Building boot.img.

The default build is configured for internal eMMC boot storage. See Building Android

image for the SD card on the SABRE-SD Board for the configuration steps to make SD

card in Slot 3 as the boot storage.

3.4.1Configuration examples of building i.MX devices

The following table shows examples of using the lunch command to set up different i.MX devices. After the desired i.MX device is set up, the make command is used to start the build.

After the lunch command is executed, the make command is issued:

$ make 2>&1 | tee build-log.txt

3.4.2User build mode

A production release Android system image is created by using the user Build Type. For configuration options, see Table "Build types" in Section Building Android images.

The notable differences between the user and eng build types are as follows:

?Limited Android System image access for security reasons.

?Lack of debugging tools.

?Installation modules tagged with user.

?APKs and tools according to product definition files, which are found in PRODUCT_PACKAGES in the sources folder ~/myandroid/device/fsl/imx6/imx6.mk. To add customized packages, add the package MODULE_NAME or PACKAGE_NAME to this list.

?The properties are set as: ro.secure=1 and ro.debuggable=0.

?adb is disabled by default.

The i.MX development tool options are shown below from: https://www.sodocs.net/doc/164887507.html,/imx6tools.

* Supported through the superset device (i.MX 6Quad is superset to i.MX 6Dual, i.MX 6DualLite is superset to i.MX 6Solo)

Another method to create Android System Images is setting the environment and then issuing the make command. To set up the environment, execute the script ~/myandroid/build/envsetup.sh. The lunch command and configuration argument for the Freescale Development Tool is then executed. To start the build, use the make command. The following table lists the lunch configuration values.

An example for the SABRE Board for Smart Devices i.MX 6Dual/Quad is:

$ cd ~/myandroid

$ source build/envsetup.sh

$ lunch sabresd_6dq-user

$ make

To create Android platform over-the-air, OTA, and package, the following make target is specified:

$ make otapackage

For more Android platform building information, see https://www.sodocs.net/doc/164887507.html,/source/building.html.

3.4.3Building Android image for the SD card on the SABRE-SD

Board

The default configuration in the source code package takes internal eMMC as the boot storage. It can be changed to make the SD card in SD Slot 3 as the boot storage as follows:

1.Remove /out/target/product/sabresd_6dq/root directory and boot*.img.

2.Remove /out/target/product/sabresd_6dq/recovery directory and recovery*.img.

3.Build the boot.img and recovery.img as follows:

make bootimage BUILD_TARGET_DEVICE=sd

make recoveryimage BUILD_TARGET_DEVICE=sd

Follow Section 3.4 to build the images.

3.4.4Building Android images for NAND on the SABRE-AI board

i.MX 6QuadPlus/Quad/DualLite/Solo SABRE-AI platform:

The default configuration in the source code package takes SD card as the boot storage for i.MX 6 series SABRE-AI boards. The default setting can be changed to make the NAND Flash in U19 be the boot storage as shown below:

make PRODUCT-sabreauto_6q-user BUILD_TARGET_FS=ubifs

i.MX 6SoloX SABRE-AI platform:

The default configuration in the source code package takes SD as the boot storage for SABRE-AI. The default setting can be changed to make the NAND Flash in U19 to be the boot storage as shown below:

make PRODUCT-sabreauto_6sx-user BUILD_TARGET_FS=ubifs

3.5Building U-Boot images

After you set up U-Boot using the steps outlined above, you can find the tool (mkimage) under tools/.

$ cd ~/myandroid/bootable/bootloader/uboot-imx

$ export ARCH=arm

$ export CROSS_COMPILE=~/myandroid/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-$ make distclean

For i.MX 6Quad SABRE-SD:

$ make mx6qsabresdandroid_config

$ make

For i.MX 6DualLite SABRE-SD:

$ make mx6dlsabresdandroid_config

$ make

For i.MX 6Solo SABRE-SD:

$ make mx6solosabresdandroid_config

For i.MX 6Quad SABRE-AI SD:

$ make mx6qsabreautoandroid_config

$ make

For i.MX 6Quad SABRE-AI NAND:

$ make mx6qsabreautoandroid_nand_config

$ make

For i.MX 6QuadPlus SABRE-AI SD:

$ make mx6qpsabreautoandroid_config

For i.MX 6QuadPlus SABRE-AI NAND:

$ make mx6qpsabreautoandroid_nand_config

For i.MX 6DualLite SABRE-AI SD:

$ make mx6dlsabreautoandroid_config

$ make

For i.MX 6DualLite SABRE-AI NAND:

$ make mx6dlsabreautoandroid_nand_config

$ make

For i.MX 6Solo SABRE-AI SD:

$ make mx6solosabreautoandroid_config

$ make

For i.MX 6Solo SABRE-AI NAND:

$ make mx6solosabresdandroid_nand_config

For i.MX 6SoloLite EVK SD:

$ make mx6slevkandroid_config

For i.MX 6SoloX SABRE-SD SD:

$ make mx6sxsabresdandroid_config

For i.MX 6SoloX SABRE-AI SD:

$ make mx6sxsabreautoandroid_config

For i.MX 6SoloX SABRE-AI NAND:

$ make mx6sxsabreautoandroid_nand_config $ make

For i.MX 7Dual SABRE-SD SD:

$ make mx7dsabresdandroid_config $ make

"u-boot.imx" is generated if you have a successful build.

NOTE

Any image that should be loaded by U-Boot must have an unique image head. For example, data must be added at the head of the loaded image to tell U-Boot about the image (i.e., it's a kernel or ramfs) and how to load the image (i.e., load/execute address).Before loading any image into RAM by U-Boot, you need a tool to add this information and generate a new image which can be recognized by U-Boot. The tool is delivered together with U-Boot. After you set up U-Boot using the steps outlined above, find the tool (mkimage) under tools/. The process of using mkimage to generate an image (for example, kernel image and ramfs image), which is to be loaded by U-Boot, is outlined in the subsequent sections of this document.

3.6Building a kernel image

Kernel image is automatically built when building the Android root file system.The following are the default Android build commands to build the kernel image:

$ export PATH=~/myandroid/bootable/bootloader/uboot-imx/tools:$PATH $ cd ~/myandroid/kernel_imx

$ echo $ARCH && echo $CROSS_COMPILE

Make sure that you have those two environment variables set. If the two variables are not set, set them as follows:

$ export ARCH=arm

$ export CROSS_COMPILE=~/myandroid/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-# Generate ".config" according to default config file under arch/arm/configs.

# To build the kernel image for i.MX 6Dual/Quad, 6QuadPlus, 6DualLite, 6Solo, 6SoloLite, 6SoloX, and 7Dual

$ make imx_v7_android_defconfig

# To build the kernel image for i.MX 6Dual/Quad, 6QuadPlus, 6DualLite, and 6Solo $ make uImage LOADADDR=0x10008000

# To build the kernel image for i.MX 6SoloLite $ make uImage LOADADDR=0x80008000

# To build the kernel image for i.MX 6SoloX $ make uImage LOADADDR=0x80008000

# To build the kernel uImage for i.MX 7Dual

$ make uImage LOADADDR=0x80008000

The kernel images are found in the folders: ~/myandroid/kernel_imx/arch/arm/boot/zImage and ~/myandroid/kernel_imx/ arch/arm/boot/uImage.

3.7Building boot.img

boot.img and boota are default booting commands.

As outlined in Running the Android Platform with a Prebuilt Image, we use boot.img and booti as default commands to boot, not the uramdisk and uImage we used before.

Use this command to generate boot.img under Android environment:

# Boot image for the i.MX 6Dual/6Quad SABRE-SD board

$ cd ~/myandroid

$ source build/envsetup.sh

$ lunch sabresd_6dq-user

$ make bootimage

# Boot image for the i.MX 6Dual/6Quad/6QuadPlus SABRE-AI board

$ source build/envsetup.sh

$ lunch sabreauto_6q-user

$ make bootimage

# Boot image for the i.MX 6SoloLite EVK board

$ source build/envsetup.sh

$ lunch evk_6sl-user

$ make bootimage

# Boot image for the i.MX 6SoloX SABRE-SD board

$ source build/envsetup.sh

$ lunch sabresd_6sx-user

$ make bootimage

# Boot image for the i.MX 6SoloX SABRE-AI board

$ source build/envsetup.sh

$ lunch sabreauto_6sx-user

$ make bootimage

# Boot image for i.MX 7Dual SABRE-SD board

$ source build/envsetup.sh

$ lunch sabresd_7d-user

$ make bootimage

4Running the Android Platform with a Prebuilt Image

To test the Android platform before building any code, use the prebuilt images from the following packages and go to

"Download Images" and "Boot".

The following tables list the detailed contents of android_L5.1.1_2.1.0-ga_core_image_6qsabresd.tar.gz and

android_L5.1.1_2.1.0-ga_full_image_6qsabresd.tar.gz image packages.

The table below shows the prebuilt images to support the system boot from eMMC on the i.MX 6Dual/6Quad SABRE-SD board and platform and i.MX 6Solo/6DualLite SABRE-SD platform.

The table below shows the prebuilt images to support the system boot from SD on the i.MX 6Dual/6Quad and i.MX 6Solo/ 6DualLite SABRE-SD boards.

The following tables list the detailed contents of android_L5.1.1_2.1.0-ga_core_image_6qsabreauto.tar.gz and

android_L5.1.1_2.1.0-ga_full_image_6qsabreauto.tar.gz image packages:

The table below shows the prebuilt images to support the system boot from SD on the i.MX 6Dual/6Quad, i.MX 6QuadPlus, and i.MX 6Solo/6DualLite SABRE-AI boards.

The table below shows the prebuilt images to support the system boot from NAND on the i.MX 6Dual/6Quad, i.MX

6QuadPlus, and i.MX 6Solo/6DualLite SABRE-AI board.

The following tables list the detailed contents of android_L5.1.1_2.1.0-ga_core_image_6slevk.tar.gz image package.

The table below shows the prebuilt images to support the system boot from SD on the i.MX 6SoloLite EVK board.

The following tables list the detailed contents of the android_L5.1.1_2.1.0-ga_core_image_6sxsabresd.tar.gz image package. The table below shows the prebuilt images to support the system boot from SD on the i.MX 6SoloX SABRE-SD board.

The following tables list the detailed contents of android_L5.1.1_2.1.0-ga_core_image_6sxsabreauto.tar.gz and

android_L5.1.1_2.1.0-ga_full_image_6sxsabreauto.tar.gz image packages.

The table below shows the prebuilt images to support the system boot from SD on the i.MX 6SoloX SABRE-AI boards.

The table below shows the prebuilt images to support the system boot from NAND on the i.MX 6SoloX SABRE-AI boards.

The table below shows the prebuilt images to support the system boot from SD on i.MX 7Daul SABRE-SD boards.

NOTE

boot.img is an Android image that stores zImage and ramdisk together. It also stores

other information such as the kernel boot command line, machine name. This information

can be configured in corresponding board's BoardConfig.mk. If you use boot.img, you do

not need uImage and uramdisk.img.

5Programming Images

The images from the Freescale prebuilt release package or created from source code contain the U-Boot boot loader, system image, and recovery image. At a minium, the storage devices on the Freescale development system (MMC/SD or NAND) must be programmed with the U-Boot boot loader. The i.MX 6 series boot process determines what storage device to access based on the switch settings. When the boot loader is loaded and begins execution, the U-Boot environment space is then read to determine how to proceed with the boot process. For U-Boot environment settings, see Section Booting.

The following download methods can be used to write the Android System Image:

?MFGTool to download all images to MMC/SD card and NAND storage.

?Using dd command to download all images to MMC/SD card.

5.1System on MMC/SD

The images needed to create an Android system on MMC/SD can either be obtained from the release package or be built from source.

The images needed to create an Android system on MMC/SD are listed below:

?U-Boot image: u-boot.imx

?boot image: boot.img

?Android system root image: system.img

?Recovery root image: recovery.img

5.1.1Storage partitions

To create storage partitions, you can use MFGTool as described in the Android Quick Start Guide (AQSUG), or you can use format tools in prebuild dir.

The layout of the MMC/SD/TF card for Android system is shown below:

?[Partition type/index] is which defined in the MBR.

?[Name] is only meaningful in the Android platform. Ignore it when creating these partitions.

?[Start Offset] shows where partition is started, unit in MB.

The SYSTEM partition is used to put the built Android system image. The DATA is used to put applications' unpacked codes/data, system configuration database, etc. In normal boot mode, the root file system is mounted from uramdisk. In recovery mode, the root file system is mounted from the RECOVERY partition.

There is a shell script mksdcard.sh.tar in MFGTool-Dir\Profiles\Linux\OS Firmware.

The script below can be used to partition a SD card as shown in the partition table above:

$ cd ~/myandroid/

$ sudo chmod +x ./device/fsl/common/tools/fsl-sdcard-partition.sh

$ sudo ./device/fsl/common/tools/fsl-sdcard-partition.sh -f /dev/sdX

# can be imx6q, imx6dl, imx6sl, imx6sx and imx7d.

NOTE

?The minimum size of the SD card is 2 GB.

?/dev/sdX, the X is the disk index from 'a' to 'z'. That may be different on each

computer running Linux OS.

?Unmount all the SD card partitions before running the script.

5.1.2Downloading images with MFGTool

MFGTool can be used to download all images into a target device. It is a quick and easy tool for downloading images. See Android? Quick Start Guide (AQSUG) for a detailed description of MFGTool.

5.1.3Downloading images with dd utility

The Linux utility "dd" on the computer running Linux OS can be used to download the images into the MMC/SD/TF card. Before downloading, ensure that your MMC/SD/TF card partitions are created as described in Storage partitions.

All partitions can be recognized by the the computer running Linux OS. To download all images into the card, use the commands below:

Download the U-Boot image:

# sudo dd if=u-boot.imx of=/dev/sdx bs=1K seek=1; sync

Download the boot image:

# sudo dd if=boot.img of=/dev/sdx1; sync

Download the Android system root image:

# sudo simg2img system.img system_raw.img

# sudo dd if=system_raw.img of=/dev/sdx5; sync

Download the Android recovery image:

# sudo dd if=recovery.img of=/dev/sdx2; sync

NOTE

simg2img is a tool that converts a sparse system image to a raw system image on a Linux

host PC and is located in myandroid/out/host/linux-x86/bin/simg2img.

5.2System on NAND for the SABRE-AI board

The images needed to create an Android system on NAND are listed below:

?U-Boot image: u-boot-imx6q-nand.imx, u-boot-imx6dl-nand.imx, u-boot-imx6solo-nand.imx

?Boot image: boot.img

?Android system root image: android_root.img

?Recovery root image: recovery.img

The images can either be obtained from the release package or they can be built from source.

5.2.1Storage partitions on NAND

The layout of the NAND for Android system is shown below:

?[Partition type/index] is which defined in the MBR.

?[Name] is only meaningful in the Android platform. Ignore it when creating these partitions.

?[Start Offset] shows where partition is started, unit in MB.

The SYSTEM partition is used to put the built Android system image. The DATA is used to put the application unpacked codes/data, system configuration database, etc. In normal boot mode, the root file system is mounted from uramdisk. In recovery mode, the root file system is mounted from the RECOVERY partition.

To create storage partitions, use MFGTool as described in the Android? Quick Start Guide (AQSUG).

5.2.2Downloading images with MFGTool for NAND

MFGTool can be used to download all images into a target device.

It is a quick and easy tool for downloading images. See Android? Quick Start Guide (AQSUG) for detailed description of MFGTool for NAND.

6Booting

This chapter describes booting from MMC/SD, NAND, TFTP and NFS.

6.1Booting from MMC/SD

This section describes how to boot from MMC/SD on the Freescale SABRE and EVK development tool devices:?i.MX 6DualQuad SABRE-SD board/platform

?i.MX 6DualQuad/6DualLite SABRE-AI board ?i.MX 6SoloLite EVK board ?i.MX 6SoloX SABRE-SD board

6.1.1Booting from MMC/SD on the i.MX 6DualQuad/6DualLite

SABRE-SD board

This section contains boot switch information and steps needed to bootup from MMC/SD.The following table lists the boot switch settings for different boot methods:

To boot from eMMC, perform the following operations:

Change the board boot switch to eMMC 4-bit mode and make (SW6) 11100110 (from 1-8 bit). Or change (SW6) 11100110(from 1-8 bit) for 8-bit boot mode.

The default environment in boot.img is booting from eMMC. If you want to use the default environment in boot.img, use the following command:

U-Boot > setenv bootargs

To clear the bootargs environment, use the following commands:

U-Boot > setenv fastboot_dev mmc2 [eMMC as fastboot deivce]

U-Boot > setenv bootcmd boota mmc2 [Load the boot.img from eMMC]

U-Boot > setenv bootargs console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,bpp=32

video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off vmalloc=256M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=384M [Optional]U-Boot > saveenv #[Save the environments]

NOTE

The mmcX value changes depending on the boot mode. These are the correct values:

bootargs env is an optional setting for booti. The boot.img includes a default bootargs,which is used if there is no definition of the bootargs environment.

Some SoCs on SABRE-SD boards do not have MAC address fused. Therefore, if you want to use FEC in U-Boot, set the following environment:

U-Boot > setenv ethaddr 00:04:9f:00:ea:d3 #[setup the MAC address]

U-Boot > setenv fec_addr 00:04:9f:00:ea:d3 $[setup the

MAC address]

To boot from the SD card, perform the following operations:

Change the board boot switch to SD3 boot: (SW6) 01000010 (from 1-8 bit). To clear the bootargs env and set up the booting from SD card in SD slot 3, use the following command:

U-Boot > setenv fastboot_dev mmc1 [eMMC as fastboot deivce]

U-Boot > setenv bootcmd boota mmc1 [Load the boot.img from SD card]

U-Boot > setenv bootargs console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,bpp=32

video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off vmalloc=256M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=384M #[Optional]

U-Boot > saveenv #[Save the environments]

NOTE

bootargs env is an optional setting for booti. The boot.img includes a default bootargs,

which is used if there is no definition of the bootargs environment.

Some SoCs on SABRE-SD boards do not have MAC address fused.

Therefore, if you want to use FEC in U-Boot, set the following environment:

U-Boot > setenv ethaddr 00:04:9f:00:ea:d3 #[setup the

MAC address]

U-Boot > setenv fec_addr 00:04:9f:00:ea:d3 $[setup the

MAC address]

6.1.2Booting from MMC/SD on the the i.MX 6Dual/Quad/DualLite/

QuadPlus SABRE-AI board

This section contains boot switch information and steps needed to bootup from MMC/SD.

The following table lists the boot switch settings for different boot methods on i.MX 6 series SABRE-AI boards.

To boot from SD, perform the following operations:

Chang the board boot switch to (S3, S2, S1) 0010, 0010,010******* (from 1 bit).

The default environment in boot.img is booting from SD. If you want to use the default environment in boot.img, use the following command:

U-Boot > setenv bootargs

To clear the bootargs environment, use the following command:

U-Boot > setenv bootcmd boota mmc1 #[Load the boot.img from SD]

U-Boot > setenv bootargs console=ttymxc3,115200 init=/init video=mxcfb0:dev=ldb,bpp=32

video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off vmalloc=320M androidboot.console=ttymxc3 consoleblank=0 androidboot.hardware=freescale cma=384M #[Optional]

U-Boot > saveenv #[Save the environments]

相关主题