R-Car/Boards/Kingfisher/Android/Android 10

Introduction
This page contains information on building and running Android on: This BSP doesn't support H3 v1.1 SK(RTP0RC7795SKBX0010SA00) and M3 v1 SK. See also:
 * Infotainment Carrier Board For R-Car Starter Kit(Kingfisher)
 * About H3 v1.1 SK(RTP0RC7795SKBX0010SA00) support.
 * Why Android BSP doesn't support M3v1 SK(RTP0RC7796SKBX0010SA09)?
 * https://elinux.org/R-Car/Boards/H3SK#Hardware
 * https://elinux.org/R-Car/Boards/M3SK#Hardware

Host PC
Ubuntu 18.04/20.04 LTS (64bit) is recommended as an OS for building Android. Building Android BSP requires a lot of RAM at least 16GB. 32bit version is not supported.

Required packages
Detailed environment configuration description can be found in Google Android setup guide: https://source.android.com/source/initializing.html#setting-up-a-linux-build-environment

Using build script

 * 1) Directory Structure
 * # Download "Gen3_Android_v10_2.0.zip" from below URL(Link name is R-Car_H3_M3_INF_Software_package_for_Android_10_v10_2.0)
 * https://www.renesas.com/us/en/application/automotive/r-car-h3-m3-h2-m2-e2-documents-software
 * 1) Build script(build.sh)
 * 2) Build
 * If the build completes successfully, all the necessary files are generated in a following directory:
 * 1) Build
 * If the build completes successfully, all the necessary files are generated in a following directory:
 * If the build completes successfully, all the necessary files are generated in a following directory:

Unpack Android Package
Unpack the Renesas Android package to workspace.
 * 1) DL from below URL to your ${workdirectory}
 * https://www.renesas.com/us/en/application/automotive/r-car-h3-m3-h2-m2-e2-documents-software
 * Download file:
 * Gen3_Android_v10_2.0.zip(Link name is "R-Car_H3_M3_INF_Software_package_for_Android_10_v10_2.0".)

Preparing OpenMAX (OMX), Graphics(GFX) library package
Copy Proprietary Software Packages (OMX and GFX) to pkgs_dir:

Apply patch to support H3 v3 SK equipped with Single-ranked DDR
If you don't user H3 v3 SK with Single-ranked DDR, this step can be skipped. Patch file:

Building the BSP
Please check additional build options and apply any if needed prior to starting the build process.
 * 1) Set Android build environment
 * 2) * For R-Car H3 case:
 * 3) * For R-Car M3 case:
 * 4) Build
 * 1) Build
 * 1) Build

Flashing SREC bootloader files
If you have already installed Android BSP to the board, please erase bootloader on eMMC by executing following commands in U-Boot before flashing IPLs.

It's needed to update the Loader, ARM Trusted firmware, Certification, OP-Tee and u-boot in the QSPI Flash memory as it's described in following pages:
 * R-Car/Boards/H3SK
 * R-Car/Boards/M3SK

Note: If U-boot does not boot after flashing IPLs, please power on the Starter Kit while pushing SW4.

Flashing images using fastboot
Note: this step should be done after successful IPL and U-Boot flashing.

Booting device

 * 1) Connect Monitor to microHDMI(CN4) port in Starter Kit board(Mandatory).
 * 2) Connect Starter Kit board to host PC via debug port(CN12).
 * 3) Connect usb cable to Kingfisher OTG(CN13) for adb debug.
 * 4) (Optional) Connect Ethernet cable(CN7).
 * 5) Power on device.
 * 6) Wait until Android boot is completed.

Resolution parameters
By default HWComposer selects resolutions not higher than Full HD with display aspect ratio.

Measuring FPS on HWC level
To enable fps show: Fps values can be found in logcat log like: To disable fps show:

Microphone level amplification
By default, audio volume may be low when recording from the microphone. This can be affected by using a microphone preamplifier integrated into Kingfisher board extension. Microphone preamplifier is equipped with three switches (SW3, SW4 and SW5 on Kingfisher board). Every switch contains two toggles, responsible for the left and right audio channels. Turning on the toggle will provide the microphone amplification by 20dB.

Known issues
See also:
 * 1) Suspend to RAM is not supported.
 * 2) UI is displayed with distortions on some displays if an interlaced resolution is set.
 * R-Car/Boards/Kingfisher.