Difference between revisions of "Building VIBE2 Boot Image"

From Yantrr Wiki
Jump to: navigation, search
(Setup microSD card)
(Setup microSD card)
Line 220: Line 220:
 
  4,,L,*
 
  4,,L,*
 
  __EOF__
 
  __EOF__
 +
 +
Format Partition:
 +
 +
With mkfs.ext4 1.43, we need to make sure metadata_csum and 64bit are disabled.
 +
 +
As U-Boot CAN NOT currently handle reading files with these newer ext4 options and so Debian 8 (armel/armhf) and Ubuntu 16.04 (armhf) fsck tools will operate correctly.
 +
mkfs.ext4 -V
 +
mke2fs 1.42.13 (17-May-2015)
 +
Using EXT2FS Library version 1.42.13
  
 
=Install Kernel=
 
=Install Kernel=

Revision as of 23:42, 10 May 2017

Note : All steps are executed on the Ubuntu 16.04.2 LTS and as a root user. Most of the steps are similar Robert C Nelson BBB Wiki.

Basic Requirements

ARM Cross Compiler: GCC

Download and extract the ARM Cross compiler linaro gcc.

~/
wget -c https://releases.linaro.org/components/toolchain/binaries/5.4-2017.01/arm-linux-gnueabihf/gcc-linaro-5.4.1-2017.01-x86_64_arm-linux-gnueabihf.tar.xz
tar xf gcc-linaro-5.4.1-2017.01-x86_64_arm-linux-gnueabihf.tar.xz
export CC=`pwd`/gcc-linaro-5.4.1-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-

Test:

~/
${CC}gcc --version
arm-linux-gnueabihf-gcc (Linaro GCC 5.4-2017.01) 5.4.1 20161213
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Bootloader: U-Boot

Download :

~/
git clone https://github.com/u-boot/u-boot
cd u-boot/
git checkout v2017.03 -b tmp

Patches :

wget -c https://rcn-ee.com/repos/git/u-boot-patches/v2017.03/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch
wget -c https://rcn-ee.com/repos/git/u-boot-patches/v2017.03/0002-U-Boot-BeagleBone-Cape-Manager.patch
 
patch -p1 < 0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch
patch -p1 < 0002-U-Boot-BeagleBone-Cape-Manager.patch

Configure and Build :

~/u-boot
make ARCH=arm CROSS_COMPILE=${CC} distclean
make ARCH=arm CROSS_COMPILE=${CC} am335x_evm_defconfig
make ARCH=arm CROSS_COMPILE=${CC}

Linux Kernel

TI BSP

Download

~/
git clone https://github.com/RobertCNelson/ti-linux-kernel-dev.git
cd ti-linux-kernel-dev/

For TI v4.4.x:

~/ti-linux-kernel-dev
git checkout origin/ti-linux-4.4.y -b ti-linux-4.4.y

Update GCC cross compiler path in system.sh

cp system.sh.sample system.sh

Update CC variable with path with GCC compiler path set above

nano system.sh
CC=/home/yantrr/gcc-linaro-5.4.1-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-

Build

~/ti-linux-kernel-dev/
./build_kernel.sh

Update LINUX_GIT variable in system.sh

nano system.sh
LINUX_GIT=/home/yantrr/ti-linux-kernel-dev/ignore/linux-src/

Change USB0 Mode :

For VIBE/VIBE2, very first you need to change the USB0 dr_mode from peripheral to host in Beaglebone Black kernel source file KERNEL/arch/arm/boot/dts/am335x-bone-common.dtsi while rebuilding the kernel

&usb0 {
       status = "okay";
       dr_mode = "host";
};

ZTE and Telit modems driver are already in Beaglebone Black kernel source version 4.4, so no need of any patch for it.

USB Driver configuration for SEW modems:

Only needed for SEW modems.

nano KERNEL/drivers/usb/serial/option.c
/* Yantrr Strongrising products */
#define YANTRR_VENDOR_ID        0x21f5
#define YANTRR_PRODUCT_VAYU3GH    0x2012
#define YANTRR_PRODUCT_VAYU3GC    0x2009
#define YANTRR_DONGLE_ID        0x20a6
#define YANTRR_DONGLE_PRODUCT    0x1105
/*Also, add entries in struct usb_device_id option_ids[]*/
{ USB_DEVICE(YANTRR_VENDOR_ID, YANTRR_PRODUCT_VAYU3GH) },
{ USB_DEVICE(YANTRR_VENDOR_ID, YANTRR_PRODUCT_VAYU3GC) },
{ USB_DEVICE(YANTRR_DONGLE_ID, YANTRR_DONGLE_PRODUCT) },

Rebuild Kernel

~/ti-linux-kernel-dev
./tools/rebuild.sh
VIBE2 Kernel 4.4

Check for PPS support under Device Drivers ---> PPS Support

VIBE2 PPS Support


Final output on terminal :

