Difference between revisions of "R-Car/Boards/Yocto-Gen3"

From eLinux.org
Jump to: navigation, search
Line 117: Line 117:
 
Populate meta-renesas with proprietary software packages.
 
Populate meta-renesas with proprietary software packages.
 
<pre>
 
<pre>
PKGS_DIR=$WORK/proprietary
+
export PKGS_DIR=$WORK/proprietary
 
cd $WORK/meta-renesas
 
cd $WORK/meta-renesas
 
sh meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh -f $PKGS_DIR
 
sh meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh -f $PKGS_DIR
 +
unset PKGS_DIR
 
</pre>
 
</pre>
 
</li>
 
</li>

Revision as of 22:14, 19 November 2016

This page contains information on building and running Yocto on Renesas R-Car-H3/M3 Salvator-X, Renesas R-Car-H3/M3 Salvator-X.View, Renesas R-Car-H3 Starter Kit Premier, Renesas R-Car-H3 H3ULCB.View and Renesas R-Car-H3 H3ULCB.HAD, Renesas R-Car-M3 Starter Kit Pro, Renesas R-Car-M3 M3ULCB.View boards.


R-Car Starter Kit Premier is an official name of H3ULCB board
R-Car Starter Kit Pro is an official name of M3ULCB board

Yocto versions

Poky-2.0.1 is supported. Specific commit of meta-openembedded is required.

Preliminary steps

  1. Download evaluation version of proprietary graphics and multimedia drivers from Renesas.

    To download Multimedia and Graphics library, please use the following link:
    https://www.renesas.com/en-us/software/D6000290.html
    To download related Linux drivers, please use the following link:
    https://www.renesas.com/en-us/media/secret/solutions/automotive/rcar-demoboard/R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20160906.zip

    Graphic drivers are required for X11 and Wayland. Multimedia drivers are optional.

  2. Install required packages
    Ubuntu and Debian
    sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
         build-essential chrpath socat libsdl1.2-dev xterm python-crypto
    
    Fedora
    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
    

    Refer to Yocto Project Quick Start for more information.

