User:Xen intruction setup for dra7xx-evm board

From Xen
Revision as of 13:49, 23 June 2016 by Oleksii.kurochko (talk | contribs) (Created page with "= Introduction = The purpose of this tutorial is to run Xen on dra7xx-evm board. Some commands are to be executed on the Linux development host, some on the Linux target and...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Introduction

The purpose of this tutorial is to run Xen on dra7xx-evm board.

Some commands are to be executed on the Linux development host, some on the Linux target and some on the u-boot (bootloader) prompt. The following conventions are used to distinguish the commands on a host and on the target:

  • host $ <this command is to be executed on the host>
  • target # <this command is to be executed on the target>
  • u-boot :> <this command is to be executed on the u-boot prompt>

Setup instruction

Download patches on ti-glsdk and Xen

git clone https://github.com/inisider/gl_patches

Download and setup ti-glsdk

Download and setup ti-glsdk_dra7xx-evm_7_04_00_03 according to http://processors.wiki.ti.com/index.php/OMAP5_GLSDK_Software_Developers_Guide ( do just step 2 from this guide )

Apply glsdk patches

  • $ cd $GL_SDK
  • $ git am <path_to_folder_with_unzip_archive>/glsdk/*.patch

Build yocto file system

Build yocto filesystem system according to http://processors.wiki.ti.com/index.php/OMAP5_GLSDK_Software_Developers_Guide ( do step 4 from this guide )

Build Xen

Install packages

install checkpolicy, flex on host system

Get Xen

git clone git://xenbits.xen.org/xen.git

Change branch

git checkout stable-4.6

Apply patches on Xen

$ git am <path_to_folder_witn_unziped_archove>/xen/*.patch

Creating environment and build Xen/tools

Creating envrinment and build Xen

$ export DRA7_SYSROOT=<path_to_glsdk>/yocto-layers/build/arago-tmp-external-linaro-toolchain/sysroots/dra7xx-evm
$ export TOOLCHAIN=<path_to_toolchain_folder_that_you_entered_when_setup_ti_glsdk>
$ export PATH=$TOOLCHAIN/bin:$PATH
$ export SDKTARGETSYSROOT=$DRA7_SYSROOT
$ export PKG_CONFIG_SYSROOT_DIR=$DRA7_SYSROOT
$ export PKG_CONFIG_PATH=$DRA7_SYSROOT/usr/lib/pkgconfig:$DRA7_SYSROOT/usr/share/pkgconfig
$ export CFLAGS=" -isystem$DRA7_SYSROOT/usr/include -fstack-protector -O2 -pipe -g -feliminate-unused-debug-types  --sysroot=$DRA7_SYSROOT"
$ make -j3 xen XEN_TARGET_ARCH=arm32 CROSS_COMPILE=arm-linux-gnueabihf- XSM_ENABLE=y HAS_REMOTEPROC=y debug=y CONFIG_EARLY_PRINTK=dra7

Creating Xen image

$ mkimage -A arm -C none -T kernel -a 0x90000000 -e 0x90000000 -n "XEN" -d xen/xen xen-uImage

Creating envinroment and build dist-tools

$ export LDFLAGS="-L$DRA7_SYSROOT/usr/lib  -Wl,-rpath-link,$TOOLCHAIN/arm-linux-gnueabihf/lib --sysroot=$DRA7_SYSROOT"
$ ./configure --build=x86_64-unknown-linux-gnu --host=arm-linux-gnueabihf LIBNL3_CFLAGS=-I$DRA7_SYSROOT/usr/include/libnl3
$ make -j3 dist-tools CROSS_COMPILE=arm-linux-gnueabihf- XEN_TARGET_ARCH=arm32 XSM_ENABLE=y CONFIG_QEMU_XEN=n

Createing xenpolicy image

$ mkimage -A arm -C none -T filesystem -n "XP" -a 0xc3000000 -d tools/flask/policy/xenpolicy-4.6.2-pre xenpolicy-uImage

Copy built images to glsdk

$ copy xen-uIamge and xenpolicy-uImage to <path_to_glsdk>/board-support/prebuilt-images/

Make sd boot

Insert SD card to your PC’s card reader. SD card will be used for boot. ALL DATA ON THIS CARD WILL BE LOST.

$ cd {GL_SDK}
$ ./bin/mksdboot.sh --device /dev/sdX --sdk ${GLSDK}, where /dev/sdX is a SD block device node

Setup u-boot environment

Insert sd card to board

Start minicom

  • # ll /dev/ttyUSB*
  • # sudo minicom -D /dev/ttyUSBx, where x - is number for previous step

Entering u-boot console

Press and hold C while powering a board to enter U-Boot console

Set environment variables

:> env default -a -f
:> env set bootcmd “run findfdt;fatload mmc 0:1 0xc1000000 xen-uimage;fatload mmc 0:1 0xc2ffffc0 xenpolicy-uimage;ext4load mmc 0:2 0xc0000000 boot/zImage;ext4load mmc 0:2 0xc2f00000 boot/dra7-evm-dom0-lcd7.dtb;bootm 0xc1000000 - 0xc2f00000”
:> saveenv