Abuse filter log

Abuse Filter navigation (Home | Recent filter changes | Examine past edits | Abuse log)
Jump to: navigation, search

This log shows a list of all actions caught by the filters.

Details for log entry 256

20:24, 1 April 2015: Thuandinh (talk | contribs) triggered filter 32, performing the action "edit" on User:Thuandinh. Actions taken: Disallow; Filter description: Stops addition of external links on User page as first action. (examine)

Changes made in edit

 +
{{TOC right}}
 +
This page contains information on building and running Yocto on [[R-Car/Boards/SILK | Renesas R-Car E2 SILK]] and [[R-Car/Boards/Porter|Renesas R-Car M2 Porter]] boards.
  
 +
== Yocto versions ==
 +
[http://git.yoctoproject.org/cgit/cgit.cgi/poky/tag/?id=yocto-1.6.1 Poky-1.6.1] is supported. Specific commit of meta-openembedded is required.
 +
 +
== Preliminary steps ==
 +
<ol>
 +
<li>Download proprietary graphics and multimedia drivers from Renesas. Evaluation version is available at http://www.renesas.com/secret/r_car_download/rcar_demoboard.jsp<br/>
 +
Graphic drivers are required for X11 and Wayland. Multimedia drivers are optional.<br/>
 +
<br/>
 +
</li>
 +
 +
<li> Install required packages
 +
===== Ubuntu and Debian =====
 +
<pre>
 +
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
 +
    build-essential chrpath socat libsdl1.2-dev xterm
 +
</pre>
 +
===== Fedora =====
 +
<pre>
 +
sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \
 +
    diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \
 +
    ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue socat \
 +
    SDL-devel xterm
 +
</pre>
 +
Refer to [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html#packages Yocto Project Quick Start] for more information.
 +
</li>
 +
</ol>
 +
 +
== Building the BSP for Renesas R-Car SILK and Porter ==
 +
<ol>
 +
<li>Create a directory and switch to it <br/>
 +
Warning! Yocto builds require a lot of disk space (up to 100 GB). Make sure you have got enough before starting the build.
 +
<pre>
 +
export WORK=<path-to-your-build-directory>
 +
mkdir $WORK
 +
cd $WORK
 +
</pre>
 +
</li>
 +
<li>Clone basic Yocto layers:
 +
<pre>
 +
cd $WORK
 +
git clone git://git.yoctoproject.org/poky
 +
git clone git://git.openembedded.org/meta-openembedded
 +
git clone git://git.linaro.org/openembedded/meta-linaro.git
 +
</pre>
 +
</li>
 +
<li>
 +
Switch to proper branches/commits
 +
<pre>
 +
cd $WORK/poky
 +
git checkout -b tmp yocto-1.6.1
 +
cd $WORK/meta-openembedded
 +
git checkout -b tmp dca466c074c9a35bc0133e7e0d65cca0731e2acf
 +
cd $WORK/meta-linaro
 +
git checkout -b tmp 8a0601723c06fdb75e62aa0f0cf15fc9d7d90167
 +
</pre>
 +
Another versions are not tested for compatibility.
 +
</li>
 +
 +
<li>
 +
Clone Renesas BSP layer and switch to the proper branch:
 +
<pre>
 +
cd $WORK
 +
git clone git://git.yoctoproject.org/meta-renesas/
 +
cd meta-renesas
 +
git checkout -b tmp 1c029141738865c4500f47549807411f4da469a8
 +
</pre>
 +
</li>
 +
 +
<li>
 +
Clone Renesas LCB layer and switch to the proper branch:
 +
<pre>
 +
cd $WORK
 +
git clone https://github.com/cogentembedded/meta-renesas-lcb.git
 +
cd meta-renesas-lcb
 +
git checkout -b tmp origin/v160
 +
</pre>
 +
</li>
 +
<li>
 +
Download proprietary driver modules from http://www.renesas.com/secret/r_car_download/rcar_demoboard.jsp and unzip them to $WORK/proprietary folder.<br/>
 +
You should see the following files:
 +
<pre>
 +
[builduser@builduser meta-renesas-lcb]$ ls -lh $WORK/proprietary
 +
total 4.2M
 +
-rw-r--r--. 1 builduser builduser 3.0M Jan  9 15:26 R-Car_Series_Evaluation_Software_Package_for_Linux-20150109.tar.gz
 +
-rw-r--r--. 1 builduser builduser 1.2M Jan  9 12:49 R-Car_Series_Evaluation_Software_Package_of_Linux_Drivers-20150109.tar.gz
 +
</pre>
 +
</li>
 +
<li>
 +
Populate meta-renesas-lcb with graphics drivers.<br/>
 +
For [[R-Car/Boards/SILK|SILK]] board run:
 +
<pre>
 +
cd $WORK/meta-renesas-lcb
 +
./copy_gfx_software_silk.sh ../proprietary
 +
</pre>
 +
For [[R-Car/Boards/Porter|Porter]] board run:
 +
<pre>
 +
cd $WORK/meta-renesas-lcb
 +
./copy_gfx_software_porter.sh ../proprietary
 +
</pre>
 +
</li>
 +
<li>
 +
Populate meta-renesas-lcb with multimedia drivers.
 +
<pre>
 +
cd $WORK/meta-renesas-lcb
 +
./copy_mm_software_lcb.sh ../proprietary
 +
</pre>
 +
</li>
 +
 +
<li>
 +
Setup build environment
 +
<pre>
 +
cd $WORK
 +
source poky/oe-init-build-env
 +
</pre>
 +
</li>
 +
 +
<li>
 +
Prepare default configuration files. <br/>
 +
For [[R-Car/Boards/SILK|SILK]] board run:
 +
<pre>
 +
cd $WORK/build
 +
cp ../meta-renesas-lcb/lcb-configs/bblayers.conf ./conf
 +
cp ../meta-renesas-lcb/lcb-configs/local-silk.conf ./conf/local.conf
 +
</pre>
 +
For [[R-Car/Boards/Porter|Porter]] board run:
 +
<pre>
 +
cd $WORK/build
 +
cp ../meta-renesas-lcb/lcb-configs/bblayers.conf ./conf
 +
cp ../meta-renesas-lcb/lcb-configs/local-porter.conf ./conf/local.conf
 +
</pre>
 +
Edit '''local.conf''' to select graphic environment (X11 or wayland/weston) and enable/disable graphics and multimedia proprietary drivers support.
 +
</li>
 +
 +
<li>
 +
Start the build <br />
 +
For weston/wayland:
 +
<pre>
 +
bitbake core-image-weston
 +
</pre>
 +
For X11:
 +
<pre>
 +
bitbake core-image-x11
 +
</pre>
 +
</li>
 +
 +
<li>
 +
Building image can take upto a few hours depending on your host system performance.<br>
 +
After the build has been completed successfuly, you should see the output similar to:
 +
<pre class="bash">
 +
NOTE: Tasks Summary: Attempted 4704 tasks of which 31 didn't need to be rerun and all succeeded.
 +
</pre>
 +
and the command prompt should return.
 +
</li>
 +
 +
<li>
 +
Bitbake has generated all the necessary files in ./tmp/deploy/images directory. <br/>
 +
You can verify its content:
 +
<pre class="bash">
 +
[builduser]$ ls -lh `find ./tmp/deploy/images/silk/ -maxdepth 1 -type l -print`
 +
lrwxrwxrwx. 1 builduser builduser 50 Dec  9 02:47 ./tmp/deploy/images/silk/core-image-x11-silk.manifest -> core-image-x11-silk-20141208223655.builduserfs.manifest
 +
lrwxrwxrwx. 1 builduser builduser 49 Dec  9 02:47 ./tmp/deploy/images/silk/core-image-x11-silk.tar.bz2 -> core-image-x11-silk-20141208223655.builduserfs.tar.bz2
 +
lrwxrwxrwx. 1 builduser builduser 84 Dec  9 02:43 ./tmp/deploy/images/silk/modules-silk.tgz -> modules--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655.tgz
 +
lrwxrwxrwx. 1 builduser builduser 52 Dec  9 02:46 ./tmp/deploy/images/silk/u-boot.bin -> u-boot-silk-v2013.01.01+gitAUTOINC+74b16badc2-r0.bin
 +
lrwxrwxrwx. 1 builduser builduser 52 Dec  9 02:46 ./tmp/deploy/images/silk/u-boot-silk.bin -> u-boot-silk-v2013.01.01+gitAUTOINC+74b16badc2-r0.bin
 +
lrwxrwxrwx. 1 builduser builduser 83 Dec  9 02:43 ./tmp/deploy/images/silk/uImage -> uImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655.bin
 +
lrwxrwxrwx. 1 builduser builduser 83 Dec  9 02:43 ./tmp/deploy/images/silk/uImage+dtb -> uImage+dtb--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655
 +
lrwxrwxrwx. 1 builduser builduser 91 Dec  9 02:43 ./tmp/deploy/images/silk/uImage-r8a7794-silk.dtb -> uImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-r8a7794-silk-20141208223655.dtb
 +
lrwxrwxrwx. 1 builduser builduser 83 Dec  9 02:43 ./tmp/deploy/images/silk/uImage-silk.bin -> uImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655.bin
 +
lrwxrwxrwx. 1 builduser builduser 79 Dec  9 02:43 ./tmp/deploy/images/silk/zImage -> zImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655
 +
lrwxrwxrwx. 1 builduser builduser 83 Dec  9 02:43 ./tmp/deploy/images/silk/zImage+dtb -> zImage+dtb--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655
 +
</pre>
 +
'''modules-silk.tgz''' is compressed Kernel image, '''core-image-x11-silk.tar.bz2''' is the rootfs, '''modules-silk.tgz''' are kernel modules.
 +
</li>
 +
<li>
 +
You can now [[R-Car/Boards/SILK#Booting over TFTP from U-Boot|boot R-Car E2 SILK board over TFTP and NFS]]
 +
</li>
 +
</ol>
 +
 +
== Running Yocto image ==
 +
Linux kernel can be booted from microSD card or from TFTP. Root FS can be mounted from micro SD card or via NFS.
 +
 +
=== Loading kernel via TFTP and rootfs via NFS ===
 +
Follow these steps to setup working TFTP and NFS server:
 +
<ol>
 +
<li>
 +
Setup a TFTP server.
 +
==== Ubuntu ====
 +
Install '''tftpd-hpa''' package along with tftp tools:
 +
<pre>
 +
sudo apt-get install tftp tftpd-hpa
 +
</pre>
 +
 +
==== Fedora ====
 +
<ol>
 +
<li>
 +
Install necessary packages:
 +
<pre>
 +
sudo yum install tftp-server tftp
 +
</pre>
 +
tftp-server is a part of xinetd. See [http://docs.fedoraproject.org/en-US/Fedora/20/html/Installation_Guide/ch13s05s03.html Fedora manual] for more information.
 +
</li>
 +
<li>
 +
Enable TFTP server:
 +
<pre>
 +
sudo vi /etc/xinetd.d/tftp
 +
</pre>
 +
Set <pre>disable = no</pre> Save file and exit.
 +
</li>
 +
<li>
 +
Start xinetd:
 +
<pre>
 +
sudo systemctl start xinetd.service
 +
sudo systemctl enable xinetd.service
 +
</pre>
 +
</li>
 +
</ol>
 +
 +
</li>
 +
 +
<li>
 +
Copy '''uImage''' and '''uImage-r8a7794-silk.dtb''' from $WORK/build/tmp/deploy/images/silk/ to TFTP server root.
 +
==== Ubuntu ====
 +
<pre>
 +
cp $WORK/build/tmp/deploy/images/silk/uImage /srv/tftp/
 +
cp $WORK/build/tmp/deploy/images/silk/uImage-r8a7794-silk.dtb /srv/tftp/
 +
</pre>
 +
 +
==== Fedora ====
 +
<pre>
 +
cp $WORK/build/tmp/deploy/images/silk/uImage /var/lib/tftpboot/
 +
cp $WORK/build/tmp/deploy/images/silk/uImage-r8a7794-silk.dtb /var/lib/tftpboot/
 +
</pre>
 +
</li>
 +
 +
<li>
 +
Verify that TFTP server is working.
 +
<pre>
 +
tftp localhost -c get uImage && ls uImage
 +
</pre>
 +
</li>
 +
 +
<li>
 +
Setup NFS server.
 +
==== Debian/Ubuntu ====
 +
<ol>
 +
<li>
 +
Install necessary packages:
 +
<pre>
 +
sudo apt-get install nfs-kernel-server nfs-common
 +
</pre>
 +
</li>
 +
<li>
 +
Start NFS server:
 +
<pre>
 +
sudo /etc/init.d/nfs-kernel-server start
 +
</pre>
 +
</li>
 +
</ol>
 +
 +
==== Fedora ====
 +
<ol>
 +
<li>
 +
Install necessary packages:
 +
<pre>
 +
sudo yum install nfs-utils
 +
</pre>
 +
</li>
 +
<li>
 +
Enable and start nfs server:
 +
<pre>
 +
sudo systemctl enable rpcbind.service
 +
sudo systemctl enable nfs-server.service
 +
sudo systemctl enable nfs-lock.service
 +
sudo systemctl enable nfs-idmap.service
 +
sudo systemctl start rpcbind.service
 +
sudo systemctl start nfs-server.service
 +
sudo systemctl start nfs-lock.service
 +
sudo systemctl start nfs-idmap.service
 +
</pre>
 +
</li>
 +
</ol>
 +
</li>
 +
 +
<li>
 +
Export root FS to NFS. (Change IMAGE and MACHINE to fit your build).
 +
<ol>
 +
<li>
 +
Unpack rootfs to a dedicated directory:
 +
<pre>
 +
IMAGE=weston|x11|sato|directfb
 +
MACHINE=silk|porter
 +
NFS_ROOT=/nfs/${MACHINE}
 +
sudo mkdir -p "${NFS_ROOT}"
 +
sudo rm -rf "${NFS_ROOT}"/*
 +
sudo tar -xjf "${WORK}/build/tmp/deploy/images/${MACHINE}/core-image-${IMAGE}-${MACHINE}.tar.bz2" -C "${NFS_ROOT}"
 +
sync
 +
</pre>
 +
</li>
 +
<li>
 +
Edit '''/etc/exports''':
 +
<pre>
 +
sudo vi /etc/exports
 +
</pre>
 +
add
 +
<pre>
 +
/nfs/silk *(rw,no_subtree_check,sync,no_root_squash,no_all_squash)
 +
/nfs/porter *(rw,no_subtree_check,sync,no_root_squash,no_all_squash)
 +
</pre>
 +
Save the file and exit.
 +
</li>
 +
<li>
 +
Force NFS server to re-read /etc/exports
 +
<pre>sudo exportfs -a</pre>
 +
</li>
 +
</ol>
 +
</li>
 +
<li>
 +
Verify that NFS is working.
 +
<pre>
 +
[builduser@buildmachine ~]$ showmount -e localhost
 +
Export list for localhost:
 +
/nfs/silk *
 +
/nfs/porter *
 +
</pre>
 +
</li>
 +
 +
<li><span id="Boot into U-Boot command prompt">Boot into U-Boot command prompt</span>
 +
===== For [[R-Car/Boards/SILK|SILK board]] =====
 +
<ol>
 +
<li>
 +
Make sure SW9 is on pin 1 side. <br/>
 +
[[File:SILKSwitch.png|100px|Switch pin layout]]
 +
</li>
 +
<li>
 +
Connect to serial console over microUSB using minicom or picocom.
 +
</li>
 +
<li>
 +
Switch the board on or reset it. Press any key to stop U-Boot automatic countdown.
 +
</li>
 +
</ol>
 +
Refer to [[R-Car/Boards/SILK#Power on the board and go to U-Boot prompt|SILK board page]] for more information.
 +
===== For [[R-Car/Boards/Porter|Porter board]] =====
 +
<ol>
 +
<li>
 +
TBD
 +
</li>
 +
</ol>
 +
 +
</li>
 +
 +
<li>
 +
Configure Ethernet, TFTP, and kernel command line in U-Boot:
 +
<!--setenv ethaddr xx:xx:xx:xx:xx:xx
 +
Replace xx:xx:xx:xx:xx:xx with the MAC address of your board. It should be on the sticker on top of the Ethernet port.<br/>
 +
-->
 +
<pre>
 +
setenv ipaddr <board-ip>
 +
setenv serverip <your-computer-ip>
 +
setenv bootcmd 'tftp 0x40007fc0 uImage; tftp 0x40f00000 uImage-r8a7794-silk.dtb; bootm 0x40007fc0 - 0x40f00000'
 +
setenv bootargs 'console=ttySC10,38400 ignore_loglevel rw root=/dev/nfs nfsroot=<your-computer-ip>:<nfs-path>,nfsvers=3 ip=<board-ip>:<your-computer-ip>::255.255.255.0:silk vmalloc=384M'
 +
saveenv
 +
</pre>
 +
Replace <board-ip> with the proper IP address for the board.  Replace <your-computer-ip> with the IP address of your computer, where tftp and nfs servers are installed. Replace <nfs-path> with the exported path of the root FS. <br/> For example:
 +
<pre>
 +
setenv ipaddr 192.168.1.3
 +
setenv serverip 192.168.1.2
 +
setenv bootcmd 'tftp 0x40007fc0 uImage; tftp 0x40f00000 uImage-r8a7794-silk.dtb; bootm 0x40007fc0 - 0x40f00000'
 +
setenv bootargs 'console=ttySC10,38400 ignore_loglevel rw root=/dev/nfs nfsroot=192.168.1.2:/nfs/silk,nfsvers=3 ip=192.168.1.3:192.168.1.2::255.255.255.0:silk vmalloc=384M'
 +
saveenv
 +
</pre>
 +
The last command writes the configuration to SPI flash.
 +
<pre>
 +
=> saveenv                                                                                                                                 
 +
Saving Environment to SPI Flash...                                                                                                         
 +
SF: Detected S25FL512S with page size 256 KiB, total 64 MiB                                                                               
 +
Erasing SPI flash...Writing to SPI flash...done
 +
</pre>
 +
You can also use
 +
<pre>
 +
dhcp
 +
</pre>
 +
command to obtain information from DHCP server.<br/>
 +
'''Note:''' You can always see the environment with ''printenv'' command.  Refer to [http://www.denx.de/wiki/U-Boot/Documentation U-Boot manual] for details.
 +
</li>
 +
 +
<li>
 +
Verify the connection over Ethernet from U-Boot:
 +
<pre>
 +
ping <your-computer-ip>
 +
</pre>
 +
You should see:
 +
<pre>
 +
=> ping 192.168.1.2                                                                                                               
 +
sh_eth Waiting for PHY auto negotiation to complete... done
 +
sh_eth: 100Base/Full
 +
Using sh_eth device
 +
host 192.168.1.2 is alive
 +
</pre>
 +
</li>
 +
 +
<li>
 +
Reset the board by pushing [[R-Car/Boards/SILK:Hardware#Switches and Buttons|SW5 "Reset"]].
 +
</li>
 +
 +
<li>
 +
The board should boot the kernel:
 +
<pre>
 +
SILK SPI_LOADER V0.07c 2014.10.20                                                                                                         
 +
DEVICE S25FL512                                                                                                                           
 +
                                                                                                                                           
 +
                                                                                                                                           
 +
U-Boot 2013.01.01-g74b16ba-dirty (Dec 23 2014 - 15:31:50)                                                                                 
 +
                                                                                                                                           
 +
CPU: Renesas Electronics R8A7794 rev 1.0                                                                                                   
 +
Board: Silk Board                                                                                                                         
 +
                                                                                                                                           
 +
DRAM:  1 GiB                                                                                                                               
 +
MMC:  sh_mmcif: 0, sh-sdhi: 1                                                                                                             
 +
SF: Detected S25FL512S with page size 256 KiB, total 64 MiB                                                                               
 +
In:    serial                                                                                                                             
 +
Out:  serial                                                                                                                             
 +
Err:  serial                                                                                                                             
 +
Net:  sh_eth                                                                                                                             
 +
Hit any key to stop autoboot:  0                                                                                                           
 +
sh_eth Waiting for PHY auto negotiation to complete... done                                                                               
 +
sh_eth: 100Base/Full                                                                                                                       
 +
Using sh_eth device                                                                                                                       
 +
TFTP from server 192.168.1.2; our IP address is 192.168.1.3                                                                           
 +
Filename 'uImage'.                                                                                                                         
 +
Load address: 0x40007fc0                                                                                                                   
 +
Loading: #################################################################                                                                 
 +
        #################################################################                                                                 
 +
        #################################################################                                                                 
 +
        ##############################################                                                                                   
 +
        3.5 MiB/s                                                                                                                         
 +
done                                                                                                                                       
 +
Bytes transferred = 3525472 (35cb60 hex)                                                                                                   
 +
sh_eth:1 is connected to sh_eth.  Reconnecting to sh_eth                                                                                   
 +
sh_eth Waiting for PHY auto negotiation to complete... done                                                                               
 +
sh_eth: 100Base/Full                                                                                                                       
 +
Using sh_eth device                                                                                                                       
 +
TFTP from server 192.168.1.2; our IP address is 192.168.1.3                                                                           
 +
Filename 'uImage-r8a7794-silk.dtb'.                                                                                                       
 +
Load address: 0x40f00000                                                                                                                   
 +
Loading: ##                                                                                                                               
 +
        3 MiB/s                                                                                                                           
 +
done                                                                                                                                       
 +
Bytes transferred = 24859 (611b hex)                                                                                                       
 +
## Booting kernel from Legacy Image at 40007fc0 ...                                                                                       
 +
  Image Name:  Linux-3.10.31-ltsi                                                                                                       
 +
  Image Type:  ARM Linux Kernel Image (uncompressed)                                                                                     
 +
  Data Size:    3525408 Bytes = 3.4 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 40eff11a ... OK                                                                                   
 +
                                                                                                                                           
 +
Starting kernel ...                                                                                                                       
 +
</pre>
 +
</li>
 +
</ol>
 +
 +
=== Loading kernel and rootfs from microSD card ===
 +
Both kernel and root FS can be loaded from a microSD card. The approach requires only a console cable. No Ethernet connection is needed.
 +
<ol>
 +
<li>
 +
Find a reliable microSD card with an adapter to fit your computer. 4 GB should be enough for the task.
 +
</li>
 +
 +
<li>
 +
Plug the SD card into you computer. Locate the proper device for it, typically '''/dev/mmcblk0'''. Use
 +
<pre>
 +
dmesg | tail
 +
</pre>
 +
to print latest messages if in doubt.<br/>
 +
<span style="color:#ff0000">'''WARNING!''' Be very careful. Do not select you root partition or any other device with important information.  It may be destroyed!</span><br/>
 +
Double-check that device name is correct by mounting and examining it's content.
 +
</li>
 +
 +
<li>
 +
Make sure the SD card doesn't contain any important files.<br/>
 +
<span style="color:#ff0000">'''WARNING!''' Next step may erase the SD card completely. All files my be lost.</span>
 +
</li>
 +
 +
<li>
 +
Format the card with one partition with EXT3 file system.<br/>
 +
''TBD Update this page with a script which formats the card''
 +
</li>
 +
 +
<li>
 +
Copy root fs to the sd card:
 +
<pre>
 +
SD=<path-to-your-device-partition>
 +
SD_ROOT=/tmp/sd-tool
 +
sudo umount "${SD}"
 +
sudo mkdir -p "${SD_ROOT}"
 +
sudo mount "${SD}" "${SD_ROOT}"
 +
sudo rm -rf "${SD_ROOT}"/*
 +
sudo tar -xjf "${BUILDDIR}/tmp/deploy/images/${MACHINE}/core-image-${IMAGE}-${MACHINE}.tar.bz2" -C "${SD_ROOT}"
 +
sudo umount "${SD}"
 +
</pre>
 +
</li>
 +
 +
<li>
 +
Insert the SD card into microSD slot on the board.
 +
</li>
 +
 +
<li> Boot the board into U-Boot command prompt. Refer to section [[R-Car/Boards/Yocto#Boot into U-Boot command prompt|Boot into U-Boot command prompt]]
 +
</li>
 +
 +
<li>
 +
Configure kernel command line in U-Boot:
 +
<pre>
 +
setenv bootcmd 'ext4load mmc 1:1 0x40007fc0 /boot/uImage+dtb; bootm 0x40007fc0'
 +
setenv bootargs 'console=ttySC10,38400 ignore_loglevel rw rootfstype=ext3 root=/dev/mmcblk0p1 rootwait vmalloc=384M'
 +
saveenv
 +
</pre>
 +
The last command writes the configuration to SPI flash.
 +
<pre>
 +
=> saveenv                                                                                                                                 
 +
Saving Environment to SPI Flash...                                                                                                         
 +
SF: Detected S25FL512S with page size 256 KiB, total 64 MiB                                                                               
 +
Erasing SPI flash...Writing to SPI flash...done
 +
</pre>
 +
</li>
 +
 +
<li>
 +
Reset the board by pushing [[R-Car/Boards/SILK:Hardware#Switches and Buttons|SW5 "Reset"]].
 +
</li>
 +
 +
<li>
 +
The board should boot the kernel:
 +
<pre>
 +
SILK SPI_LOADER V0.07c 2014.10.20                                                                                                         
 +
DEVICE S25FL512                                                                                                                           
 +
                                                                                                                                           
 +
                                                                                                                                           
 +
U-Boot 2013.01.01-g74b16ba-dirty (Dec 23 2014 - 15:31:50)                                                                                 
 +
                                                                                                                                           
 +
CPU: Renesas Electronics R8A7794 rev 1.0                                                                                                   
 +
Board: Silk Board                                                                                                                         
 +
                                                                                                                                           
 +
DRAM:  1 GiB                                                                                                                               
 +
MMC:  sh_mmcif: 0, sh-sdhi: 1                                                                                                             
 +
SF: Detected S25FL512S with page size 256 KiB, total 64 MiB                                                                               
 +
In:    serial                                                                                                                             
 +
Out:  serial                                                                                                                             
 +
Err:  serial                                                                                                                             
 +
Net:  sh_eth                                                                                                                             
 +
Hit any key to stop autoboot:  0                                                                                                           
 +
3534603 bytes read in 498 ms (6.8 MiB/s)                                                                                                   
 +
## Booting kernel from Legacy Image at 40007fc0 ...                                                                                       
 +
  Image Name:  'Linux-3.10.31-ltsi'                                                                                                     
 +
  Image Type:  ARM Linux Kernel Image (uncompressed)                                                                                     
 +
  Data Size:    3534539 Bytes = 3.4 MiB                                                                                                   
 +
  Load Address: 40008000                                                                                                                 
 +
  Entry Point:  40008000                                                                                                                 
 +
  Verifying Checksum ... OK                                                                                                               
 +
  XIP Kernel Image ... OK                                                                                                                 
 +
OK                                                                                                                                         
 +
                                                                                                                                           
 +
Starting kernel ...     
 +
</pre>
 +
</li>
 +
 +
</ol>
 +
 +
== Known issues and limitations ==
 +
TBD

Action parameters

VariableValue
Whether or not the edit is marked as minor (minor_edit)
Edit count of the user (user_editcount)
0
Name of the user account (user_name)
Thuandinh
Groups (including implicit) the user is in (user_groups)
* user autoconfirmed
Page ID (article_articleid)
0
Page namespace (article_namespace)
2
Page title (without namespace) (article_text)
Thuandinh
Full page title (article_prefixedtext)
User:Thuandinh
Action (action)
edit
Edit summary/reason (summary)
Old page wikitext, before the edit (old_wikitext)
New page wikitext, after the edit (new_wikitext)
{{TOC right}} This page contains information on building and running Yocto on [[R-Car/Boards/SILK | Renesas R-Car E2 SILK]] and [[R-Car/Boards/Porter|Renesas R-Car M2 Porter]] boards. == Yocto versions == [http://git.yoctoproject.org/cgit/cgit.cgi/poky/tag/?id=yocto-1.6.1 Poky-1.6.1] is supported. Specific commit of meta-openembedded is required. == Preliminary steps == <ol> <li>Download proprietary graphics and multimedia drivers from Renesas. Evaluation version is available at http://www.renesas.com/secret/r_car_download/rcar_demoboard.jsp<br/> Graphic drivers are required for X11 and Wayland. Multimedia drivers are optional.<br/> <br/> </li> <li> Install required packages ===== Ubuntu and Debian ===== <pre> sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \ build-essential chrpath socat libsdl1.2-dev xterm </pre> ===== Fedora ===== <pre> sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \ diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \ ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue socat \ SDL-devel xterm </pre> Refer to [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html#packages Yocto Project Quick Start] for more information. </li> </ol> == Building the BSP for Renesas R-Car SILK and Porter == <ol> <li>Create a directory and switch to it <br/> Warning! Yocto builds require a lot of disk space (up to 100 GB). Make sure you have got enough before starting the build. <pre> export WORK=<path-to-your-build-directory> mkdir $WORK cd $WORK </pre> </li> <li>Clone basic Yocto layers: <pre> cd $WORK git clone git://git.yoctoproject.org/poky git clone git://git.openembedded.org/meta-openembedded git clone git://git.linaro.org/openembedded/meta-linaro.git </pre> </li> <li> Switch to proper branches/commits <pre> cd $WORK/poky git checkout -b tmp yocto-1.6.1 cd $WORK/meta-openembedded git checkout -b tmp dca466c074c9a35bc0133e7e0d65cca0731e2acf cd $WORK/meta-linaro git checkout -b tmp 8a0601723c06fdb75e62aa0f0cf15fc9d7d90167 </pre> Another versions are not tested for compatibility. </li> <li> Clone Renesas BSP layer and switch to the proper branch: <pre> cd $WORK git clone git://git.yoctoproject.org/meta-renesas/ cd meta-renesas git checkout -b tmp 1c029141738865c4500f47549807411f4da469a8 </pre> </li> <li> Clone Renesas LCB layer and switch to the proper branch: <pre> cd $WORK git clone https://github.com/cogentembedded/meta-renesas-lcb.git cd meta-renesas-lcb git checkout -b tmp origin/v160 </pre> </li> <li> Download proprietary driver modules from http://www.renesas.com/secret/r_car_download/rcar_demoboard.jsp and unzip them to $WORK/proprietary folder.<br/> You should see the following files: <pre> [builduser@builduser meta-renesas-lcb]$ ls -lh $WORK/proprietary total 4.2M -rw-r--r--. 1 builduser builduser 3.0M Jan 9 15:26 R-Car_Series_Evaluation_Software_Package_for_Linux-20150109.tar.gz -rw-r--r--. 1 builduser builduser 1.2M Jan 9 12:49 R-Car_Series_Evaluation_Software_Package_of_Linux_Drivers-20150109.tar.gz </pre> </li> <li> Populate meta-renesas-lcb with graphics drivers.<br/> For [[R-Car/Boards/SILK|SILK]] board run: <pre> cd $WORK/meta-renesas-lcb ./copy_gfx_software_silk.sh ../proprietary </pre> For [[R-Car/Boards/Porter|Porter]] board run: <pre> cd $WORK/meta-renesas-lcb ./copy_gfx_software_porter.sh ../proprietary </pre> </li> <li> Populate meta-renesas-lcb with multimedia drivers. <pre> cd $WORK/meta-renesas-lcb ./copy_mm_software_lcb.sh ../proprietary </pre> </li> <li> Setup build environment <pre> cd $WORK source poky/oe-init-build-env </pre> </li> <li> Prepare default configuration files. <br/> For [[R-Car/Boards/SILK|SILK]] board run: <pre> cd $WORK/build cp ../meta-renesas-lcb/lcb-configs/bblayers.conf ./conf cp ../meta-renesas-lcb/lcb-configs/local-silk.conf ./conf/local.conf </pre> For [[R-Car/Boards/Porter|Porter]] board run: <pre> cd $WORK/build cp ../meta-renesas-lcb/lcb-configs/bblayers.conf ./conf cp ../meta-renesas-lcb/lcb-configs/local-porter.conf ./conf/local.conf </pre> Edit '''local.conf''' to select graphic environment (X11 or wayland/weston) and enable/disable graphics and multimedia proprietary drivers support. </li> <li> Start the build <br /> For weston/wayland: <pre> bitbake core-image-weston </pre> For X11: <pre> bitbake core-image-x11 </pre> </li> <li> Building image can take upto a few hours depending on your host system performance.<br> After the build has been completed successfuly, you should see the output similar to: <pre class="bash"> NOTE: Tasks Summary: Attempted 4704 tasks of which 31 didn't need to be rerun and all succeeded. </pre> and the command prompt should return. </li> <li> Bitbake has generated all the necessary files in ./tmp/deploy/images directory. <br/> You can verify its content: <pre class="bash"> [builduser]$ ls -lh `find ./tmp/deploy/images/silk/ -maxdepth 1 -type l -print` lrwxrwxrwx. 1 builduser builduser 50 Dec 9 02:47 ./tmp/deploy/images/silk/core-image-x11-silk.manifest -> core-image-x11-silk-20141208223655.builduserfs.manifest lrwxrwxrwx. 1 builduser builduser 49 Dec 9 02:47 ./tmp/deploy/images/silk/core-image-x11-silk.tar.bz2 -> core-image-x11-silk-20141208223655.builduserfs.tar.bz2 lrwxrwxrwx. 1 builduser builduser 84 Dec 9 02:43 ./tmp/deploy/images/silk/modules-silk.tgz -> modules--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655.tgz lrwxrwxrwx. 1 builduser builduser 52 Dec 9 02:46 ./tmp/deploy/images/silk/u-boot.bin -> u-boot-silk-v2013.01.01+gitAUTOINC+74b16badc2-r0.bin lrwxrwxrwx. 1 builduser builduser 52 Dec 9 02:46 ./tmp/deploy/images/silk/u-boot-silk.bin -> u-boot-silk-v2013.01.01+gitAUTOINC+74b16badc2-r0.bin lrwxrwxrwx. 1 builduser builduser 83 Dec 9 02:43 ./tmp/deploy/images/silk/uImage -> uImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655.bin lrwxrwxrwx. 1 builduser builduser 83 Dec 9 02:43 ./tmp/deploy/images/silk/uImage+dtb -> uImage+dtb--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655 lrwxrwxrwx. 1 builduser builduser 91 Dec 9 02:43 ./tmp/deploy/images/silk/uImage-r8a7794-silk.dtb -> uImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-r8a7794-silk-20141208223655.dtb lrwxrwxrwx. 1 builduser builduser 83 Dec 9 02:43 ./tmp/deploy/images/silk/uImage-silk.bin -> uImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655.bin lrwxrwxrwx. 1 builduser builduser 79 Dec 9 02:43 ./tmp/deploy/images/silk/zImage -> zImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655 lrwxrwxrwx. 1 builduser builduser 83 Dec 9 02:43 ./tmp/deploy/images/silk/zImage+dtb -> zImage+dtb--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655 </pre> '''modules-silk.tgz''' is compressed Kernel image, '''core-image-x11-silk.tar.bz2''' is the rootfs, '''modules-silk.tgz''' are kernel modules. </li> <li> You can now [[R-Car/Boards/SILK#Booting over TFTP from U-Boot|boot R-Car E2 SILK board over TFTP and NFS]] </li> </ol> == Running Yocto image == Linux kernel can be booted from microSD card or from TFTP. Root FS can be mounted from micro SD card or via NFS. === Loading kernel via TFTP and rootfs via NFS === Follow these steps to setup working TFTP and NFS server: <ol> <li> Setup a TFTP server. ==== Ubuntu ==== Install '''tftpd-hpa''' package along with tftp tools: <pre> sudo apt-get install tftp tftpd-hpa </pre> ==== Fedora ==== <ol> <li> Install necessary packages: <pre> sudo yum install tftp-server tftp </pre> tftp-server is a part of xinetd. See [http://docs.fedoraproject.org/en-US/Fedora/20/html/Installation_Guide/ch13s05s03.html Fedora manual] for more information. </li> <li> Enable TFTP server: <pre> sudo vi /etc/xinetd.d/tftp </pre> Set <pre>disable = no</pre> Save file and exit. </li> <li> Start xinetd: <pre> sudo systemctl start xinetd.service sudo systemctl enable xinetd.service </pre> </li> </ol> </li> <li> Copy '''uImage''' and '''uImage-r8a7794-silk.dtb''' from $WORK/build/tmp/deploy/images/silk/ to TFTP server root. ==== Ubuntu ==== <pre> cp $WORK/build/tmp/deploy/images/silk/uImage /srv/tftp/ cp $WORK/build/tmp/deploy/images/silk/uImage-r8a7794-silk.dtb /srv/tftp/ </pre> ==== Fedora ==== <pre> cp $WORK/build/tmp/deploy/images/silk/uImage /var/lib/tftpboot/ cp $WORK/build/tmp/deploy/images/silk/uImage-r8a7794-silk.dtb /var/lib/tftpboot/ </pre> </li> <li> Verify that TFTP server is working. <pre> tftp localhost -c get uImage && ls uImage </pre> </li> <li> Setup NFS server. ==== Debian/Ubuntu ==== <ol> <li> Install necessary packages: <pre> sudo apt-get install nfs-kernel-server nfs-common </pre> </li> <li> Start NFS server: <pre> sudo /etc/init.d/nfs-kernel-server start </pre> </li> </ol> ==== Fedora ==== <ol> <li> Install necessary packages: <pre> sudo yum install nfs-utils </pre> </li> <li> Enable and start nfs server: <pre> sudo systemctl enable rpcbind.service sudo systemctl enable nfs-server.service sudo systemctl enable nfs-lock.service sudo systemctl enable nfs-idmap.service sudo systemctl start rpcbind.service sudo systemctl start nfs-server.service sudo systemctl start nfs-lock.service sudo systemctl start nfs-idmap.service </pre> </li> </ol> </li> <li> Export root FS to NFS. (Change IMAGE and MACHINE to fit your build). <ol> <li> Unpack rootfs to a dedicated directory: <pre> IMAGE=weston|x11|sato|directfb MACHINE=silk|porter NFS_ROOT=/nfs/${MACHINE} sudo mkdir -p "${NFS_ROOT}" sudo rm -rf "${NFS_ROOT}"/* sudo tar -xjf "${WORK}/build/tmp/deploy/images/${MACHINE}/core-image-${IMAGE}-${MACHINE}.tar.bz2" -C "${NFS_ROOT}" sync </pre> </li> <li> Edit '''/etc/exports''': <pre> sudo vi /etc/exports </pre> add <pre> /nfs/silk *(rw,no_subtree_check,sync,no_root_squash,no_all_squash) /nfs/porter *(rw,no_subtree_check,sync,no_root_squash,no_all_squash) </pre> Save the file and exit. </li> <li> Force NFS server to re-read /etc/exports <pre>sudo exportfs -a</pre> </li> </ol> </li> <li> Verify that NFS is working. <pre> [builduser@buildmachine ~]$ showmount -e localhost Export list for localhost: /nfs/silk * /nfs/porter * </pre> </li> <li><span id="Boot into U-Boot command prompt">Boot into U-Boot command prompt</span> ===== For [[R-Car/Boards/SILK|SILK board]] ===== <ol> <li> Make sure SW9 is on pin 1 side. <br/> [[File:SILKSwitch.png|100px|Switch pin layout]] </li> <li> Connect to serial console over microUSB using minicom or picocom. </li> <li> Switch the board on or reset it. Press any key to stop U-Boot automatic countdown. </li> </ol> Refer to [[R-Car/Boards/SILK#Power on the board and go to U-Boot prompt|SILK board page]] for more information. ===== For [[R-Car/Boards/Porter|Porter board]] ===== <ol> <li> TBD </li> </ol> </li> <li> Configure Ethernet, TFTP, and kernel command line in U-Boot: <!--setenv ethaddr xx:xx:xx:xx:xx:xx Replace xx:xx:xx:xx:xx:xx with the MAC address of your board. It should be on the sticker on top of the Ethernet port.<br/> --> <pre> setenv ipaddr <board-ip> setenv serverip <your-computer-ip> setenv bootcmd 'tftp 0x40007fc0 uImage; tftp 0x40f00000 uImage-r8a7794-silk.dtb; bootm 0x40007fc0 - 0x40f00000' setenv bootargs 'console=ttySC10,38400 ignore_loglevel rw root=/dev/nfs nfsroot=<your-computer-ip>:<nfs-path>,nfsvers=3 ip=<board-ip>:<your-computer-ip>::255.255.255.0:silk vmalloc=384M' saveenv </pre> Replace <board-ip> with the proper IP address for the board. Replace <your-computer-ip> with the IP address of your computer, where tftp and nfs servers are installed. Replace <nfs-path> with the exported path of the root FS. <br/> For example: <pre> setenv ipaddr 192.168.1.3 setenv serverip 192.168.1.2 setenv bootcmd 'tftp 0x40007fc0 uImage; tftp 0x40f00000 uImage-r8a7794-silk.dtb; bootm 0x40007fc0 - 0x40f00000' setenv bootargs 'console=ttySC10,38400 ignore_loglevel rw root=/dev/nfs nfsroot=192.168.1.2:/nfs/silk,nfsvers=3 ip=192.168.1.3:192.168.1.2::255.255.255.0:silk vmalloc=384M' saveenv </pre> The last command writes the configuration to SPI flash. <pre> => saveenv Saving Environment to SPI Flash... SF: Detected S25FL512S with page size 256 KiB, total 64 MiB Erasing SPI flash...Writing to SPI flash...done </pre> You can also use <pre> dhcp </pre> command to obtain information from DHCP server.<br/> '''Note:''' You can always see the environment with ''printenv'' command. Refer to [http://www.denx.de/wiki/U-Boot/Documentation U-Boot manual] for details. </li> <li> Verify the connection over Ethernet from U-Boot: <pre> ping <your-computer-ip> </pre> You should see: <pre> => ping 192.168.1.2 sh_eth Waiting for PHY auto negotiation to complete... done sh_eth: 100Base/Full Using sh_eth device host 192.168.1.2 is alive </pre> </li> <li> Reset the board by pushing [[R-Car/Boards/SILK:Hardware#Switches and Buttons|SW5 "Reset"]]. </li> <li> The board should boot the kernel: <pre> SILK SPI_LOADER V0.07c 2014.10.20 DEVICE S25FL512 U-Boot 2013.01.01-g74b16ba-dirty (Dec 23 2014 - 15:31:50) CPU: Renesas Electronics R8A7794 rev 1.0 Board: Silk Board DRAM: 1 GiB MMC: sh_mmcif: 0, sh-sdhi: 1 SF: Detected S25FL512S with page size 256 KiB, total 64 MiB In: serial Out: serial Err: serial Net: sh_eth Hit any key to stop autoboot: 0 sh_eth Waiting for PHY auto negotiation to complete... done sh_eth: 100Base/Full Using sh_eth device TFTP from server 192.168.1.2; our IP address is 192.168.1.3 Filename 'uImage'. Load address: 0x40007fc0 Loading: ################################################################# ################################################################# ################################################################# ############################################## 3.5 MiB/s done Bytes transferred = 3525472 (35cb60 hex) sh_eth:1 is connected to sh_eth. Reconnecting to sh_eth sh_eth Waiting for PHY auto negotiation to complete... done sh_eth: 100Base/Full Using sh_eth device TFTP from server 192.168.1.2; our IP address is 192.168.1.3 Filename 'uImage-r8a7794-silk.dtb'. Load address: 0x40f00000 Loading: ## 3 MiB/s done Bytes transferred = 24859 (611b hex) ## Booting kernel from Legacy Image at 40007fc0 ... Image Name: Linux-3.10.31-ltsi Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 3525408 Bytes = 3.4 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 40eff11a ... OK Starting kernel ... </pre> </li> </ol> === Loading kernel and rootfs from microSD card === Both kernel and root FS can be loaded from a microSD card. The approach requires only a console cable. No Ethernet connection is needed. <ol> <li> Find a reliable microSD card with an adapter to fit your computer. 4 GB should be enough for the task. </li> <li> Plug the SD card into you computer. Locate the proper device for it, typically '''/dev/mmcblk0'''. Use <pre> dmesg | tail </pre> to print latest messages if in doubt.<br/> <span style="color:#ff0000">'''WARNING!''' Be very careful. Do not select you root partition or any other device with important information. It may be destroyed!</span><br/> Double-check that device name is correct by mounting and examining it's content. </li> <li> Make sure the SD card doesn't contain any important files.<br/> <span style="color:#ff0000">'''WARNING!''' Next step may erase the SD card completely. All files my be lost.</span> </li> <li> Format the card with one partition with EXT3 file system.<br/> ''TBD Update this page with a script which formats the card'' </li> <li> Copy root fs to the sd card: <pre> SD=<path-to-your-device-partition> SD_ROOT=/tmp/sd-tool sudo umount "${SD}" sudo mkdir -p "${SD_ROOT}" sudo mount "${SD}" "${SD_ROOT}" sudo rm -rf "${SD_ROOT}"/* sudo tar -xjf "${BUILDDIR}/tmp/deploy/images/${MACHINE}/core-image-${IMAGE}-${MACHINE}.tar.bz2" -C "${SD_ROOT}" sudo umount "${SD}" </pre> </li> <li> Insert the SD card into microSD slot on the board. </li> <li> Boot the board into U-Boot command prompt. Refer to section [[R-Car/Boards/Yocto#Boot into U-Boot command prompt|Boot into U-Boot command prompt]] </li> <li> Configure kernel command line in U-Boot: <pre> setenv bootcmd 'ext4load mmc 1:1 0x40007fc0 /boot/uImage+dtb; bootm 0x40007fc0' setenv bootargs 'console=ttySC10,38400 ignore_loglevel rw rootfstype=ext3 root=/dev/mmcblk0p1 rootwait vmalloc=384M' saveenv </pre> The last command writes the configuration to SPI flash. <pre> => saveenv Saving Environment to SPI Flash... SF: Detected S25FL512S with page size 256 KiB, total 64 MiB Erasing SPI flash...Writing to SPI flash...done </pre> </li> <li> Reset the board by pushing [[R-Car/Boards/SILK:Hardware#Switches and Buttons|SW5 "Reset"]]. </li> <li> The board should boot the kernel: <pre> SILK SPI_LOADER V0.07c 2014.10.20 DEVICE S25FL512 U-Boot 2013.01.01-g74b16ba-dirty (Dec 23 2014 - 15:31:50) CPU: Renesas Electronics R8A7794 rev 1.0 Board: Silk Board DRAM: 1 GiB MMC: sh_mmcif: 0, sh-sdhi: 1 SF: Detected S25FL512S with page size 256 KiB, total 64 MiB In: serial Out: serial Err: serial Net: sh_eth Hit any key to stop autoboot: 0 3534603 bytes read in 498 ms (6.8 MiB/s) ## Booting kernel from Legacy Image at 40007fc0 ... Image Name: 'Linux-3.10.31-ltsi' Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 3534539 Bytes = 3.4 MiB Load Address: 40008000 Entry Point: 40008000 Verifying Checksum ... OK XIP Kernel Image ... OK OK Starting kernel ... </pre> </li> </ol> == Known issues and limitations == TBD
Unified diff of changes made by edit (edit_diff)
@@ -1 +1,576 @@ +{{TOC right}} +This page contains information on building and running Yocto on [[R-Car/Boards/SILK | Renesas R-Car E2 SILK]] and [[R-Car/Boards/Porter|Renesas R-Car M2 Porter]] boards. +== Yocto versions == +[http://git.yoctoproject.org/cgit/cgit.cgi/poky/tag/?id=yocto-1.6.1 Poky-1.6.1] is supported. Specific commit of meta-openembedded is required. + +== Preliminary steps == +<ol> +<li>Download proprietary graphics and multimedia drivers from Renesas. Evaluation version is available at http://www.renesas.com/secret/r_car_download/rcar_demoboard.jsp<br/> +Graphic drivers are required for X11 and Wayland. Multimedia drivers are optional.<br/> +<br/> +</li> + +<li> Install required packages +===== Ubuntu and Debian ===== +<pre> +sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \ + build-essential chrpath socat libsdl1.2-dev xterm +</pre> +===== Fedora ===== +<pre> +sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \ + diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \ + ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue socat \ + SDL-devel xterm +</pre> +Refer to [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html#packages Yocto Project Quick Start] for more information. +</li> +</ol> + +== Building the BSP for Renesas R-Car SILK and Porter == +<ol> +<li>Create a directory and switch to it <br/> +Warning! Yocto builds require a lot of disk space (up to 100 GB). Make sure you have got enough before starting the build. +<pre> +export WORK=<path-to-your-build-directory> +mkdir $WORK +cd $WORK +</pre> +</li> +<li>Clone basic Yocto layers: +<pre> +cd $WORK +git clone git://git.yoctoproject.org/poky +git clone git://git.openembedded.org/meta-openembedded +git clone git://git.linaro.org/openembedded/meta-linaro.git +</pre> +</li> +<li> +Switch to proper branches/commits +<pre> +cd $WORK/poky +git checkout -b tmp yocto-1.6.1 +cd $WORK/meta-openembedded +git checkout -b tmp dca466c074c9a35bc0133e7e0d65cca0731e2acf +cd $WORK/meta-linaro +git checkout -b tmp 8a0601723c06fdb75e62aa0f0cf15fc9d7d90167 +</pre> +Another versions are not tested for compatibility. +</li> + +<li> +Clone Renesas BSP layer and switch to the proper branch: +<pre> +cd $WORK +git clone git://git.yoctoproject.org/meta-renesas/ +cd meta-renesas +git checkout -b tmp 1c029141738865c4500f47549807411f4da469a8 +</pre> +</li> + +<li> +Clone Renesas LCB layer and switch to the proper branch: +<pre> +cd $WORK +git clone https://github.com/cogentembedded/meta-renesas-lcb.git +cd meta-renesas-lcb +git checkout -b tmp origin/v160 +</pre> +</li> +<li> +Download proprietary driver modules from http://www.renesas.com/secret/r_car_download/rcar_demoboard.jsp and unzip them to $WORK/proprietary folder.<br/> +You should see the following files: +<pre> +[builduser@builduser meta-renesas-lcb]$ ls -lh $WORK/proprietary +total 4.2M +-rw-r--r--. 1 builduser builduser 3.0M Jan 9 15:26 R-Car_Series_Evaluation_Software_Package_for_Linux-20150109.tar.gz +-rw-r--r--. 1 builduser builduser 1.2M Jan 9 12:49 R-Car_Series_Evaluation_Software_Package_of_Linux_Drivers-20150109.tar.gz +</pre> +</li> +<li> +Populate meta-renesas-lcb with graphics drivers.<br/> +For [[R-Car/Boards/SILK|SILK]] board run: +<pre> +cd $WORK/meta-renesas-lcb +./copy_gfx_software_silk.sh ../proprietary +</pre> +For [[R-Car/Boards/Porter|Porter]] board run: +<pre> +cd $WORK/meta-renesas-lcb +./copy_gfx_software_porter.sh ../proprietary +</pre> +</li> +<li> +Populate meta-renesas-lcb with multimedia drivers. +<pre> +cd $WORK/meta-renesas-lcb +./copy_mm_software_lcb.sh ../proprietary +</pre> +</li> + +<li> +Setup build environment +<pre> +cd $WORK +source poky/oe-init-build-env +</pre> +</li> + +<li> +Prepare default configuration files. <br/> +For [[R-Car/Boards/SILK|SILK]] board run: +<pre> +cd $WORK/build +cp ../meta-renesas-lcb/lcb-configs/bblayers.conf ./conf +cp ../meta-renesas-lcb/lcb-configs/local-silk.conf ./conf/local.conf +</pre> +For [[R-Car/Boards/Porter|Porter]] board run: +<pre> +cd $WORK/build +cp ../meta-renesas-lcb/lcb-configs/bblayers.conf ./conf +cp ../meta-renesas-lcb/lcb-configs/local-porter.conf ./conf/local.conf +</pre> +Edit '''local.conf''' to select graphic environment (X11 or wayland/weston) and enable/disable graphics and multimedia proprietary drivers support. +</li> + +<li> +Start the build <br /> +For weston/wayland: +<pre> +bitbake core-image-weston +</pre> +For X11: +<pre> +bitbake core-image-x11 +</pre> +</li> + +<li> +Building image can take upto a few hours depending on your host system performance.<br> +After the build has been completed successfuly, you should see the output similar to: +<pre class="bash"> +NOTE: Tasks Summary: Attempted 4704 tasks of which 31 didn't need to be rerun and all succeeded. +</pre> +and the command prompt should return. +</li> + +<li> +Bitbake has generated all the necessary files in ./tmp/deploy/images directory. <br/> +You can verify its content: +<pre class="bash"> +[builduser]$ ls -lh `find ./tmp/deploy/images/silk/ -maxdepth 1 -type l -print` +lrwxrwxrwx. 1 builduser builduser 50 Dec 9 02:47 ./tmp/deploy/images/silk/core-image-x11-silk.manifest -> core-image-x11-silk-20141208223655.builduserfs.manifest +lrwxrwxrwx. 1 builduser builduser 49 Dec 9 02:47 ./tmp/deploy/images/silk/core-image-x11-silk.tar.bz2 -> core-image-x11-silk-20141208223655.builduserfs.tar.bz2 +lrwxrwxrwx. 1 builduser builduser 84 Dec 9 02:43 ./tmp/deploy/images/silk/modules-silk.tgz -> modules--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655.tgz +lrwxrwxrwx. 1 builduser builduser 52 Dec 9 02:46 ./tmp/deploy/images/silk/u-boot.bin -> u-boot-silk-v2013.01.01+gitAUTOINC+74b16badc2-r0.bin +lrwxrwxrwx. 1 builduser builduser 52 Dec 9 02:46 ./tmp/deploy/images/silk/u-boot-silk.bin -> u-boot-silk-v2013.01.01+gitAUTOINC+74b16badc2-r0.bin +lrwxrwxrwx. 1 builduser builduser 83 Dec 9 02:43 ./tmp/deploy/images/silk/uImage -> uImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655.bin +lrwxrwxrwx. 1 builduser builduser 83 Dec 9 02:43 ./tmp/deploy/images/silk/uImage+dtb -> uImage+dtb--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655 +lrwxrwxrwx. 1 builduser builduser 91 Dec 9 02:43 ./tmp/deploy/images/silk/uImage-r8a7794-silk.dtb -> uImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-r8a7794-silk-20141208223655.dtb +lrwxrwxrwx. 1 builduser builduser 83 Dec 9 02:43 ./tmp/deploy/images/silk/uImage-silk.bin -> uImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655.bin +lrwxrwxrwx. 1 builduser builduser 79 Dec 9 02:43 ./tmp/deploy/images/silk/zImage -> zImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655 +lrwxrwxrwx. 1 builduser builduser 83 Dec 9 02:43 ./tmp/deploy/images/silk/zImage+dtb -> zImage+dtb--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655 +</pre> +'''modules-silk.tgz''' is compressed Kernel image, '''core-image-x11-silk.tar.bz2''' is the rootfs, '''modules-silk.tgz''' are kernel modules. +</li> +<li> +You can now [[R-Car/Boards/SILK#Booting over TFTP from U-Boot|boot R-Car E2 SILK board over TFTP and NFS]] +</li> +</ol> + +== Running Yocto image == +Linux kernel can be booted from microSD card or from TFTP. Root FS can be mounted from micro SD card or via NFS. + +=== Loading kernel via TFTP and rootfs via NFS === +Follow these steps to setup working TFTP and NFS server: +<ol> +<li> +Setup a TFTP server. +==== Ubuntu ==== +Install '''tftpd-hpa''' package along with tftp tools: +<pre> +sudo apt-get install tftp tftpd-hpa +</pre> + +==== Fedora ==== +<ol> +<li> +Install necessary packages: +<pre> +sudo yum install tftp-server tftp +</pre> +tftp-server is a part of xinetd. See [http://docs.fedoraproject.org/en-US/Fedora/20/html/Installation_Guide/ch13s05s03.html Fedora manual] for more information. +</li> +<li> +Enable TFTP server: +<pre> +sudo vi /etc/xinetd.d/tftp +</pre> +Set <pre>disable = no</pre> Save file and exit. +</li> +<li> +Start xinetd: +<pre> +sudo systemctl start xinetd.service +sudo systemctl enable xinetd.service +</pre> +</li> +</ol> + +</li> + +<li> +Copy '''uImage''' and '''uImage-r8a7794-silk.dtb''' from $WORK/build/tmp/deploy/images/silk/ to TFTP server root. +==== Ubuntu ==== +<pre> +cp $WORK/build/tmp/deploy/images/silk/uImage /srv/tftp/ +cp $WORK/build/tmp/deploy/images/silk/uImage-r8a7794-silk.dtb /srv/tftp/ +</pre> + +==== Fedora ==== +<pre> +cp $WORK/build/tmp/deploy/images/silk/uImage /var/lib/tftpboot/ +cp $WORK/build/tmp/deploy/images/silk/uImage-r8a7794-silk.dtb /var/lib/tftpboot/ +</pre> +</li> + +<li> +Verify that TFTP server is working. +<pre> +tftp localhost -c get uImage && ls uImage +</pre> +</li> + +<li> +Setup NFS server. +==== Debian/Ubuntu ==== +<ol> +<li> +Install necessary packages: +<pre> +sudo apt-get install nfs-kernel-server nfs-common +</pre> +</li> +<li> +Start NFS server: +<pre> +sudo /etc/init.d/nfs-kernel-server start +</pre> +</li> +</ol> + +==== Fedora ==== +<ol> +<li> +Install necessary packages: +<pre> +sudo yum install nfs-utils +</pre> +</li> +<li> +Enable and start nfs server: +<pre> +sudo systemctl enable rpcbind.service +sudo systemctl enable nfs-server.service +sudo systemctl enable nfs-lock.service +sudo systemctl enable nfs-idmap.service +sudo systemctl start rpcbind.service +sudo systemctl start nfs-server.service +sudo systemctl start nfs-lock.service +sudo systemctl start nfs-idmap.service +</pre> +</li> +</ol> +</li> + +<li> +Export root FS to NFS. (Change IMAGE and MACHINE to fit your build). +<ol> +<li> +Unpack rootfs to a dedicated directory: +<pre> +IMAGE=weston|x11|sato|directfb +MACHINE=silk|porter +NFS_ROOT=/nfs/${MACHINE} +sudo mkdir -p "${NFS_ROOT}" +sudo rm -rf "${NFS_ROOT}"/* +sudo tar -xjf "${WORK}/build/tmp/deploy/images/${MACHINE}/core-image-${IMAGE}-${MACHINE}.tar.bz2" -C "${NFS_ROOT}" +sync +</pre> +</li> +<li> +Edit '''/etc/exports''': +<pre> +sudo vi /etc/exports +</pre> +add +<pre> +/nfs/silk *(rw,no_subtree_check,sync,no_root_squash,no_all_squash) +/nfs/porter *(rw,no_subtree_check,sync,no_root_squash,no_all_squash) +</pre> +Save the file and exit. +</li> +<li> +Force NFS server to re-read /etc/exports +<pre>sudo exportfs -a</pre> +</li> +</ol> +</li> +<li> +Verify that NFS is working. +<pre> +[builduser@buildmachine ~]$ showmount -e localhost +Export list for localhost: +/nfs/silk * +/nfs/porter * +</pre> +</li> + +<li><span id="Boot into U-Boot command prompt">Boot into U-Boot command prompt</span> +===== For [[R-Car/Boards/SILK|SILK board]] ===== +<ol> +<li> +Make sure SW9 is on pin 1 side. <br/> +[[File:SILKSwitch.png|100px|Switch pin layout]] +</li> +<li> +Connect to serial console over microUSB using minicom or picocom. +</li> +<li> +Switch the board on or reset it. Press any key to stop U-Boot automatic countdown. +</li> +</ol> +Refer to [[R-Car/Boards/SILK#Power on the board and go to U-Boot prompt|SILK board page]] for more information. +===== For [[R-Car/Boards/Porter|Porter board]] ===== +<ol> +<li> +TBD +</li> +</ol> + +</li> + +<li> +Configure Ethernet, TFTP, and kernel command line in U-Boot: +<!--setenv ethaddr xx:xx:xx:xx:xx:xx +Replace xx:xx:xx:xx:xx:xx with the MAC address of your board. It should be on the sticker on top of the Ethernet port.<br/> + --> +<pre> +setenv ipaddr <board-ip> +setenv serverip <your-computer-ip> +setenv bootcmd 'tftp 0x40007fc0 uImage; tftp 0x40f00000 uImage-r8a7794-silk.dtb; bootm 0x40007fc0 - 0x40f00000' +setenv bootargs 'console=ttySC10,38400 ignore_loglevel rw root=/dev/nfs nfsroot=<your-computer-ip>:<nfs-path>,nfsvers=3 ip=<board-ip>:<your-computer-ip>::255.255.255.0:silk vmalloc=384M' +saveenv +</pre> +Replace <board-ip> with the proper IP address for the board. Replace <your-computer-ip> with the IP address of your computer, where tftp and nfs servers are installed. Replace <nfs-path> with the exported path of the root FS. <br/> For example: +<pre> +setenv ipaddr 192.168.1.3 +setenv serverip 192.168.1.2 +setenv bootcmd 'tftp 0x40007fc0 uImage; tftp 0x40f00000 uImage-r8a7794-silk.dtb; bootm 0x40007fc0 - 0x40f00000' +setenv bootargs 'console=ttySC10,38400 ignore_loglevel rw root=/dev/nfs nfsroot=192.168.1.2:/nfs/silk,nfsvers=3 ip=192.168.1.3:192.168.1.2::255.255.255.0:silk vmalloc=384M' +saveenv +</pre> +The last command writes the configuration to SPI flash. +<pre> +=> saveenv +Saving Environment to SPI Flash... +SF: Detected S25FL512S with page size 256 KiB, total 64 MiB +Erasing SPI flash...Writing to SPI flash...done +</pre> +You can also use +<pre> +dhcp +</pre> +command to obtain information from DHCP server.<br/> +'''Note:''' You can always see the environment with ''printenv'' command. Refer to [http://www.denx.de/wiki/U-Boot/Documentation U-Boot manual] for details. +</li> + +<li> +Verify the connection over Ethernet from U-Boot: +<pre> +ping <your-computer-ip> +</pre> +You should see: +<pre> +=> ping 192.168.1.2 +sh_eth Waiting for PHY auto negotiation to complete... done +sh_eth: 100Base/Full +Using sh_eth device +host 192.168.1.2 is alive +</pre> +</li> + +<li> +Reset the board by pushing [[R-Car/Boards/SILK:Hardware#Switches and Buttons|SW5 "Reset"]]. +</li> + +<li> +The board should boot the kernel: +<pre> +SILK SPI_LOADER V0.07c 2014.10.20 +DEVICE S25FL512 + + +U-Boot 2013.01.01-g74b16ba-dirty (Dec 23 2014 - 15:31:50) + +CPU: Renesas Electronics R8A7794 rev 1.0 +Board: Silk Board + +DRAM: 1 GiB +MMC: sh_mmcif: 0, sh-sdhi: 1 +SF: Detected S25FL512S with page size 256 KiB, total 64 MiB +In: serial +Out: serial +Err: serial +Net: sh_eth +Hit any key to stop autoboot: 0 +sh_eth Waiting for PHY auto negotiation to complete... done +sh_eth: 100Base/Full +Using sh_eth device +TFTP from server 192.168.1.2; our IP address is 192.168.1.3 +Filename 'uImage'. +Load address: 0x40007fc0 +Loading: ################################################################# + ################################################################# + ################################################################# + ############################################## + 3.5 MiB/s +done +Bytes transferred = 3525472 (35cb60 hex) +sh_eth:1 is connected to sh_eth. Reconnecting to sh_eth +sh_eth Waiting for PHY auto negotiation to complete... done +sh_eth: 100Base/Full +Using sh_eth device +TFTP from server 192.168.1.2; our IP address is 192.168.1.3 +Filename 'uImage-r8a7794-silk.dtb'. +Load address: 0x40f00000 +Loading: ## + 3 MiB/s +done +Bytes transferred = 24859 (611b hex) +## Booting kernel from Legacy Image at 40007fc0 ... + Image Name: Linux-3.10.31-ltsi + Image Type: ARM Linux Kernel Image (uncompressed) + Data Size: 3525408 Bytes = 3.4 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 40eff11a ... OK + +Starting kernel ... +</pre> +</li> +</ol> + +=== Loading kernel and rootfs from microSD card === +Both kernel and root FS can be loaded from a microSD card. The approach requires only a console cable. No Ethernet connection is needed. +<ol> +<li> +Find a reliable microSD card with an adapter to fit your computer. 4 GB should be enough for the task. +</li> + +<li> +Plug the SD card into you computer. Locate the proper device for it, typically '''/dev/mmcblk0'''. Use +<pre> +dmesg | tail +</pre> +to print latest messages if in doubt.<br/> +<span style="color:#ff0000">'''WARNING!''' Be very careful. Do not select you root partition or any other device with important information. It may be destroyed!</span><br/> +Double-check that device name is correct by mounting and examining it's content. +</li> + +<li> +Make sure the SD card doesn't contain any important files.<br/> +<span style="color:#ff0000">'''WARNING!''' Next step may erase the SD card completely. All files my be lost.</span> +</li> + +<li> +Format the card with one partition with EXT3 file system.<br/> +''TBD Update this page with a script which formats the card'' +</li> + +<li> +Copy root fs to the sd card: +<pre> +SD=<path-to-your-device-partition> +SD_ROOT=/tmp/sd-tool +sudo umount "${SD}" +sudo mkdir -p "${SD_ROOT}" +sudo mount "${SD}" "${SD_ROOT}" +sudo rm -rf "${SD_ROOT}"/* +sudo tar -xjf "${BUILDDIR}/tmp/deploy/images/${MACHINE}/core-image-${IMAGE}-${MACHINE}.tar.bz2" -C "${SD_ROOT}" +sudo umount "${SD}" +</pre> +</li> + +<li> +Insert the SD card into microSD slot on the board. +</li> + +<li> Boot the board into U-Boot command prompt. Refer to section [[R-Car/Boards/Yocto#Boot into U-Boot command prompt|Boot into U-Boot command prompt]] +</li> + +<li> +Configure kernel command line in U-Boot: +<pre> +setenv bootcmd 'ext4load mmc 1:1 0x40007fc0 /boot/uImage+dtb; bootm 0x40007fc0' +setenv bootargs 'console=ttySC10,38400 ignore_loglevel rw rootfstype=ext3 root=/dev/mmcblk0p1 rootwait vmalloc=384M' +saveenv +</pre> +The last command writes the configuration to SPI flash. +<pre> +=> saveenv +Saving Environment to SPI Flash... +SF: Detected S25FL512S with page size 256 KiB, total 64 MiB +Erasing SPI flash...Writing to SPI flash...done +</pre> +</li> + +<li> +Reset the board by pushing [[R-Car/Boards/SILK:Hardware#Switches and Buttons|SW5 "Reset"]]. +</li> + +<li> +The board should boot the kernel: +<pre> +SILK SPI_LOADER V0.07c 2014.10.20 +DEVICE S25FL512 + + +U-Boot 2013.01.01-g74b16ba-dirty (Dec 23 2014 - 15:31:50) + +CPU: Renesas Electronics R8A7794 rev 1.0 +Board: Silk Board + +DRAM: 1 GiB +MMC: sh_mmcif: 0, sh-sdhi: 1 +SF: Detected S25FL512S with page size 256 KiB, total 64 MiB +In: serial +Out: serial +Err: serial +Net: sh_eth +Hit any key to stop autoboot: 0 +3534603 bytes read in 498 ms (6.8 MiB/s) +## Booting kernel from Legacy Image at 40007fc0 ... + Image Name: 'Linux-3.10.31-ltsi' + Image Type: ARM Linux Kernel Image (uncompressed) + Data Size: 3534539 Bytes = 3.4 MiB + Load Address: 40008000 + Entry Point: 40008000 + Verifying Checksum ... OK + XIP Kernel Image ... OK +OK + +Starting kernel ... +</pre> +</li> + +</ol> + +== Known issues and limitations == +TBD
Old page size (old_size)
0
Lines added in edit (added_lines)
{{TOC right}} This page contains information on building and running Yocto on [[R-Car/Boards/SILK | Renesas R-Car E2 SILK]] and [[R-Car/Boards/Porter|Renesas R-Car M2 Porter]] boards. == Yocto versions == [http://git.yoctoproject.org/cgit/cgit.cgi/poky/tag/?id=yocto-1.6.1 Poky-1.6.1] is supported. Specific commit of meta-openembedded is required. == Preliminary steps == <ol> <li>Download proprietary graphics and multimedia drivers from Renesas. Evaluation version is available at http://www.renesas.com/secret/r_car_download/rcar_demoboard.jsp<br/> Graphic drivers are required for X11 and Wayland. Multimedia drivers are optional.<br/> <br/> </li> <li> Install required packages ===== Ubuntu and Debian ===== <pre> sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \ build-essential chrpath socat libsdl1.2-dev xterm </pre> ===== Fedora ===== <pre> sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \ diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \ ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue socat \ SDL-devel xterm </pre> Refer to [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html#packages Yocto Project Quick Start] for more information. </li> </ol> == Building the BSP for Renesas R-Car SILK and Porter == <ol> <li>Create a directory and switch to it <br/> Warning! Yocto builds require a lot of disk space (up to 100 GB). Make sure you have got enough before starting the build. <pre> export WORK=<path-to-your-build-directory> mkdir $WORK cd $WORK </pre> </li> <li>Clone basic Yocto layers: <pre> cd $WORK git clone git://git.yoctoproject.org/poky git clone git://git.openembedded.org/meta-openembedded git clone git://git.linaro.org/openembedded/meta-linaro.git </pre> </li> <li> Switch to proper branches/commits <pre> cd $WORK/poky git checkout -b tmp yocto-1.6.1 cd $WORK/meta-openembedded git checkout -b tmp dca466c074c9a35bc0133e7e0d65cca0731e2acf cd $WORK/meta-linaro git checkout -b tmp 8a0601723c06fdb75e62aa0f0cf15fc9d7d90167 </pre> Another versions are not tested for compatibility. </li> <li> Clone Renesas BSP layer and switch to the proper branch: <pre> cd $WORK git clone git://git.yoctoproject.org/meta-renesas/ cd meta-renesas git checkout -b tmp 1c029141738865c4500f47549807411f4da469a8 </pre> </li> <li> Clone Renesas LCB layer and switch to the proper branch: <pre> cd $WORK git clone https://github.com/cogentembedded/meta-renesas-lcb.git cd meta-renesas-lcb git checkout -b tmp origin/v160 </pre> </li> <li> Download proprietary driver modules from http://www.renesas.com/secret/r_car_download/rcar_demoboard.jsp and unzip them to $WORK/proprietary folder.<br/> You should see the following files: <pre> [builduser@builduser meta-renesas-lcb]$ ls -lh $WORK/proprietary total 4.2M -rw-r--r--. 1 builduser builduser 3.0M Jan 9 15:26 R-Car_Series_Evaluation_Software_Package_for_Linux-20150109.tar.gz -rw-r--r--. 1 builduser builduser 1.2M Jan 9 12:49 R-Car_Series_Evaluation_Software_Package_of_Linux_Drivers-20150109.tar.gz </pre> </li> <li> Populate meta-renesas-lcb with graphics drivers.<br/> For [[R-Car/Boards/SILK|SILK]] board run: <pre> cd $WORK/meta-renesas-lcb ./copy_gfx_software_silk.sh ../proprietary </pre> For [[R-Car/Boards/Porter|Porter]] board run: <pre> cd $WORK/meta-renesas-lcb ./copy_gfx_software_porter.sh ../proprietary </pre> </li> <li> Populate meta-renesas-lcb with multimedia drivers. <pre> cd $WORK/meta-renesas-lcb ./copy_mm_software_lcb.sh ../proprietary </pre> </li> <li> Setup build environment <pre> cd $WORK source poky/oe-init-build-env </pre> </li> <li> Prepare default configuration files. <br/> For [[R-Car/Boards/SILK|SILK]] board run: <pre> cd $WORK/build cp ../meta-renesas-lcb/lcb-configs/bblayers.conf ./conf cp ../meta-renesas-lcb/lcb-configs/local-silk.conf ./conf/local.conf </pre> For [[R-Car/Boards/Porter|Porter]] board run: <pre> cd $WORK/build cp ../meta-renesas-lcb/lcb-configs/bblayers.conf ./conf cp ../meta-renesas-lcb/lcb-configs/local-porter.conf ./conf/local.conf </pre> Edit '''local.conf''' to select graphic environment (X11 or wayland/weston) and enable/disable graphics and multimedia proprietary drivers support. </li> <li> Start the build <br /> For weston/wayland: <pre> bitbake core-image-weston </pre> For X11: <pre> bitbake core-image-x11 </pre> </li> <li> Building image can take upto a few hours depending on your host system performance.<br> After the build has been completed successfuly, you should see the output similar to: <pre class="bash"> NOTE: Tasks Summary: Attempted 4704 tasks of which 31 didn't need to be rerun and all succeeded. </pre> and the command prompt should return. </li> <li> Bitbake has generated all the necessary files in ./tmp/deploy/images directory. <br/> You can verify its content: <pre class="bash"> [builduser]$ ls -lh `find ./tmp/deploy/images/silk/ -maxdepth 1 -type l -print` lrwxrwxrwx. 1 builduser builduser 50 Dec 9 02:47 ./tmp/deploy/images/silk/core-image-x11-silk.manifest -> core-image-x11-silk-20141208223655.builduserfs.manifest lrwxrwxrwx. 1 builduser builduser 49 Dec 9 02:47 ./tmp/deploy/images/silk/core-image-x11-silk.tar.bz2 -> core-image-x11-silk-20141208223655.builduserfs.tar.bz2 lrwxrwxrwx. 1 builduser builduser 84 Dec 9 02:43 ./tmp/deploy/images/silk/modules-silk.tgz -> modules--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655.tgz lrwxrwxrwx. 1 builduser builduser 52 Dec 9 02:46 ./tmp/deploy/images/silk/u-boot.bin -> u-boot-silk-v2013.01.01+gitAUTOINC+74b16badc2-r0.bin lrwxrwxrwx. 1 builduser builduser 52 Dec 9 02:46 ./tmp/deploy/images/silk/u-boot-silk.bin -> u-boot-silk-v2013.01.01+gitAUTOINC+74b16badc2-r0.bin lrwxrwxrwx. 1 builduser builduser 83 Dec 9 02:43 ./tmp/deploy/images/silk/uImage -> uImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655.bin lrwxrwxrwx. 1 builduser builduser 83 Dec 9 02:43 ./tmp/deploy/images/silk/uImage+dtb -> uImage+dtb--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655 lrwxrwxrwx. 1 builduser builduser 91 Dec 9 02:43 ./tmp/deploy/images/silk/uImage-r8a7794-silk.dtb -> uImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-r8a7794-silk-20141208223655.dtb lrwxrwxrwx. 1 builduser builduser 83 Dec 9 02:43 ./tmp/deploy/images/silk/uImage-silk.bin -> uImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655.bin lrwxrwxrwx. 1 builduser builduser 79 Dec 9 02:43 ./tmp/deploy/images/silk/zImage -> zImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655 lrwxrwxrwx. 1 builduser builduser 83 Dec 9 02:43 ./tmp/deploy/images/silk/zImage+dtb -> zImage+dtb--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655 </pre> '''modules-silk.tgz''' is compressed Kernel image, '''core-image-x11-silk.tar.bz2''' is the rootfs, '''modules-silk.tgz''' are kernel modules. </li> <li> You can now [[R-Car/Boards/SILK#Booting over TFTP from U-Boot|boot R-Car E2 SILK board over TFTP and NFS]] </li> </ol> == Running Yocto image == Linux kernel can be booted from microSD card or from TFTP. Root FS can be mounted from micro SD card or via NFS. === Loading kernel via TFTP and rootfs via NFS === Follow these steps to setup working TFTP and NFS server: <ol> <li> Setup a TFTP server. ==== Ubuntu ==== Install '''tftpd-hpa''' package along with tftp tools: <pre> sudo apt-get install tftp tftpd-hpa </pre> ==== Fedora ==== <ol> <li> Install necessary packages: <pre> sudo yum install tftp-server tftp </pre> tftp-server is a part of xinetd. See [http://docs.fedoraproject.org/en-US/Fedora/20/html/Installation_Guide/ch13s05s03.html Fedora manual] for more information. </li> <li> Enable TFTP server: <pre> sudo vi /etc/xinetd.d/tftp </pre> Set <pre>disable = no</pre> Save file and exit. </li> <li> Start xinetd: <pre> sudo systemctl start xinetd.service sudo systemctl enable xinetd.service </pre> </li> </ol> </li> <li> Copy '''uImage''' and '''uImage-r8a7794-silk.dtb''' from $WORK/build/tmp/deploy/images/silk/ to TFTP server root. ==== Ubuntu ==== <pre> cp $WORK/build/tmp/deploy/images/silk/uImage /srv/tftp/ cp $WORK/build/tmp/deploy/images/silk/uImage-r8a7794-silk.dtb /srv/tftp/ </pre> ==== Fedora ==== <pre> cp $WORK/build/tmp/deploy/images/silk/uImage /var/lib/tftpboot/ cp $WORK/build/tmp/deploy/images/silk/uImage-r8a7794-silk.dtb /var/lib/tftpboot/ </pre> </li> <li> Verify that TFTP server is working. <pre> tftp localhost -c get uImage && ls uImage </pre> </li> <li> Setup NFS server. ==== Debian/Ubuntu ==== <ol> <li> Install necessary packages: <pre> sudo apt-get install nfs-kernel-server nfs-common </pre> </li> <li> Start NFS server: <pre> sudo /etc/init.d/nfs-kernel-server start </pre> </li> </ol> ==== Fedora ==== <ol> <li> Install necessary packages: <pre> sudo yum install nfs-utils </pre> </li> <li> Enable and start nfs server: <pre> sudo systemctl enable rpcbind.service sudo systemctl enable nfs-server.service sudo systemctl enable nfs-lock.service sudo systemctl enable nfs-idmap.service sudo systemctl start rpcbind.service sudo systemctl start nfs-server.service sudo systemctl start nfs-lock.service sudo systemctl start nfs-idmap.service </pre> </li> </ol> </li> <li> Export root FS to NFS. (Change IMAGE and MACHINE to fit your build). <ol> <li> Unpack rootfs to a dedicated directory: <pre> IMAGE=weston|x11|sato|directfb MACHINE=silk|porter NFS_ROOT=/nfs/${MACHINE} sudo mkdir -p "${NFS_ROOT}" sudo rm -rf "${NFS_ROOT}"/* sudo tar -xjf "${WORK}/build/tmp/deploy/images/${MACHINE}/core-image-${IMAGE}-${MACHINE}.tar.bz2" -C "${NFS_ROOT}" sync </pre> </li> <li> Edit '''/etc/exports''': <pre> sudo vi /etc/exports </pre> add <pre> /nfs/silk *(rw,no_subtree_check,sync,no_root_squash,no_all_squash) /nfs/porter *(rw,no_subtree_check,sync,no_root_squash,no_all_squash) </pre> Save the file and exit. </li> <li> Force NFS server to re-read /etc/exports <pre>sudo exportfs -a</pre> </li> </ol> </li> <li> Verify that NFS is working. <pre> [builduser@buildmachine ~]$ showmount -e localhost Export list for localhost: /nfs/silk * /nfs/porter * </pre> </li> <li><span id="Boot into U-Boot command prompt">Boot into U-Boot command prompt</span> ===== For [[R-Car/Boards/SILK|SILK board]] ===== <ol> <li> Make sure SW9 is on pin 1 side. <br/> [[File:SILKSwitch.png|100px|Switch pin layout]] </li> <li> Connect to serial console over microUSB using minicom or picocom. </li> <li> Switch the board on or reset it. Press any key to stop U-Boot automatic countdown. </li> </ol> Refer to [[R-Car/Boards/SILK#Power on the board and go to U-Boot prompt|SILK board page]] for more information. ===== For [[R-Car/Boards/Porter|Porter board]] ===== <ol> <li> TBD </li> </ol> </li> <li> Configure Ethernet, TFTP, and kernel command line in U-Boot: <!--setenv ethaddr xx:xx:xx:xx:xx:xx Replace xx:xx:xx:xx:xx:xx with the MAC address of your board. It should be on the sticker on top of the Ethernet port.<br/> --> <pre> setenv ipaddr <board-ip> setenv serverip <your-computer-ip> setenv bootcmd 'tftp 0x40007fc0 uImage; tftp 0x40f00000 uImage-r8a7794-silk.dtb; bootm 0x40007fc0 - 0x40f00000' setenv bootargs 'console=ttySC10,38400 ignore_loglevel rw root=/dev/nfs nfsroot=<your-computer-ip>:<nfs-path>,nfsvers=3 ip=<board-ip>:<your-computer-ip>::255.255.255.0:silk vmalloc=384M' saveenv </pre> Replace <board-ip> with the proper IP address for the board. Replace <your-computer-ip> with the IP address of your computer, where tftp and nfs servers are installed. Replace <nfs-path> with the exported path of the root FS. <br/> For example: <pre> setenv ipaddr 192.168.1.3 setenv serverip 192.168.1.2 setenv bootcmd 'tftp 0x40007fc0 uImage; tftp 0x40f00000 uImage-r8a7794-silk.dtb; bootm 0x40007fc0 - 0x40f00000' setenv bootargs 'console=ttySC10,38400 ignore_loglevel rw root=/dev/nfs nfsroot=192.168.1.2:/nfs/silk,nfsvers=3 ip=192.168.1.3:192.168.1.2::255.255.255.0:silk vmalloc=384M' saveenv </pre> The last command writes the configuration to SPI flash. <pre> => saveenv Saving Environment to SPI Flash... SF: Detected S25FL512S with page size 256 KiB, total 64 MiB Erasing SPI flash...Writing to SPI flash...done </pre> You can also use <pre> dhcp </pre> command to obtain information from DHCP server.<br/> '''Note:''' You can always see the environment with ''printenv'' command. Refer to [http://www.denx.de/wiki/U-Boot/Documentation U-Boot manual] for details. </li> <li> Verify the connection over Ethernet from U-Boot: <pre> ping <your-computer-ip> </pre> You should see: <pre> => ping 192.168.1.2 sh_eth Waiting for PHY auto negotiation to complete... done sh_eth: 100Base/Full Using sh_eth device host 192.168.1.2 is alive </pre> </li> <li> Reset the board by pushing [[R-Car/Boards/SILK:Hardware#Switches and Buttons|SW5 "Reset"]]. </li> <li> The board should boot the kernel: <pre> SILK SPI_LOADER V0.07c 2014.10.20 DEVICE S25FL512 U-Boot 2013.01.01-g74b16ba-dirty (Dec 23 2014 - 15:31:50) CPU: Renesas Electronics R8A7794 rev 1.0 Board: Silk Board DRAM: 1 GiB MMC: sh_mmcif: 0, sh-sdhi: 1 SF: Detected S25FL512S with page size 256 KiB, total 64 MiB In: serial Out: serial Err: serial Net: sh_eth Hit any key to stop autoboot: 0 sh_eth Waiting for PHY auto negotiation to complete... done sh_eth: 100Base/Full Using sh_eth device TFTP from server 192.168.1.2; our IP address is 192.168.1.3 Filename 'uImage'. Load address: 0x40007fc0 Loading: ################################################################# ################################################################# ################################################################# ############################################## 3.5 MiB/s done Bytes transferred = 3525472 (35cb60 hex) sh_eth:1 is connected to sh_eth. Reconnecting to sh_eth sh_eth Waiting for PHY auto negotiation to complete... done sh_eth: 100Base/Full Using sh_eth device TFTP from server 192.168.1.2; our IP address is 192.168.1.3 Filename 'uImage-r8a7794-silk.dtb'. Load address: 0x40f00000 Loading: ## 3 MiB/s done Bytes transferred = 24859 (611b hex) ## Booting kernel from Legacy Image at 40007fc0 ... Image Name: Linux-3.10.31-ltsi Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 3525408 Bytes = 3.4 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 40eff11a ... OK Starting kernel ... </pre> </li> </ol> === Loading kernel and rootfs from microSD card === Both kernel and root FS can be loaded from a microSD card. The approach requires only a console cable. No Ethernet connection is needed. <ol> <li> Find a reliable microSD card with an adapter to fit your computer. 4 GB should be enough for the task. </li> <li> Plug the SD card into you computer. Locate the proper device for it, typically '''/dev/mmcblk0'''. Use <pre> dmesg | tail </pre> to print latest messages if in doubt.<br/> <span style="color:#ff0000">'''WARNING!''' Be very careful. Do not select you root partition or any other device with important information. It may be destroyed!</span><br/> Double-check that device name is correct by mounting and examining it's content. </li> <li> Make sure the SD card doesn't contain any important files.<br/> <span style="color:#ff0000">'''WARNING!''' Next step may erase the SD card completely. All files my be lost.</span> </li> <li> Format the card with one partition with EXT3 file system.<br/> ''TBD Update this page with a script which formats the card'' </li> <li> Copy root fs to the sd card: <pre> SD=<path-to-your-device-partition> SD_ROOT=/tmp/sd-tool sudo umount "${SD}" sudo mkdir -p "${SD_ROOT}" sudo mount "${SD}" "${SD_ROOT}" sudo rm -rf "${SD_ROOT}"/* sudo tar -xjf "${BUILDDIR}/tmp/deploy/images/${MACHINE}/core-image-${IMAGE}-${MACHINE}.tar.bz2" -C "${SD_ROOT}" sudo umount "${SD}" </pre> </li> <li> Insert the SD card into microSD slot on the board. </li> <li> Boot the board into U-Boot command prompt. Refer to section [[R-Car/Boards/Yocto#Boot into U-Boot command prompt|Boot into U-Boot command prompt]] </li> <li> Configure kernel command line in U-Boot: <pre> setenv bootcmd 'ext4load mmc 1:1 0x40007fc0 /boot/uImage+dtb; bootm 0x40007fc0' setenv bootargs 'console=ttySC10,38400 ignore_loglevel rw rootfstype=ext3 root=/dev/mmcblk0p1 rootwait vmalloc=384M' saveenv </pre> The last command writes the configuration to SPI flash. <pre> => saveenv Saving Environment to SPI Flash... SF: Detected S25FL512S with page size 256 KiB, total 64 MiB Erasing SPI flash...Writing to SPI flash...done </pre> </li> <li> Reset the board by pushing [[R-Car/Boards/SILK:Hardware#Switches and Buttons|SW5 "Reset"]]. </li> <li> The board should boot the kernel: <pre> SILK SPI_LOADER V0.07c 2014.10.20 DEVICE S25FL512 U-Boot 2013.01.01-g74b16ba-dirty (Dec 23 2014 - 15:31:50) CPU: Renesas Electronics R8A7794 rev 1.0 Board: Silk Board DRAM: 1 GiB MMC: sh_mmcif: 0, sh-sdhi: 1 SF: Detected S25FL512S with page size 256 KiB, total 64 MiB In: serial Out: serial Err: serial Net: sh_eth Hit any key to stop autoboot: 0 3534603 bytes read in 498 ms (6.8 MiB/s) ## Booting kernel from Legacy Image at 40007fc0 ... Image Name: 'Linux-3.10.31-ltsi' Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 3534539 Bytes = 3.4 MiB Load Address: 40008000 Entry Point: 40008000 Verifying Checksum ... OK XIP Kernel Image ... OK OK Starting kernel ... </pre> </li> </ol> == Known issues and limitations == TBD
Lines removed in edit (removed_lines)
Unix timestamp of change (timestamp)
1427948684