Building the BSP for Renesas R-Car Salvator-X H3/M3, Salvator-X.View H3/M3, H3ULCB, H3ULCB.View, H3ULCB.HAD, M3ULCB, M3ULCB.View

  1. Create a directory and switch to it
    Warning! Yocto builds require a lot of disk space (up to 100 GB). Make sure you have got enough before starting the build.
    mkdir build
    cd build
    export WORK=`pwd`
    
  2. Clone basic Yocto layers:
    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
    
  3. Switch to proper branches/commits
    1. For Yocto v2.12.0
      cd $WORK/poky
      git checkout -b tmp 40376446904ae3529be41737fed9a0b650ed167d
      cd $WORK/meta-openembedded
      git checkout -b tmp 8ab04afbffb4bc5184cfe0655049de6f44269990
      cd $WORK/meta-linaro
      git checkout -b tmp 9b1fd178309544dff1f7453e796a9437125bc0d9
      

    Another versions are not tested for compatibility.

  4. Clone Renesas BSP layer and switch to the proper branch:
    1. For Yocto v2.12.0
      cd $WORK
      git clone git://github.com/CogentEmbedded/meta-rcar.git meta-renesas -b v2.12.0
      
  5. Apply Linaro-GCC patch file:
    cd $WORK/meta-renesas
    export PATCH_DIR=meta-rcar-gen3/docs/sample/patch/patch-for-linaro-gcc
    patch -p1 < ${PATCH_DIR}/0001-rcar-gen3-add-readme-for-building-with-Linaro-Gcc.patch
    unset PATCH_DIR
    
  6. Unzip downloaded proprietary driver modules to $WORK/proprietary folder.
    You should see the following files:
    1. For Yocto v2.12.0
      $ ls -1 $WORK/proprietary
      R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20160906.tar.gz
      R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20160906.tar.gz
      
  7. Populate meta-renesas with proprietary software packages.
    export PKGS_DIR=$WORK/proprietary
    cd $WORK/meta-renesas
    sh meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh -f $PKGS_DIR
    unset PKGS_DIR
    
  8. Setup build environment
    cd $WORK
    source poky/oe-init-build-env
    
  9. Prepare default configuration files.
    cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/<salvator-x|h3ulcb|m3ulcb>/linaro-gcc/mmp/*.conf ./conf/
    

    For weston/wayland:

    cd $WORK/build
    cp conf/local-wayland.conf conf/local.conf
    

    For X11:

    cd $WORK/build
    cp conf/local-x11.conf conf/local.conf
    
  10. Edit $WORK/build/conf/local.conf to enable/disable graphics and multimedia proprietary drivers support
  11. Edit local.conf to choose machine extension variant
  12. For H3ULCB board only:

    1. Edit local.conf to select IO configuration (by default only H3ULCB board peripherals are enabled):
      MACHINE_FEATURES_append = " h3ulcb-view" (use this append for View IO configuration)
      

      or

      MACHINE_FEATURES_append = " h3ulcb-had" (use this append for HAD IO configuration)
      

    For Salvator-X board only:

    1. Edit local.conf to select IO configuration (by default only Salvator-X board peripherals are enabled):
      MACHINE_FEATURES_append = " salvator-x-view" (use this append for View IO configuration)
      SOC_FAMILY = "r8a7796" (make this change only for M3 Salvator-X, since the default is H3 Salvator-X)
      

    For M3ULCB board only:

    1. Edit local.conf to select IO configuration (by default only M3ULCB board peripherals are enabled):
      MACHINE_FEATURES_append = " m3ulcb-view" (use this append for View IO configuration)
      


  13. Edit local.conf to enable multicluster boot (enable both CA57 and CA53 clusters):
    CA57CA53BOOT = "1"
    
  14. Edit local.conf with evaluation packages requirements:
    1. For Yocto v2.12.0 (to enable EVA_ prefix during packages install)
      DISTRO_FEATURES_append = " use_eva_pkg"
      
  15. Start the build
    For weston/wayland:
    bitbake core-image-weston
    

    For X11:

    bitbake core-image-x11
    
  16. Building image can take upto a few hours depending on your host system performance.
    After the build has been completed successfuly, you should see the output similar to:
    NOTE: Tasks Summary: Attempted 4704 tasks of which 31 didn't need to be rerun and all succeeded.
    

    and the command prompt should return.

  17. Bitbake has generated all the necessary files in ./tmp/deploy/images directory.
    You can verify its content:
    $ ls -1 `find ./tmp/deploy/images/h3ulcb/ -maxdepth 1 -type l -print`
    ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.cpio.gz
    ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.ext4
    ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.manifest
    ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.tar.bz2
    ./tmp/deploy/images/h3ulcb/Image
    ./tmp/deploy/images/h3ulcb/Image-h3ulcb.bin
    ./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb.dtb
    ./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-had.dtb
    ./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-view.dtb
    ./tmp/deploy/images/h3ulcb/modules-h3ulcb.tgz
    ./tmp/deploy/images/h3ulcb/u-boot.bin
    ./tmp/deploy/images/h3ulcb/u-boot-elf-h3ulcb.srec
    ./tmp/deploy/images/h3ulcb/u-boot-elf.srec
    ./tmp/deploy/images/h3ulcb/u-boot-h3ulcb.bin
    

    Image is a Kernel image, *.dtb is a blob file, core-image-weston-h3ulcb.tar.bz2 is the rootfs, modules-h3ulcb.tgz are kernel modules.

  18. You can now boot R-Car H3 SKH3 board over TFTP and NFS

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:

  1. Setup a TFTP server.

    Ubuntu

    Install tftpd-hpa package along with tftp tools:

    sudo apt-get install tftp tftpd-hpa
    

    Fedora

    1. Install necessary packages:
      sudo yum install tftp-server tftp
      

      tftp-server is a part of xinetd. See Fedora manual for more information.

    2. Enable TFTP server:
      sudo vi /etc/xinetd.d/tftp 
      
      Set
      disable = no
      Save file and exit.
    3. Start xinetd:
      sudo systemctl start xinetd.service
      sudo systemctl enable xinetd.service
      
  2. Copy uImage and uImage-r8a7794-silk.dtb from $WORK/build/tmp/deploy/images/silk/ to TFTP server root.

    Ubuntu

    cp $WORK/build/tmp/deploy/images/silk/uImage /srv/tftp/
    cp $WORK/build/tmp/deploy/images/silk/uImage-r8a7794-silk.dtb /srv/tftp/
    

    Fedora

    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/
    
  3. Verify that TFTP server is working.
    tftp localhost -c get uImage && ls uImage
    
  4. Setup NFS server.

    Debian/Ubuntu

    1. Install necessary packages:
      sudo apt-get install nfs-kernel-server nfs-common
      
    2. Start NFS server:
      sudo /etc/init.d/nfs-kernel-server start
      

    Fedora

    1. Install necessary packages:
      sudo yum install nfs-utils
      
    2. Enable and start nfs server:
      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
      
  5. Export root FS to NFS. (Change IMAGE and MACHINE to fit your build).
    1. Unpack rootfs to a dedicated directory:
      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
      
    2. Edit /etc/exports:
      sudo vi /etc/exports
      

      add

      /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)
      

      Save the file and exit.

    3. Force NFS server to re-read /etc/exports
      sudo exportfs -a
  6. Verify that NFS is working.
    [builduser@buildmachine ~]$ showmount -e localhost
    Export list for localhost:
    /nfs/silk *
    /nfs/porter *
    
  7. Boot into U-Boot command prompt
    For SILK board
    1. Make sure SW9 is on pin 1 side.
      Switch pin layout
    2. Connect to serial console over microUSB using minicom or picocom.
    3. Switch the board on or reset it. Press any key to stop U-Boot automatic countdown.

    Refer to SILK board page for more information.

    For Porter board
    1. TBD

    NOTE: Stout board does not have extra switches to select boot device (e.g. primary and secondary/backup QSPI Flash)

  8. Configure Ethernet, TFTP, and kernel command line in U-Boot:
    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
    

    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.
    For example:

    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
    

    The last command writes the configuration to SPI flash.

    => 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 
    

    You can also use

    dhcp
    

    command to obtain information from DHCP server.
    Note: You can always see the environment with printenv command. Refer to U-Boot manual for details.

  9. Verify the connection over Ethernet from U-Boot:
    ping <your-computer-ip>
    

    You should see:

    => 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
    
  10. Reset the board by pushing SW5 "Reset".
  11. The board should boot the kernel:
    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 ...                                                                                                                         
    

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.

  1. Find a reliable microSD card with an adapter to fit your computer. 4 GB should be enough for the task.
  2. Plug the SD card into you computer. Locate the proper device for it, typically /dev/mmcblk0. Use
    dmesg | tail
    

    to print latest messages if in doubt.
    WARNING! Be very careful. Do not select you root partition or any other device with important information. It may be destroyed!
    Double-check that device name is correct by mounting and examining it's content.

  3. Make sure the SD card doesn't contain any important files.
    WARNING! Next step may erase the SD card completely. All files my be lost.
  4. Format the card with one partition with EXT3 file system.
    TBD Update this page with a script which formats the card
  5. Copy root fs to the sd card:
    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 cp "${BUILDDIR}/tmp/deploy/images/${MACHINE}/uImage+dtb" "${SD_ROOT}/boot/"
    sudo tar -xjf "${BUILDDIR}/tmp/deploy/images/${MACHINE}/core-image-${IMAGE}-${MACHINE}.tar.bz2" -C "${SD_ROOT}"
    sudo umount "${SD}"
    
  6. Insert the SD card into microSD slot on the board.
  7. Boot the board into U-Boot command prompt. Refer to section Boot into U-Boot command prompt
  8. Configure kernel command line in U-Boot:
    (For Silk board)
    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
    

    (For Porter board)

    setenv bootcmd 'ext4load mmc 1:1 0x40007fc0 /boot/uImage+dtb; bootm 0x40007fc0'
    setenv bootargs 'console=ttySC6,38400 ignore_loglevel rw rootfstype=ext3 root=/dev/mmcblk0p1 rootwait vmalloc=384M'
    saveenv
    

    (For Stout board)

    setenv bootcmd 'ext4load mmc 0:1 0x40007fc0 /boot/uImage+dtb; bootm 0x40007fc0'
    setenv bootargs 'console=ttySC0,38400 ignore_loglevel rw rootfstype=ext3 root=/dev/mmcblk0p1 rootwait vmalloc=384M video=HDMI-A-1:1024x768-32@60'
    saveenv
    

    The last command writes the configuration to SPI flash.

    => 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 
    
  9. Reset the board by pushing SW5 "Reset" on SILK, SWTBD "Reset" on Porter or SW2 "Reset" on Stout
  10. The board should boot the kernel:
    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 ...      
    

Multiboot

U-Boot allows multiboot configurations. U-Boot can try different boot commands one by one until find the first working command. Use command line interface to configure u-boot. Dual source (MMC and NFS) boot configuration for Silk:

setenv mkBootcmdMMC 'setenv bootcmd ext4load mmc 1:1 0x40007fc0 /boot/uImage+dtb\; bootm 0x40007fc0'
setenv mkBootargsMMC 'setenv bootargs console=ttySC10,38400 ignore_loglevel rw rootfstype=ext3 root=/dev/mmcblk0p1 rootwait vmalloc=384M'
setenv mkBootcmdTFTP 'setenv bootcmd tftp 0x40007fc0 uImage+dtb.silk\; bootm 0x40007fc0'
setenv mkBootargsNFS 'setenv bootargs console=ttySC10,38400 ignore_loglevel rw root=/dev/nfs nfsroot=192.168.1.27:/nfs/silk,nfsvers=3 ip=192.168.1.107:192.168.1.27::255.255.255.0:silk vmalloc=384M'
setenv bootMMC 'run mkBootargsMMC; run mkBootcmdMMC; run bootcmd' 
setenv bootNET 'run mkBootargsNFS; run mkBootcmdTFTP; run bootcmd'
setenv bootcmd 'run bootMMC; run bootNET'

For Porter and Stout mkBootcmdMMC, mkBootargsMMC, mkBootcmdTFTP and mkBootargsNFS should be correctly changed according to their bootcmds and bootargs

How to prepare and boot from eMMC/SD card

This section describes steps that are necessary for preparing and booting from SD card.

Preparing eMMC/SD card

In order to prepare you SD card, follow these instructions:

1.Partion your SD card to set 1 partition and ID=83 (Linux)

$ fdisk /dev/mmcblk0
-> d
-> n
-> p
-> 1
-> t
-> 83

2.Format this partition to ext3 (or ext4)

$ mkfs.ext3 /dev/mmcblk0p1

3.Mount this partition on your host to any directory and upack the core-image-weston-XXXX.tar.bz2 into mounted folder.

$ mount /dev/mmcblk0p1 /mnt
$ cd <your_yocto_build_directory>
$ tar xfj  build/tmp/deploy/images/salvator-x/core-image-weston-salvator-x-20160927181256.rootfs.tar.bz2  -C /mnt

NOTE: probably you need to be a root user, hence use "sudo"

Configure U-Boot to boot from SD card

Proper U-Boot command to boot from SD:

# setenv bootargs 'rw root=/dev/mmcblk1p1 rootfstype=ext3 rootwait'
# ext2load mmc 0:1 0x48080000 /boot/Image
# ext2load mmc 0:1 0x48000000 /boot/Image-r8a7795-salvator-x.dtb
# booti 0x48080000 - 0x48000000'

Example of U-Boot environment vairables:

baudrate=115200
bootargs_emmc=rw root=/dev/mmcblk0p1 rootfstype=ext3 rootwait
bootargs_nfs=rw root=/dev/nfs rootwait ip=dhcp
bootargs_sd0=rw root=/dev/mmcblk1p1 rootfstype=ext3 rootwait
bootargs_sd2=rw root=/dev/mmcblk2p1 rootfstype=ext3 rootwait
bootcmd=run bootcmd_sd0
bootcmd_emmc=set bootargs ${bootargs_emmc};ext2load mmc 1:1 0x48080000 /boot/Image;ext2load mmc 1:1 0x48000000 /boot/${dtb};run booti_cmd
bootcmd_nfs=set bootargs ${bootargs_nfs};bootp 0x48080000 Image;tftp 0x48000000 ${dtb};run booti_cmd
bootcmd_sd0=set bootargs ${bootargs_sd0};ext2load mmc 0:1 0x48080000 /boot/Image;ext2load mmc 0:1 0x48000000 /boot/${dtb};run booti_cmd
bootcmd_sd2=set bootargs ${bootargs_sd2};ext2load mmc 2:1 0x48080000 /boot/Image;ext2load mmc 2:1 0x48000000 /boot/${dtb};run booti_cmd
bootdelay=3
booti_cmd=booti 0x48080000 - 0x48000000
dtb=Image-r8a7795-salvator-x.dtb
ethact=ravb
ethaddr=2E:09:0A:00:BE:11
fdt_high=0xffffffffffffffff
initrd_high=0xffffffffffffffff
stderr=serial
stdin=serial
stdout=serial
ver=U-Boot 2015.04 (Sep 23 2016 - 13:45:29)
Environment size: 1092/131068 bytes

To verify the SD card, type the following in U-Boot prompt:

=> mmc dev 0 
switch to partitions #0, OK
mmc0 is current device
=> mmc info
Device: sh-sdhi
Manufacturer ID: 3
OEM: 5344
Name: SL64G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 59.5 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
=> ext2ls mmc 0:1 /boot
<DIR>       4096 .
<DIR>       4096 ..
<SYM>         32 Image
        14039040 Image-4.6.0-yocto-standard
           69584 Image-r8a7795-salvator-x.dtb

Build scripts examples

  1. Build preparation
    1. For Yocto v2.12.0
      #!/bin/sh
      
      mkdir build || exit
      cd build
      WORK=`pwd`
      echo $WORK
      
      git clone git://git.yoctoproject.org/poky
      git clone git://git.linaro.org/openembedded/meta-linaro.git
      git clone git://git.openembedded.org/meta-openembedded
      git clone git://github.com/CogentEmbedded/meta-rcar.git meta-renesas -b v2.12.0
      
      cd $WORK/poky
      git checkout -b tmp 40376446904ae3529be41737fed9a0b650ed167d
      cd $WORK/meta-linaro
      git checkout -b tmp 9b1fd178309544dff1f7453e796a9437125bc0d9
      cd $WORK/meta-openembedded
      git checkout -b tmp 8ab04afbffb4bc5184cfe0655049de6f44269990
      
      cd $WORK/meta-renesas
      export PATCH_DIR=meta-rcar-gen3/docs/sample/patch/patch-for-linaro-gcc
      patch -p1 < ${PATCH_DIR}/0001-rcar-gen3-add-readme-for-building-with-Linaro-Gcc.patch
      unset PATCH_DIR
      
      cd $WORK/
      PKGS_DIR=$WORK/../proprietary
      cd $WORK/meta-renesas
      #sh meta-rcar-gen3/docs/sample/copyscript/copy_proprietary_softwares.sh -f $PKGS_DIR
      sh meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh -f $PKGS_DIR
      
  2. Building yocto for H3ULCB.View board
    1. For Yocto v2.12.0
      #!/bin/sh
      
      cd build
      WORK=`pwd`
      echo $WORK
      
      cd $WORK
      source poky/oe-init-build-env
      
      #cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/h3ulcb/linaro-gcc/bsp/*.conf ./conf/.
      #cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/h3ulcb/linaro-gcc/gfx-only/*.conf ./conf/.
      cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/h3ulcb/linaro-gcc/mmp/*.conf ./conf/.
      
      cd $WORK/build
      cp conf/local-wayland.conf conf/local.conf
      echo "DISTRO_FEATURES_append = \" use_eva_pkg\"" >> $WORK/build/conf/local.conf
      
      echo "MACHINE_FEATURES_append = \" h3ulcb-view\"" >> $WORK/build/conf/local.conf
      #echo "LVDSCAMERA_ONE = \"1\"" >> $WORK/build/conf/local.conf
      #echo "CA57CA53BOOT = \"1\"" >> $WORK/build/conf/local.conf
      
      bitbake core-image-weston
      

Known issues and limitations

TBD