Basic Requirements
- ARM Cross Compiler
- Bootloader
- Linux Kernel
- ARM based rootfs
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:
cd u-boot/
git checkout v2012. 10 -b tmp
|
U-Boot Patches:
wget https:
wget https:
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
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:
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:
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
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
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
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..
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)
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)
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
#zImage and initrd
#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 . 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:
/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)
#auto eth0
#iface eth0 inet dhcp
|
To:
auto eth0
iface eth0 inet dhcp
|
Enable Serial Login:
Debian:
sudo nano /media/rootfs/etc/inittab
|
edit last line:
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:
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
|
No comments:
Post a Comment
Thank You , For Immediate Assistance Plz Put Email Copy to Deviceporting@gmail.com