i.MX53 Bootloaders

25-iMXQSB.jpg 

Basic Requirements

Bootloader

Das U-Boot – the Universal Boot Loader http://www.denx.de/wiki/U-Boot

U-Boot Download:

Download U-Boot via git:
git clone git://git.denx.de/u-boot.git
cd u-boot/
git checkout v2012.10 -b tmp

U-Boot Patches:


Ads by Google
wget https://raw.github.com/RobertCNelson/Bootloader-Builder/master/patches/v2012.10/0001-enable-bootz-support.patch
wget https://raw.github.com/RobertCNelson/Bootloader-Builder/master/patches/v2012.10/0002-imx-convert-to-uEnv.txt-n-fixes.patch
patch -p1 < 0001-enable-bootz-support.patch
patch -p1 < 0002-imx-convert-to-uEnv.txt-n-fixes.patch

U-Boot Configure and Build:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- distclean

Ads by Google
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- mx53loco_config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-

Linux Kernel

Linux Build Script:

git clone git://github.com/RobertCNelson/imx-devel.git
cd imx-devel
For Mainline Freescales 2.6.35 bsp
git checkout origin/imx-bsp -b imx-bsp
For Mainline v3.4.x (currently no usb/video)
git checkout origin/v3.4.x-imx -b v3.4.x-imx
For Mainline v3.6.x using Device Tree's: (currently no usb/video/sata)
git checkout origin/v3.6.x-imx -b v3.6.x-imx
Run Build Script:
./build_kernel.sh
The kernel zImage and modules will be under the deploy directory.

Debian Squeeze 6.0.6 (armel based) Root File System

Default User: debian
Password: temppwd
Root User: root
Root Password: root

Ads by Google

wget -c http://rcn-ee.net/deb/minfs/squeeze/debian-6.0.6-minimal-armel-2012-10-22.tar.xz
verify the image with:
md5sum debian-6.0.6-minimal-armel-2012-10-22.tar.xz
97a4717d95c72d3c9d931a39a3aa58c6  debian-6.0.6-minimal-armel-2012-10-22.tar.xz
Extract Image:
tar xJf debian-6.0.6-minimal-armel-2012-10-22.tar.xz

Debian Wheezy (snapshot) (armhf based) Root File System

Default User: debian
Password: temppwd
Root User: root
Root Password: root
wget -c http://rcn-ee.net/deb/minfs/wheezy/debian-wheezy-minimal-armhf-2012-10-22.tar.xz
verify the image with:
md5sum debian-wheezy-minimal-armhf-2012-10-22.tar.xz
ff409aa856b4b2ab86a6c8126a349926  debian-wheezy-minimal-armhf-2012-10-22.tar.xz
Extract Image:
tar xJf debian-wheezy-minimal-armhf-2012-10-22.tar.xz

Ubuntu 12.10 (Quantal) (armhf based) Root File System

Default User: ubuntu
Password: temppwd
wget -c http://rcn-ee.net/deb/minfs/quantal/ubuntu-12.10-minimal-armhf-2012-10-22.tar.xz
verify the image with:
md5sum ubuntu-12.10-minimal-armhf-2012-10-22.tar.xz
442c3a26af8e80ecf44ea470f5dcacd5  ubuntu-12.10-minimal-armhf-2012-10-22.tar.xz
Extract Image:
tar xJf ubuntu-12.10-minimal-armhf-2012-10-22.tar.xz

Setup microSD card

For these instruction, we are assuming: DISK=/dev/mmcblk0, "sudo fdisk -l" is useful for determining the device id..
export DISK=/dev/mmcblk0
Erase microSD card:
sudo parted --script ${DISK} mklabel msdos
Install U-Boot Bootloader:
sudo dd if=./u-boot/u-boot.imx of=${DISK} seek=1 bs=1024
Create Partition Layout:
boot: ext2, 50Mb in size, starting at 2Mb (to not overwrite the u-boot.imx file)
rootfs: ext3/4, rest of microSD card.

Mount the Boot & Root File System Partitions:

v3.4.x "uEnv.txt" boot script

