BeginnersGuide AndroidonOmapZoom
BeginnersGuide AndroidonOmapZoom
Prepared By: Govindraj.R (Project Engineer, Wipro Technologies) & KiranKumar V M (Project Engineer, Wipro Technologies) Reveiwed by: Shivananda Hebbar (Technical Lead, Wipro Technologies)
Booting Introduction The OMAP processor follows a 2 stage boot process. The first stage is loaded into the internal static ram by the ROM code. Because the internal static ram is very small (64k), the first stage loader is needed to initialize memory and enough of the peripheral devices to access and load the second stage loader into main memory. It is the job of the second stage loader to initialize the remaining hardware and prepare the system for kernel boot.
SD Card Boot Assuming there was no answer from the host during serial boot, the ROM looks for an SD Card on the first MMC controller. If a card is found, the ROM then looks for the first FAT32 partition within the partition table. Once the partition is found, the root directory is scanned for a special signed file called "MLO". Assuming all is well with the file, it is transfered into the internal sram and control is passed to it. The SDCard x-loader looks for a FAT32 partition on the first MMC controller and scans the top level directory for a file named "u-boot.bin". It then transfers the file into main memory and transfers control to it.
Formatting the SD Card Since putting a Linux file system on a FAT32 partition is problematic, it is recommended to create 2 partitions. The first partition is a boot partition between 64-128 Megabytes and the second partition is a Linux partition consuming the rest of the card. Plug your SD card into your Linux box - do not mount it. For this example, we will assume the card shows up as /dev/sdc - substitute this for the real device on your specific machine. Fdisk the drive and print the partition information fdisk /dev/sdc Command (m for help): p Disk /dev/sdc: 1018 MB, 1018691584 bytes ...<more>... Look for the size in bytes of the device and calculate the number of cylinders, dropping factions, if we have 255 heads and 63 sectors. new_cylinders = Size / 8225280 (for this example we will have 993001472 / 8225280 which equals 120.725 or 120 cylinders)
Since we are changing the underlying geometry of the disk, we must clear the partition table before doing it. So delete all partitions using the fdisk 'd' command - yes, you will lose all data on the card. Once that is done, we can set the new geometry in expert mode. We will set the # of heads to 255, # of sectors to 63, and # of cylinders to new_cylinders. To delete partition use fdisk /dev/sdb1 Command (m for help):d Even the gparted tool can be used to delete the existing patition on the SD-card. Command (m for help): x Expert command (m for help): h Number of heads (1-256, default 30): 255 Expert command (m for help): s Number of sectors (1-63, default 29): 63 Warning: setting sector offset for DOS compatiblity Expert command (m for help): c Number of cylinders (1-1048576, default 2286): 120 Now we return to the main menu and create our 2 partitions as needed - 1 boot partition of 64Meg and the rest a linux partition. Expert command (m for help): r Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-123, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-123, default 123): +64M Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 2 First cylinder (10-123, default 10): Using default value 10 Last cylinder or +size or +sizeM or +sizeK (10-123, default 123): Using default value 123 Set the partition type of the first partition to FAT32 and make it active. Command (m for help): t Partition number (1-4): 1 Hex code (type L to list codes): c Changed system type of partition 1 to c (W95 FAT32 (LBA))
Command (m for help): t Partition number (1-4): 2 Hex code (type L to list codes): 83 Changed system type of partition 2 to 83 +LINUX Command (m for help): a Partition number (1-4): 1
You You
have to format 1st partition with vfat32 filesystem. have to format 2nd partition with EXT3 LINUX filesytem
The partition table should look something like the following. Notice the heads, sectors, and cylinders. Make sure partition 1 is active and FAT32. If it looks good - write the new partition information out. Command (m for help): p Disk /dev/sdc: 993 MB, 993001472 bytes 255 heads, 63 sectors/track, 120 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdc1 * 1 9 72261 c W95 FAT32 (LBA) /dev/sdc2 10 120 891607+ 83 Linux Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: If you have created or modified any DOS 6.x partitions, please see the fdisk manual page for additional information. Syncing disks.
$ sudo apt-get install lib32z1-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs Other Linux There's no reason why Android cannot be built on non-Ubuntu systems. In general you will need: * Python 2.4, which you can download from python.org . * JDK 5.0, update 12 or higher, which you can download from java.sun.com . * Git 1.5.4 or newer. You can find it at http://git.or.cz/ . Note: repo to download the Android source was done using an ubuntu machine with direct internet connection as we faced certain issues while using repo under an proxy internet setting.
Installing Repo
Repo is a tool that makes it easier to work with Git in the context of Android. For more information about using Repo and Git refer to the link http://source.android.com/download/using-repo To install, initialize, and configure Repo, follow these steps: 1. Make sure you have a ~/bin directory in your home directory, and check to be sure that this bin directory is in your path: $ cd ~ $ mkdir bin $ echo $PATH 2. Download the repo script and make sure it is executable: $ curl http://android.git.kernel.org/repo >~/bin/repo $ chmod a+x ~/bin/repo 3. Create an empty directory to hold your working files: $ mkdir mydroid $ cd mydroid 4. Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest:
The Android source files are divided among a number of different repositories. A manifest file contains a mapping of where the files from these repositories will be placed within your working directory when you synchronize your files.
Building x-loader:
wipro@wipro-desktop:/mydroid/bootloader/x-loader$ make CROSS_COMPILE=/arm-2007q3/bin/armnone-linux-gnueabi- distclean wipro@wipro-desktop:/mydroid/bootloader/x-loader$ make CROSS_COMPILE=/arm-2007q3/bin/armnone-linux-gnueabi- omap3430labrador_config wipro@wipro-desktop:/mydroid/bootloader/x-loader$ make CROSS_COMPILE=/arm-2007q3/bin/armnone-linux-gnueabiwipro@wipro-desktop:/mydroid/bootloader/x-loader$ cp x-load.bin x-load-nand.bin wipro@wipro-desktop:/mydroid/bootloader/x-loader$ ./../../vendor/ti/support-tools/boot/omap3430gpsigner.pl x-load-nand.bin x-load-nand-signed.bin Now we can copy the x-load-nand-signed.bin file to first partition i.e the boot partition of the SD card: wipro@wipro-desktop:/mydroid/bootloader/x-loader$ sudo cp x-load-nand-signed.bin /media/disk-1/MLO
Building u-boot:
wipro@wipro-desktop:/mydroid/bootloader/u-boot$ make CROSS_COMPILE=/arm-2007q3/bin/armnone-linux-gnueabi- distclean wipro@wipro-desktop:/mydroid/bootloader/u-boot$make CROSS_COMPILE=/arm-2007q3/bin/armnone-linux-gnueabi- omap3430labrador_config wipro@wipro-desktop:/mydroid/bootloader/u-boot$make CROSS_COMPILE=/arm-2007q3/bin/armnone-linux-gnueabiNow we can copy the u-boot.bin file to first partition i.e the boot partition of the SD card: wipro@wipro-desktop:/mydroid/bootloader/u-boot$ sudo cp u-boot.bin /media/disk-1/ Now we have to build the mkimage tool which is used during the Kernel build process. wipro@wipro-desktop:/mydroid/bootloader/u-boot$make CROSS_COMPILE=/arm-2007q3/bin/armnone-linux-gnueabi- tools wipro@wipro-desktop:/mydroid/bootloader/u-boot$export PATH=$PATH:/mydroid/bootloader/uboot/tools/
Note: Kernel version obtained from repo process is 2.6.26, Alternatively any other kernel version required can also be downloaded from the link http://git.omapzoom.org/?p=omapkernel.git;a=summary
Booting up the Android using the SD card on Omap zoom: We may require to use an virtual terminal software like tera term or minicom for giving the bootargs: Set up the Virtual terminal with the following data: Bps/Par/Bits : 115200 8N1
Once you get bootloader prompt (OMAP34XX LAB #) Give the following arguments in the bootloader prompt OMAP34XX LAB #setenv bootfile=uImage.bin;saveenv;setenv bootargs console=ttyS2,115200n8 root=/dev/mmcblk0p2 init=./init rw wsize=1024,rsize=1024 ip=none rootdelay=2 mem=128M;saveenv;mmcinit;fatload mmc 0 80c00000 uImage.bin;bootm 80c00000 Now you get the Android on the omap zoom board.