Currently the Tizen project is publishing ARM images, so let me introduce you to how you can use them on other Armv7l hardware. For this tutorial the Renesas RCAR_M2 Evaluation board will be used. Tizen hardware adaptation for Tizen:IVI on rcarm2 was made available by Damian Hobson Garcia, now let me show you how to use the currently available code for Tizen:Common.

Before we go into the technical details, let me remind you of those two addresses that you can use as entry point for Tizen:Common hardware adaption on ARM architecture devices. https://wiki.tizen.org/wiki/ARM

Other CPU are also welcome too since Tizen:Common aims to be profile agnostic and multi architecture too. This time instead of sharing an archive I will just explain how you can create your own, but you can still request it if you want.
 

Video


 

1/ Build platform’s Linux kernel

If your machine is supported by mainline kernel, then you can use kernel-common and try to tune the configuration (using platform flags in spec file), if not you will have to rebuild the kernel from sources, in this case you can rebuild from Damian’s repo using the instructions to setup the toolchains etc.

https://github.com/dhobsong/rcar-m2-tizen-kernel

But you can also rebuild it the Tizen way using gbs (which uses qemu binfmt internally)

First you will need to install gbs tools and setup your “~/.gbs.conf”
(you can replace it with this file :
https://gitorious.org/tizen/tizen-helper/raw/master:config/gbs.conf )

Then just build RPM using :


git clone -b sandbox/pcoval/rcar-m2 review.tizen.org:/profile/common/kernel-common
gbs build -P "profile.tizen_mobile_armv7l" --arch armv7l

RPM wont be used yet, intermediate files will be used later.

2/ Download ARM image

As the partition scheme can vary depending on what machine you are using, this means that there is no “universal images” for ARM just 2 partitions (boot and rootfs).

For this Renesas machine uboot is already included and stored in flash memory, so It’s easy but may be different for others (ie: sunxi devices you must dump an U-Boot image before the 1st partition so I set a general purpose offset).

Here the command lines I used using an 8GB SD Card (it could be reduced to ~2GB) :


sudo parted /dev/sdX -a optimal -s unit b mklabel msdos mkpart primary fat16 0,64,0 1000MB toggle 1 boot print unit mb print
sudo parted /dev/sdX -a optimal -s mkpart primary ext3 1000MB 100% print

Model: Generic- USB3.0 CRW -0 (scsi)
Disk /dev/sdX: 7969MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 2064kB 1000MB 998MB primary fat16 boot, lba
2 1000MB 7969MB 6969MB primary ext4

3/ Dump the partitions

Download tizen-common_20140904.1_common-qa-unsafe-wayland-2parts-armv7l.tar.gz or later from :

http://download.tizen.org/snapshots/tizen/common/latest/images/arm-wayland/common-qa-unsafe-wayland-2parts-armv7l

Then you can mount and rsync contents or if lazy just dump the partitions on the newly created partitions to your sdcard device (replace sdX by the actual one) :


sudo dd if=TZBOOT.img of=/dev/sdX1 bs=8M oflag=sync
sudo dd if=tizen-common.img of=/dev/sdX2 bs=8M oflag=sync

Note for now the boot just contains the kernel for qemu-system-arm as example, so you can skip it.

Make filesystems sane :

sudo fsck /dev/sdX1
sudo fsck /dev/sdX2

4/ install kernel

Now kernel and device tree file should be installed to the 1st partition:


srcdir=${HOME}/tmp-GBS-tizen_common_armv7l/local/BUILD-ROOTS/scratch.armv7l.0/home/abuild/rpmbuild/BUILD/kernel-*/
destdir=/tmp/tmp-root.tmp/mnt/dev/sdX1
sudo mkdir -p $destdir && sudo mount /dev/sdX1/ $destdir

sudo cp -v ${srcdir}/arch/arm/boot/uImage $destdir/
sudo cp -v ${srcdir}/arch/arm/boot/dts/*.dtb $destdir/

4/ boot kernel using uboot

You need to login into serial console using “Debug Serial 0” cable and to display U-Boot bootloader :


sudo screen /dev/ttyUSB0 38400

KOELSCH SPI_LOADER(DDR3L) V0.12 2014.03.14
DEVICE S25FL512

U-Boot 2013.01.01-g1568d0f (May 28 2014 - 16:18:49)

CPU: Renesas Electronics R8A7791 rev 2.0
Board: Koelsch Board

DRAM: 1 GiB
MMC: sh-sdhi: 0, sh-sdhi: 1, sh-sdhi: 2
SF: Detected S25FL512S with page size 256 KiB, total 64 MiB
In: serial
Out: serial
Err: serial
Net: sh_eth
=>

Then just Kernel’s command line load it along devicetree file and boot it at specified addresses:


=> setenv bootargs console=ttySC6,38400 root=/dev/mmcblk0p2 rw earlyprintk earlycon=ttySC6.38400 ignore_loglevel rootwait

=> fatload mmc 0 40007fc0 uImage
reading uImage
3363632 bytes read in 312 ms (10.3 MiB/s)
=> fatload mmc 0 40f00000 r8a7791-koelsch.dtb
reading r8a7791-koelsch.dtb
26451 bytes read in 15 ms (1.7 MiB/s)

bootm 40007fc0 - 40f00000
## Booting kernel from Legacy Image at 40007fc0 ...
Image Name: Linux-3.10.31-20140905.140990676
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3363568 Bytes = 3.2 MiB
Load Address: 40008000
Entry Point: 40008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 40f00000
Booting using the fdt blob at 0x40f00000
XIP Kernel Image ... OK
OK
Loading Device Tree to 40ef6000, end 40eff752 ... OK
Booting Linux on physical CPU 0x0
Linux version 3.10.31-20140905.1409906765pcoval-common-arm-rcar-m2 ([email protected]) (gcc version 4.8.2 (Tizen) ) #1 SMP PREEMPT Fri Sep 5 09:02:19 UTC 2014
CPU: ARMv7 Processor [413fc0f2] revision 2 (ARMv7), cr=30c73c7d
CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
Machine: koelsch, model: Koelsch
(...)

So far, so good so let’s log in using “tizen” password:


localhost login: root
Password:
Welcome to Tizen
[email protected]:~# cat /etc/os-release
NAME=Tizen
VERSION="3.0.0 (Tizen Next)"
ID=tizen
VERSION_ID=3.0.0
PRETTY_NAME="Tizen 3.0.0 (Tizen Next)"
ANSI_COLOR="0;36"
CPE_NAME="cpe:/o:tizen:tizen:3.0.0"
BUILD_ID=tizen-common_20140904.1_common-qa-unsafe-wayland-2parts-armv7l

Note for the absent-minded like me, make sure that you don’t add an extra quote or else you’ll face a mount error ie:


Kernel command line: "console=ttySC6,38400 root=/dev/mmcblk0p2 rootdelay=13 rootwait rw earlyprintk earlycon=ttySC6.38400 ignore_loglevel"
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

5/ Workaround some display issues

Since Tizen:Common does not ship closed source binaries blob, there is no GPU support in this image, until it’s added at this time, we can workaround and use fallback solution to use the display.

If no DRI is available, it will fallback to frame-buffer, but if you have DRI available but improperly set error will be reported in this file :


cat /run/display/weston.log
[16:00:11.098] failed to initialize egl

Desired Wayland backend can be set by changing this file:


grep ExecStart /usr/lib/systemd/system/display-manager-run.service
ExecStart=/usr/bin/weston --backend=fbdev-backend.so -i0 --log=%h/weston.log

Note this should be also changed for EFL toolkit too:


grep -r egl /etc/profile.d/
/etc/profile.d/weston.sh:export ELM_ENGINE=wayland_egl
/etc/profile.d/weston.sh:export ECORE_EVAS_ENGINE=wayland_egl
/etc/profile.d/elm.sh:[ ! -d /dev/dri ] || ELM_ENGINE=wayland_egl

sudo sed -e 's|egl|shm|g' -i /etc/profile.d/*.sh

Will do the trick and make you able to run EFL applications:


/bin/elementary_test # elementary-tools-1.9.3-8.4.armv7l

/usr/apps/org.tizen.calculator/bin/calculator # from org.tizen.calculator-0.1.31-8.2.armv7l

1st is pure EFL 2nd uses the Tizen’s App Framework.

More to come at :

https://bugs.tizen.org/jira/browse/TC-1464
Source: https://dockr.eurogiciel.fr/blogs/embedded/author/pcl/

How to adapt Tizen:Common ARM images to boot renesas rcar

Copyleft: CC-BY-SA ~pcl