R-Car/Boards/S4SK/Yocto-Linux/SDK-v3.16.0

Host PC
Ubuntu 20.04 LTS (64bit) is recommended as OS. 32bit version is not supported.

Building the BSP for R-Car S4 Starter Kit
Warning! Yocto builds require a lot of disk space (up to 100 GB). Make sure you have got enough before starting the build.

Installation of required tools and libraries
Ubuntu is used as Linux Host PC since Yocto Project Quick Start specifies Ubuntu as one of the distributions. You need to install the required packages as follows.

Using build script

 * 1) Build script(build.sh)
 * 2) build
 * 1) build

Manual steps

 * 1) Create a directory and switch to it
 * 2) Clone basic Yocto layers:
 * 3) Switch to proper branches/commits
 * 4) Setup build environment
 * 5) Prepare default configuration files.
 * 6) Start the build
 * 7) Building image can take up to a few hours depending on your host system performance. After the build has been completed successfully, you should see the output similar to:
 * and the command prompt should return.
 * 1) Prepare default configuration files.
 * 2) Start the build
 * 3) Building image can take up to a few hours depending on your host system performance. After the build has been completed successfully, you should see the output similar to:
 * and the command prompt should return.
 * 1) Building image can take up to a few hours depending on your host system performance. After the build has been completed successfully, you should see the output similar to:
 * and the command prompt should return.
 * and the command prompt should return.

Generated images

 * Bitbake has generated all the necessary files in ./tmp/deploy/images directory. You can verify its content:
 * Image is a Kernel image, *.dtb is a blob file, rcar-image-gateway-s4sk.tar.bz2 is the rootfs.
 * The built Image directory is below.
 * https://hydrochoerus.com/rcar/s4sk/build/build-s4sk-gateway/tmp/deploy/images/s4sk/
 * The built directory is below.
 * https://hydrochoerus.com/rcar/s4sk/
 * The built directory is below.
 * https://hydrochoerus.com/rcar/s4sk/

How to flash/update the loader

 * Write the generated bl31-s4sk.srec, tee-s4sk.srec and u-boot-elf-s4sk.srec binaries to flash
 * See : R-Car/Boards/S4SK

Micro SD boot
WARNING! These steps will erase the Micro SD card completely. In short, all files will be lost. In order to prepare you Micro SD card, follow these instructions on host machine:
 * 1) Partion your Micro SD card to set 1 partition and ID=83 (Linux)
 * Make sure the Micro SD card doesn't contain any important files.
 * 1) Format this partition to ext4
 * 2) Mount this partition on your host to any directory and upack the rcar-image-gateway-s4sk.tar.bz2 into mounted folder.
 * NOTE: probably you need to be a root user, hence use "sudo"
 * Image and r8a779f0-s4sk.dtb are deployed under /mnt/boot/ directory
 * 1) Insert Micro SD card to S4 SK Mciro SD card slot(CN5)
 * 2) Set SW3
 * SW3.1 : On
 * SW3.2 : On
 * SW3.3 : Off
 * SW3.4 : On
 * SW3.5 : Off
 * SW3.6 : On
 * SW3.7 : Off
 * SW3.8 : Off
 * 1) Power ON (SW5)
 * SW3.7 : Off
 * SW3.8 : Off
 * 1) Power ON (SW5)

NFS boot

 * 1) Install some packages for NFS boot on Host PC (See R-Car/Boards/Yocto-Gen3/v5.9.0)
 * 2) Decompress the rootfs on Host PC
 * Image and r8a779f0-s4sk.dtb are deployed under /mnt/boot/ directory
 * 1) Connect the Host PC to the S4SK IC101(TSN0) connector with a LAN cable
 * 2) Set SW3
 * SW3.1 : On
 * SW3.2 : On
 * SW3.3 : Off
 * SW3.4 : On
 * SW3.5 : Off
 * SW3.6 : On
 * SW3.7 : Off
 * SW3.8 : Off
 * 1) Power ON (SW5)
 * [*]
 * Check the MAC address of the board using S4_StarterKit_Configurator.exe. See R-Car/Boards/S4SK.
 * Please use the MAC address of TSN0
 * Check the MAC address of the board using S4_StarterKit_Configurator.exe. See R-Car/Boards/S4SK.
 * Please use the MAC address of TSN0

PCIe
See No.3 of Known issues & Restrictions chapter.

PCIe Root Complex(CN30) : SSD
Environment:
 * 1) MZVPV512HDGL-0000
 * 2) U.2 to M.2 M-Key NVME SSD and PCIe
 * 3) Oculink to U.2 Cable
 * 4) SATA/IDE AC Adoperq(Japanese site)
 * s4sk_pcie_nvme3.jpg

PCIe Root Complex(CN30) : LAN card
Environment:
 * PCI-e Network Card

PCIe Endpoint(CN31)
T.B.D

Known issues & Restrictions

 * 1) [Known issue] Bitbake error messages when building SDK first time
 * These error message are Poky 3.1.11 bug, it doesn't affect to build output.
 * Ignore error messages.
 * 1) [Restriction] The "reboot" command is not completed. Therefore, press the power(SW5) or reset(SW4) button.
 * 1) [Restriction] The "reboot" command is not completed. Therefore, press the power(SW5) or reset(SW4) button.


 * 1) [Known issue] PCIe 0ch(Root Complex) of SDK v3.16.0 may not work with some connected devices.
 * If you see logs like the following, please apply this [[File:0001-pci-dwc-renesas-Change-to-mdelay-from-msleep.zip]] patch
 * How to apply patch
 * How to apply patch