Used ubuntu 18.04 for build system. you need to install following packages.
$ sudo apt-get install android-tools-adb android-tools-fastboot autoconf \
automake bc bison build-essential cscope curl device-tree-compiler \
expect flex ftp-upload gdisk iasl libattr1-dev libc6:i386 libcap-dev \
libfdt-dev libftdi-dev libglib2.0-dev libhidapi-dev libncurses5-dev \
libpixman-1-dev libssl-dev libstdc++6:i386 libtool libz1:i386 make \
mtools netcat python-crypto python-serial python-wand unzip uuid-dev \
xdg-utils xterm xz-utils zlib1g-devNote that here you don't install a huge SDK, it's simply a Python script that
you download and put in your $PATH, that's it. Exactly how to "install" repo,
could be found in the Google [repo] pages, so follow those instructions before
continuing.
Choose the manifest corresponding to the platform you intend to use.
$ mkdir -p $HOME/devel/optee
$ cd $HOME/devel/optee
$ repo init -u https://github.build.ge.com/212576259/manifest.git -m nano.xml -b master
$ repo syncThis will take lot of time as it will fetch all the different repo contents and create copies of it in your local.
OP-TEE is using different toolchains for different targets (depends on ARMv8-A 64/32bit solutions). In any case start by downloading the toolchains by:
$ cd build
$ make toolchainsalso NanoPi uses dirrent toolchain so if you want to use one/ same toolchain modify the Makefiles accordigly else do following
$ mkdir -p /opt/FriendlyARM/toolchain
$ tar xf arm-cortexa9-linux-gnueabihf-4.9.3.tar.xz -C /opt/FriendlyARM/toolchain/
$ export PATH=/opt/FriendlyARM/toolchain/4.9.3/bin:$PATH
$ export GCC_COLORS=auto
$ . ~/.bashrcto make the changes effective immidiately
I've configured our repo manifests, so that repo will always automatically
symlink the Makefile to the correct device specific makefile, that means that
you simply start the build by running:
$ make -j12 This step will also take some time.
On the device :
$ make flashThis is just to make sd card ready.
$ cd out-br
$ sudo cp -r rootfs.cpio.gz /media/rootfs##1.8 Copy boot files to sd card
here you have two ways :
- you can copy all the files to sd card
- create a boot.img and copy img to sd card
#Preparing for boot image
$ sudo cp -r ../linux/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi*.dtb .
$ sudo cp -r ../linux/arch/arm64/boot/dts/allwinner/overlay* .
$ sudo cp -r ../linux/arch/arm64/boot/Image .
$ sudo cp ../build/boot.cmd .
$ sudo mkimage -C none -A arm -T script -d boot.cmd boot.scr
#creating boot image
$ cd ..
$ sudo mkisofs -lJR -o boot.iso out-br/
$ sudo dd if=boot.iso of=boot.img
now copy the image to /media/boot partition on sd card remove the card and put it in nanopi neo plus 2 board
once the device boots from sd card login using
$ root
$fa
On some solutions tee-supplicant is already loaded ($ ps aux | grep tee-supplicant) on other not. If it's not loaded, then start it by running:
$ tee-supplicant &here is where I am currently debugging the issue.
The entire xtest test suite has been deployed when you we're running $ make run in previous step, i.e, in general there is no need to copy any binaries
manually. Everything has been put into the root FS automatically. So, to run
xtest, you simply type:
$ xtest-
Creating optee_os for support of Nanopi neo plus 2 board
-
Creating U-boot for Nanopi neo plus 2 board
-
Creating Arm-Trusted Firmware for Nanopi neo plus 2 board