Create U-Boot "uEnv.txt" boot script: (nano uEnv.txt)
uEnv.txt
initrd_high=0xffffffff
fdt_high=0xffffffff
console=ttymxc0,115200
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=ext4 rootwait fixrtc
optargs=console=tty0
video=mxcdi1fb:1280x720M@60
mmc_load_image=ext2load mmc 0:1 0x70010000 zImage
mmc_load_initrd=ext2load mmc 0:1 0x72000000 initrd.img; setenv initrd_size ${filesize}
mmc_load_dtb=ext2load mmc 0:1 0x71ff0000 /dtbs/${dtb_file}
mmcargs=setenv bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype} ${video}
#Just: zImage
xyz_mmcboot=run mmc_load_image; echo Booting from mmc ...
loaduimage=run xyz_mmcboot; run mmcargs; bootz 0x70010000
#zImage and initrd
#xyz_mmcboot=run mmc_load_image; run mmc_load_initrd; echo Booting from mmc ...
#loaduimage=run xyz_mmcboot; run mmcargs; bootz 0x70010000 0x72000000:${initrd_size}

Device Tree "uEnv.txt" boot script v3.6.x

Create U-Boot "uEnv.txt" boot script: (nano uEnv.txt)
uEnv.txt
initrd_high=0xffffffff
fdt_high=0xffffffff
console=ttymxc0,115200
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=ext4 rootwait fixrtc
optargs=console=tty0
video=mxcdi1fb:1280x720M@60
mmc_load_image=ext2load mmc 0:1 0x70010000 zImage
mmc_load_initrd=ext2load mmc 0:1 0x72000000 initrd.img; setenv initrd_size ${filesize}
mmc_load_dtb=ext2load mmc 0:1 0x71ff0000 /dtbs/${dtb_file}
mmcargs=setenv bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype} ${video}
#Just: zImage
xyz_mmcboot=run mmc_load_image; run mmc_load_dtb; echo Booting from mmc ...
loaduimage=run xyz_mmcboot; run mmcargs; bootz 0x70010000 - 0x71ff0000
#xyz_mmcboot=run mmc_load_image; run mmc_load_initrd; run mmc_load_dtb; echo Booting from mmc ...
#loaduimage=run xyz_mmcboot; run mmcargs; bootz 0x70010000 0x72000000:${initrd_size} 0x71ff0000
Copy uEnv.txt to the boot partition:
sudo cp -v ./uEnv.txt /media/boot/
Copy Kernel zImage:
sudo cp -v ./imx-devel/deploy/3.6.6-imx2.zImage /media/boot/zImage
Copy Kernel dtbs (Device Tree (v3.6.x++)):
sudo mkdir -p /media/boot/dtbs/
sudo tar xfv ./imx-devel/deploy/3.6.6-imx2-dtbs.tar.gz -C /media/boot/dtbs/
Copy Root File System:
sudo tar xfvp ./*-*-minimal-arm*-*/armel-rootfs-*.tar -C /media/rootfs/
Copy Kernel modules:
sudo tar xfv ./imx-devel/deploy/3.6.6-imx2-modules.tar.gz -C /media/rootfs/
Tweak "/etc/fstab", the defaults should work for most boards:
sudo nano /media/rootfs/etc/fstab
Edit:
/etc/fstab
/dev/mmcblk0p2   /           auto   errors=remount-ro   0   1
/dev/mmcblk0p1   /boot/uboot auto   defaults            0   0
if /dev/mmcblk0p1 is ext2, change last line:
/dev/mmcblk0p1   /boot/uboot auto   defaults            0   2
Enable Networking on Bootup:
  • Note: Boards without ethernet interfaces will have delays on bootup.
sudo nano /media/rootfs/etc/network/interfaces
From: (uncomment)
/etc/network/interfaces
#auto eth0
#iface eth0 inet dhcp
To:
/etc/network/interfaces
auto eth0
iface eth0 inet dhcp
Enable Serial Login:
Debian:
sudo nano /media/rootfs/etc/inittab
edit last line:
/etc/inittab
from: T2:23:respawn:/sbin/getty -L  115200 vt102
to: T2:23:respawn:/sbin/getty -L ttymxc0 115200 vt102
Ubuntu:
sudo nano /media/rootfs/etc/init/serial.conf
Add:
/etc/init/serial.conf
start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]
respawn
exec /sbin/getty 115200 ttymxc0
Remove microSD card:
sync
sudo umount /media/boot
sudo umount /media/rootfs

2 comments:

  1. Nice post By reading your blog, i get inspired and this provides some useful information. Thank you for posting this exclusive post for our vision.
    Digital Marketing Training

    ReplyDelete

Thank You , For Immediate Assistance Plz Put Email Copy to Deviceporting@gmail.com