-----------------------------
'arch/arm/boot/zImage' -> '/home/yantrr/ti-linux-kernel-dev/deploy/4.4.62-ti-r99.zImage'
'.config' -> '/home/yantrr/ti-linux-kernel-dev/deploy/config-4.4.62-ti-r99'
-rwxr-xr-x 1 root root 8.3M May  2 14:58 /home/yantrr/ti-linux-kernel-dev/deploy/4.4.62-ti-r99.zImage
-----------------------------
Building modules archive...
Compressing 4.4.62-ti-r99-modules.tar.gz...
-rw-r--r-- 1 root root 22M May  2 14:58 /home/yantrr/ti-linux-kernel-dev/deploy/4.4.62-ti-r99-modules.tar.gz
-----------------------------
Building firmware archive...
Compressing 4.4.62-ti-r99-firmware.tar.gz...
-rw-r--r-- 1 root root 1.2M May  2 14:58 /home/yantrr/ti-linux-kernel-dev/deploy/4.4.62-ti-r99-firmware.tar.gz
-----------------------------
Building dtbs archive...
Compressing 4.4.62-ti-r99-dtbs.tar.gz...
-rw-r--r-- 1 root root 1.4M May  2 14:58 /home/yantrr/ti-linux-kernel-dev/deploy/4.4.62-ti-r99-dtbs.tar.gz
-----------------------------
Script Complete
eewiki.net: [user@localhost:~$ export kernel_version=4.4.62-ti-r99]
-----------------------------

Root File System

Debian 8

User Password
debian temppwd
root root

Download:

~/
wget -c https://rcn-ee.com/rootfs/eewiki/minfs/debian-8.7-minimal-armhf-2017-03-02.tar.xz

Verify:

~/
sha256sum debian-8.7-minimal-armhf-2017-03-02.tar.xz
1ef9c2620ff3f26f7fab839e0a430426110de7dbc7a818d6d89d9abb239d4d23  debian-8.7-minimal-armhf-2017-03-02.tar.xz

Extract:

~/
tar xf debian-8.7-minimal-armhf-2017-03-02.tar.xz

Ubuntu 16.04 LTS

User Password
ubuntu temppwd

Download:

~/
wget -c https://rcn-ee.com/rootfs/eewiki/minfs/ubuntu-16.04.2-minimal-armhf-2017-03-02.tar.xz

Verify:

~/
sha256sum ubuntu-16.04.2-minimal-armhf-2017-03-02.tar.xz
294b2156f71f03a7a297cfaa3edcb6e63b6ad95d46969210e0af231e4e5dd098  ubuntu-16.04.2-minimal-armhf-2017-03-02.tar.xz

Extract:

~/
tar xf ubuntu-16.04.2-minimal-armhf-2017-03-02.tar.xz

Setup microSD card

We are assuming the DISK=/dev/sdc, Please check the device id of SD-Card with lsblk

export DISK=/dev/sdc

Erase partition table/labels on microSD card:

dd if=/dev/zero of=${DISK} bs=1M

Install Bootloader:

~/
dd if=./u-boot/MLO of=${DISK} count=1 seek=1 bs=128k
dd if=./u-boot/u-boot.img of=${DISK} count=2 seek=1 bs=384k

Create Partition Layout: With util-linux v2.26, sfdisk was rewritten and is now based on libfdisk.

sfdisk --version
sfdisk from util-linux 2.27.1

For sfdisk >= 2.26.x

sfdisk ${DISK} <<-__EOF__
4M,,L,*
__EOF__

For sfdisk <= 2.25.x

sfdisk --unit M ${DISK} <<-__EOF__
4,,L,*
__EOF__

Format Partition:

With mkfs.ext4 1.43, we need to make sure metadata_csum and 64bit are disabled.

As U-Boot CAN NOT currently handle reading files with these newer ext4 options and so Debian 8 (armel/armhf) and Ubuntu 16.04 (armhf) fsck tools will operate correctly.

mkfs.ext4 -V
mke2fs 1.42.13 (17-May-2015)
	Using EXT2FS Library version 1.42.13

Install Kernel

Copy compiled kernel files to already bootable SD-card

~/ti-linux-kernel-dev
export kernel_version=4.4.62-ti-r99
cp -v deploy/${kernel_version}.zImage /media/yantrr/rootfs/boot/vmlinuz-${kernel_version}
mkdir -p /media/yantrr/rootfs/boot/dtbs/${kernel_version}/
tar xfv deploy/${kernel_version}-dtbs.tar.gz -C /media/yantrr/rootfs/boot/dtbs/${kernel_version}/
tar xfv deploy/${kernel_version}-firmware.tar.gz -C /media/yantrr/rootfs/lib/firmware/
tar xfv deploy/${kernel_version}-modules.tar.gz -C /media/yantrr/rootfs/
nano /media/yantrr/rootfs/boot/uEnv.txt
sync
lsblk
umount /dev/sdb1
eject /dev/sdb