User Tools

Site Tools


Sidebar

* [[start]] * [[som|System on module]] * [[usomiq-beaglebone|Mentorel Beaglebone uSomIQ]] * [[usomiq|uSomIQ AM335x]] * [[somiq|SomIQ family]] * [[blueshark|BlueShark family]] * [[devkit|DevKits]] * [[usomiq-bone-cape|uSomIQ Bone Cape]] * [[somiqboard|Somiqboard]] * [[atoll|Atoll]] * [[expansion|Expansion boards]] * [[somiq-wlan|SomIQ-WLAN]] * [[os|OS support]] * [[ubuntu|Ubuntu Linux]] * [[sw-hints|SW hints]] * [[tslib|Tslib]] * [[qt-embedded|Qt embedded]] Follow us * [[http://twitter.com/mentorel|Twitter]] * [[http://www.linkedin.com/company/mentorel|LinkedIn]] * [[https://www.facebook.com/mentorel.company|Facebook]] * [[https://plus.google.com/105868322858146792212/posts|Google+]] * [[http://www.mentorel.com|MENTOREL home page]]

usomiq-kernel-dts

This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

====== How to build uSomIQ Linux kernel with Device Tree support ====== This page describes to how deploy the Ubuntu OS and Debian on a uSomIQ COM. These instructions were adapted from the ones provided by Robert Nelson available here:\\ [[http://eewiki.net/display/linuxonarm/BeagleBone+Black]] ===== Basic Requirements ===== * ARM Cross Compiler * Linaro: [https://launchpad.net/linaro-toolchain-binaries] * Bootloader * Das U-Boot -- the Universal Boot Loader [http://www.denx.de/wiki/U-Boot] * Source -- [http://git.denx.de/?p=u-boot.git;a=summary] * Linux Kernel * Linus's Mainline tree: [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=summary] * ARM based rootfs * Debian Squeeze: [http://www.debian.org/] ===== GCC Toolchain ===== <code> wget -c https://releases.linaro.org/14.04/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux.tar.xz tar xf gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux.tar.xz export CC=`pwd`/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux/bin/arm-linux-gnueabihf- </code> ===== Bootloader ===== Das U-Boot -- the Universal Boot Loader [http://www.denx.de/wiki/U-Boot] ==== U-Boot Download ==== Download U-Boot via git: <code> git clone git://git.denx.de/u-boot.git cd u-boot/ git checkout v2014.10 -b tmp </code> ==== U-Boot Patches ==== <code> wget http://www.mentorel.com/downloads/usomiq/patches/u-boot-usomiq-v2014.10.patch patch -p1 < u-boot-usomiq-v2014.10.patch </code> ==== U-Boot Configure and Build ==== <code> make ARCH=arm CROSS_COMPILE=${CC} distclean make ARCH=arm CROSS_COMPILE=${CC} am335x_evm_config make ARCH=arm CROSS_COMPILE=${CC} </code> ===== Upgrade distro "device-tree-compiler" package ===== <code> wget -c https://raw.github.com/RobertCNelson/tools/master/pkgs/dtc.sh chmod +x dtc.sh ./dtc.sh </code> ===== Linux Kernel ===== <code> git clone https://github.com/RobertCNelson/bb-kernel.git cd bb-kernel/ </code> ==== v3.8.x branch (full cape support) ==== <code> git checkout origin/am33x-v3.8 -b tmp </code> Download a patch to enable uSomIQ support in kernel <code> wget http://www.mentorel.com/downloads/usomiq/patches/add-usomiq-rcn-v3.8.patch patch -p1 < add-usomiq-rcn-v3.8.patch ==== v3.18.x branch (SGX and better usb & ethernet) ==== <code> git checkout origin/am33x-v3.18 -b tmp </code> Download and apply a patch to add usomiq support in the kernel: <code> wget http://mentorel.com/downloads/usomiq/patches/add-usomiq-rcn-v3.18.patch patch -p1 < add-usomiq-rcn-v3.18.patch </code> Run Build Script: <code> ./build_kernel.sh </code> The kernel zImage and modules will be under the deploy directory. ====== Root File System ====== ===== Debian 7.0.0 (Wheezy) Root File System ===== This file system is very small and can be installed to the NAND flash on uSomIQ. It is not that small like Angstrom minimal distribution (~20M), but will require around 75M on the flash. However it is a real Debian system with apt-get utility installed. Default User: debian Password: temppwd Root User: root Root Password: root <code> wget -c https://rcn-ee.net/deb/minfs/wheezy/debian-7.5-minimal-armhf-2014-07-07.tar.xz </code> verify the image with: <code> md5sum debian-7.5-minimal-armhf-2014-07-07.tar.xz cae9e0cfac14fd6aa19d4c17357aecc8 debian-7.5-minimal-armhf-2014-07-07.tar.xz </code> Extract Image: <code> tar xf debian-7.5-minimal-armhf-2014-07-07.tar.xz </code> Now you have a directory with the archived (tar) file system itself and a file with user names/passwords. ===== Ubuntu 14.04 Root File System ===== Default User: ubuntu Password: temppwd <code> wget -c https://rcn-ee.net/deb/minfs/trusty/ubuntu-14.04-minimal-armhf-2014-07-07.tar.xz </code> verify the image with: <code> md5sum ubuntu-14.04-minimal-armhf-2014-07-07.tar.xz c30fb91012701cdbfa00bb6c86868d0a ubuntu-14.04-minimal-armhf-2014-07-07.tar.xz </code> Extract Image: <code> tar xJf ubuntu-14.04-minimal-armhf-2014-07-07.tar.xz </code> Now you have a directory with the archived (tar) file system itself and a file with user names/passwords. ===== Root File System for NAND ===== A Root File System around 64Mb in size, for flash applications. **Debian 7 (small flash)** ^ User ^ Password ^ | debian | temppwd | | root | root | Download: <code> wget -c https://rcn-ee.net/deb/barefs/wheezy/debian-7.5-bare-armhf-2014-07-07.tar.xz </code> Verify: <code> md5sum debian-7.5-bare-armhf-2014-07-07.tar.xz a5f0e75e5ad16bb110d4291f54ed6cb9 debian-7.5-bare-armhf-2014-07-07.tar.xz </code> Extract: <code> tar xJf debian-7.5-bare-armhf-2014-07-07.tar.xz </code> ====== Install Ubuntu/Debian ====== ===== SD card ===== ==== Setup microSD card ==== For these instruction, we are assuming: DISK=/dev/mmcblk0, "sudo fdisk \-l" is useful for determining the device id.. <code> export DISK=/dev/mmcblk0 </code> Erase microSD card: <code> sudo dd if=/dev/zero of=${DISK} bs=1024 count=1024 sudo parted --script ${DISK} mklabel msdos </code> Setup Boot Partition: <code> sudo fdisk ${DISK} << __EOF__ n p 1 +64M t e p w __EOF__ </code> Set Boot Flag <code> sudo parted --script ${DISK} set 1 boot on </code> Format Boot Partition as vfat: <code> DISK=/dev/mmcblk0 sudo mkfs.vfat -F 16 ${DISK}p1 -n boot (or) DISK=/dev/sdX sudo mkfs.vfat -F 16 ${DISK}1 -n boot </code> Setup Root File System Partition: <code> sudo fdisk ${DISK} << __EOF__ n p 2 w __EOF__ </code> Format rootfs as ext4: <code> DISK=/dev/mmcblk0 sudo mkfs.ext4 ${DISK}p2 -L rootfs (or) DISK=/dev/sdX sudo mkfs.ext4 ${DISK}2 -L rootfs </code> ==== Mount Partitions ==== *Note: On most systems these partitions will be auto-mounted...* <code> sudo mkdir -p /media/boot/ sudo mkdir -p /media/rootfs/ DISK=/dev/mmcblk0 sudo mount ${DISK}p1 /media/boot/ sudo mount ${DISK}p2 /media/rootfs/ (or) DISK=/dev/sdX sudo mount ${DISK}1 /media/boot/ sudo mount ${DISK}2 /media/rootfs/ </code> ==== Install Bootloaders ==== Copy MLO/u-boot.img to the boot partition <code> sudo cp -v ./u-boot/MLO /media/boot/ sudo cp -v ./u-boot/u-boot.img /media/boot/ </code> ==== uEnv.txt based bootscript ==== Create "uEnv.txt" boot script: (nano uEnv.txt) <code> mmcroot=/dev/mmcblk0p2 ro mmcrootfstype=ext4 rootwait fixrtc loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/dtbs/${fdtfile} ##Un-comment to enable systemd in Debian Wheezy #optargs=quiet init=/lib/systemd/systemd </code> Copy uEnv.txt to the boot partition: <code> sudo cp -v ./uEnv.txt /media/boot/ </code> ==== Install Kernel and Root File System ==== To help new users, since the kernel version can change on a daily basis. The kernel building scripts in this git repo will now give you a hint of what kernel version was built. <code> ----------------------------- Script Complete eewiki.net: [user@localhost:~$ export kernel_version=3.X.Y-Z] ----------------------------- </code> Copy and Paste that "export kernel_version=3.X.Y-Z" exactly as shown in your own build/desktop environment: <code> export kernel_version=3.X.Y-Z </code> Copy Root File System: <code> sudo tar xfvp ./*-*-minimal-arm*-*/arm*-rootfs-*.tar -C /media/rootfs/ </code> Copy Kernel zImage: <code> sudo cp -v ./linux-dev/deploy/${kernel_version}.zImage /media/rootfs/boot/zImage </code> Kernel Device Tree Binaries: <code> sudo mkdir -p /media/rootfs/boot/dtbs/ sudo tar xfov ./bb-kernel/deploy/${kernel_version}-dtbs.tar.gz -C /media/rootfs/boot/dtbs/ sudo tar xfv ./bb-kernel/deploy/${kernel_version}-firmware.tar.gz -C /media/rootfs/lib/firmware/ </code> Copy Kernel modules: <code> sudo tar xfv ./linux-dev/deploy/${kernel_version}-modules.tar.gz -C /media/rootfs/ </code> Setup /etc/fstab: <code> sudo nano /media/rootfs/etc/fstab </code> Add: <code> /dev/mmcblk0p2 / auto errors=remount-ro 0 1 /dev/mmcblk0p1 /boot/uboot auto defaults 0 0 </code> === Enable Networking === <code> sudo nano /media/rootfs/etc/network/interfaces </code> Add: <code> auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp </code> === Enable Serial Login === **Debian:** <code> sudo nano /media/rootfs/etc/inittab </code> Add at end of file: <code> T0:23:respawn:/sbin/getty -L ttyO0 115200 vt102 </code> **Ubuntu:** <code> sudo nano /media/rootfs/etc/init/serial.conf </code> Add: <code> start on stopped rc RUNLEVEL=[2345] stop on runlevel [!2345] respawn exec /sbin/getty 115200 ttyO0 </code> Remove microSD card: <code> sync sudo umount /media/boot sudo umount /media/rootfs </code> ===== Install Debian to NAND ===== Here you will learn how install Debian to a UBIFS partition on a uSomIQ system on module. 1) Install Ubuntu or Debian to a SD card as described in the previous step 2) Download and extract a small Debian file system as described [[#root_file_system_for_nand]] You will have an archive debian-7.5-bare-armhf-2014-07-07.tar after extracting. Place this archive to the SD card with OS installed in the previous step. 3) Boot the board with the SD card to u-boot and issue the following commands: <code> nand erase.chip mmc rescan load mmc 0 ${loadaddr} MLO nand write ${loadaddr} SPL nand write ${loadaddr} SPL.backup1 </code> Load the u-boot image u-boot.img to NAND. Note that we use the actual size of the u-boot.img file in Hex. If your file has a different size then update this number <code> load mmc 0 ${loadaddr} u-boot.img nand write ${loadaddr} u-boot </code> Load the device tree binary <code> run loadbootenv run importbootenv run findfdt run loadfdt nand write ${fdtaddr} u-boot-spl-os </code> Load the kernel image zImage to NAND. Note that we use the actual size of the zImage file in Hex. If your file has a different size then update this number <code> run loadimage nand write ${loadaddr} kernel </code> 4) Boot farther to OS 5) Prepare a UBIFS partition For more information visit: [[http://processors.wiki.ti.com/index.php/UBIFS_Support]] Preparing NAND partition for modules with 256MB <code> ubiformat /dev/mtd9 -s 2048 -O 2048 ubiattach /dev/ubi_ctrl -m 9 -O 2048 ubimkvol /dev/ubi0 -s 230MiB -N rootfs mount -t ubifs ubi0:rootfs /mnt </code> Preparing NAND partition for modules with 512MB <code> ubiformat /dev/mtd9 -s 2048 -O 2048 ubiattach /dev/ubi_ctrl -m 9 -O 2048 ubimkvol /dev/ubi0 -s 450MiB -N rootfs mount -t ubifs ubi0:rootfs /mnt </code> 6) Install the file system to the UBIFS-partiotion <code> cd /mnt tar xf <path to image>/debian-7.5-bare-armhf-2014-07-07.tar sync </code> 7) Enable the Serial login Edit the file /mnt/etc/inittab as described for the SD card installation. 8) Enable Network Edit the file /mnt/etc/network/interfaces as described for the SD card installation. 9) Remove the SD card and reboot the board

usomiq-kernel-dts.1427395199.txt.gz · Last modified: 2015/03/26 14:39 by maxx